Bar chart with different scales for each series

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
prophecy
Posts: 3
Joined: Wed Feb 23, 2005 6:57 am

Bar chart with different scales for each series

Post by prophecy » Wed Feb 23, 2005 7:01 am

Can you have a bar chart with different scales on the data, say for example series A ranges from 1-10 and series B ranges from 0-1000. But if a bar in series A were 9, it would be the same height of bar as a value of 900 in series B.

Possible?

rauf
Posts: 6
Joined: Fri Dec 03, 2004 1:35 pm

yes it is possible

Post by rauf » Wed Feb 23, 2005 8:40 am

Hi,

It is possible, to have a bar chart with different heights w.r.t particular category.

for ex: if i have series A height as 9 and series B height as 999 then we can show separately with their heights in a single bar chart.

From this i cant send any attachment.

Regards
Rauf

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 » Wed Feb 23, 2005 10:32 am

It needs a trick - for two series, you would need to define two datasets both containing two series (four series in all). In the first dataset, series 2 contains all null values. In the second dataset, series 1 contains all null values. Then you create a second range axis in the normal way, and have to override the legend to hide the two null series. See DualAxisDemo5.java in the demos included with the JFreeChart Developer Guide.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked