Render XYSeries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
samoht
Posts: 12
Joined: Wed Jun 18, 2008 12:25 pm
Location: Norway

Render XYSeries

Post by samoht » Wed Jun 18, 2008 12:34 pm

Hi.

I have a dataset with some XYSeries items, i was wondering if it was possible to render one of these series as a barchart? It looks like the whole dataset has one renderer? (is it possible to assign renderers to the series items?).

I'll add that this is a great project, keep it up! :-)

-Thomas

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 Jun 18, 2008 1:42 pm

Each renderer is matched up with a dataset and will be responsible for all the series in the dataset. If you want a different renderer per series, then you need to put each series into its own dataset.

You can create bar charts on an XYPlot using the XYBarRenderer class, but it will expect to have an IntervalXYDataset. Since XYSeriesCollection doesn't implement this interface, you'll need to wrap it using the XYBarDataset class.
David Gilbert
JFreeChart Project Leader

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

samoht
Posts: 12
Joined: Wed Jun 18, 2008 12:25 pm
Location: Norway

Post by samoht » Wed Jun 18, 2008 5:02 pm

I choose to just add the series to own datasets, thanks :)

I wondered about another thing; Is it possible to notice mouseclicks on the line between points in a XYLineChart (and link this to the coresponding dataset)? Im not sure if the line is some kind of entity?

-Thomas

Locked