Legend,bar chart using xml

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
j
Posts: 14
Joined: Tue Jul 22, 2003 12:56 pm

Legend,bar chart using xml

Post by j » Tue Jul 22, 2003 1:00 pm

1. Can u create a new legend ?? coz the legend class does not provide any methods for adding new items.
2. how can u create a stacked bar chart using xml?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Legend,bar chart using xml

Post by david.gilbert » Tue Jul 22, 2003 10:43 pm

j wrote:1. Can u create a new legend ?? coz the legend class does not provide any methods for adding new items.
You can write your own legend class...or subclass the plot and override the getLegendItems(...) method.
j wrote:2. how can u create a stacked bar chart using xml?
Not exactly sure what you mean by that...but you can use the DatasetReader class to read a CategoryDataset from an XML file, then create a stacked bar chart from that.
David Gilbert
JFreeChart Project Leader

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

j
Posts: 14
Joined: Tue Jul 22, 2003 12:56 pm

bar chart using xml

Post by j » Wed Jul 23, 2003 5:35 am

ya i know how a bar chart is craetd. have seen the demos. but incase of a stacked bar chart teh data is in the from of a 2-d array. in that case how do i mention it in xml file??


thanks and regards

j

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 Jul 23, 2003 11:37 pm

I still don't understand...both the regular and stacked bar charts are created using a CategoryDataset. And you can use the DatasetReader class to read a CategoryDataset from an XML file. Whether you use that dataset for a bar chart or a stacked bar chart doesn't matter.
David Gilbert
JFreeChart Project Leader

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

j
Posts: 14
Joined: Tue Jul 22, 2003 12:56 pm

barchart using xml

Post by j » Thu Jul 24, 2003 5:28 am

thank you. i got the solution. similar to what u said.

Locked