How to draw a graph with fixed Y-axis and varying X-axis....

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
SwethaKrish
Posts: 13
Joined: Tue Jun 19, 2007 6:03 am

How to draw a graph with fixed Y-axis and varying X-axis....

Post by SwethaKrish » Tue Jun 19, 2007 6:05 am

I can draw graph with given dataset.But the Scaling of the graph is high when a single value is high.So is there any solution to scale down the graph to a particular value.

liaoya
Posts: 9
Joined: Mon May 21, 2007 5:13 am

Call the axis and change its range

Post by liaoya » Tue Jun 19, 2007 8:35 am

You can determine the axis's range.

Get Plot(Maybe XYPlot) object from JFreechart, and use getDomainAxis or getRangeAxis to get the axis you want, do the necessary type transfer, call the setRange if the axis is instanceof ValueAxis.

SwethaKrish
Posts: 13
Joined: Tue Jun 19, 2007 6:03 am

Thank you

Post by SwethaKrish » Thu Jun 21, 2007 6:52 am

Your suggestion worked out and i can get the graph what i expected.
Thank you for your help ....

Locked