Scrollbar in a line chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
andreweiz
Posts: 4
Joined: Sun Apr 19, 2015 7:18 pm
antibot: No, of course not.

Scrollbar in a line chart

Post by andreweiz » Sun Apr 19, 2015 7:32 pm

hello,

I really need help, already searched a lot and found no solution.

I have a chart created as follows
ChartFactory.createXYLineChart ("Test", "Time (seconds)", "", dataSetCollection, PlotOrientation.VERTICAL, true, true, false);

I really need to put a horizontal scroll bar.


Can someone help me give a hint?

Naxter
Posts: 45
Joined: Thu Jun 26, 2014 8:24 am
antibot: No, of course not.
Location: Germany, Aachen

Re: Scrollbar in a line chart

Post by Naxter » Mon Apr 20, 2015 7:07 am

Have you tried to enclose it in a JScrollPane?

andreweiz
Posts: 4
Joined: Sun Apr 19, 2015 7:18 pm
antibot: No, of course not.

Re: Scrollbar in a line chart

Post by andreweiz » Mon Apr 20, 2015 5:17 pm

yes I've tried.
The way I did not work. I added the chart on the scroll bar.

Have you done this?

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: Scrollbar in a line chart

Post by remiohead » Mon Apr 20, 2015 7:04 pm

We need to see the code you used with the JScrollPane.

andreweiz
Posts: 4
Joined: Sun Apr 19, 2015 7:18 pm
antibot: No, of course not.

Re: Scrollbar in a line chart

Post by andreweiz » Wed Apr 22, 2015 2:24 am

I must be doing something very wrong.
The following is a simple example, when I give the zoom scroll bar does not appear.

Code: Select all

public Example() {
	        JPanel chartPanel = createChartPanel();
	        JScrollPane sPane = new JScrollPane(chartPanel); 
	        add(sPane, BorderLayout.CENTER);
	 
	        setSize(640, 480);
	        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	        setLocationRelativeTo(null);
	    }
	 

andreweiz
Posts: 4
Joined: Sun Apr 19, 2015 7:18 pm
antibot: No, of course not.

Re: Scrollbar in a line chart

Post by andreweiz » Fri Apr 24, 2015 6:01 pm

alguem?

Eu tentei adaptar os topicos abaixo, mas não obtive sucesso.

http://www.jfree.org/phpBB2/viewtopic.php?t=18917

http://www.jfree.org/phpBB2/viewtopic.php?t=6342

Locked