A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
atongo
- Posts: 10
- Joined: Sun Jul 23, 2006 9:53 pm
Post
by atongo » Wed Sep 06, 2006 12:13 pm
Hi folks,
I have seen similar posts many times on this forum and it is rather unfortunate that guys just ignore or

. Some of us are not Swing gurus and we take inspiration from this forum. This challenge might be trivial to many but to some of us we are still in the learning process..The problem is this same dynamic chart which is scrollable...I would appreciate it so much if someone who knows how to do it would not ignore...My questions are these
1. How can I set the vertical gridlines to have the same spacing?
2. Is it possible to set the chart so that the domain axis has constant tickunit size? and it does not rescale or resize but new data is added to the right so it can easily stretch horizontally whiles sitting in a scrollpane?
your help will be more than treasured
ato
-
david.gilbert
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
-
Contact:
Post
by david.gilbert » Thu Sep 07, 2006 3:29 pm
atongo wrote:1. How can I set the vertical gridlines to have the same spacing?
Gridlines are drawn at each tick marks, and these are regularly spaced along the axis. So I'm not sure what you mean by this.
atongo wrote:2. Is it possible to set the chart so that the domain axis has constant tickunit size? and it does not rescale or resize but new data is added to the right so it can easily stretch horizontally whiles sitting in a scrollpane?
You can put the whole chart into a scrollpane, but the chart panel won't resize when you add data (unless you write your own code to resize the chart panel). And I presume you only want the data area of the chart to be scrollable...that doesn't work inside a JScrollPane, because the chart is not composed of subcomponents that can be placed in scroll panes..
-
atongo
- Posts: 10
- Joined: Sun Jul 23, 2006 9:53 pm
Post
by atongo » Thu Sep 07, 2006 3:52 pm
Thanks a lot David,
I now understand what I have to do. I will take a look at the chartPanel again and see how I can make it resize after adding data..
I do really appreciate your explanaition: By the way I know you have a very long to do-list, but I will suggest that you include such a feature in the chartPanel(resizable) and a subsequent demo in the developer guide. It will be nice to create a chart like a monograph where one can roll back and forth to see the data.
Regards.
atongo.
-
david.gilbert
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
-
Contact:
Post
by david.gilbert » Thu Sep 07, 2006 4:57 pm
Actually, take a look at the TranslateDemo1.java application included with the latest release of the JFreeChart Developer Guide - it uses a slider to roll the data backwards and forwards. It is probably a good starting point for scrolling (but note that it requires a complete chart redraw for each update).