Hello,
I need to create some XY scatterplots where each point has a different marker shape/color/size. Can JFreeChart do it? The bubble chart demo comes closest, but it doesn't show whether the shape & size attributes can also be controlled on a per-point basis.
For example: http://www.tableausoftware.com/web/prod ... egies.html
http://www.spotfire.com/products/decisionsite.cfm
http://www.tableausoftware.com/web/prod ... ducts.html
If it can't yet, then I'd request this feature. Also, there might be text associated with each point. I understand you support per-point tooltips, so that's good.
George
?control marker shape/color/size per-point (not per-series)
example image
Here's a couple example images of what could be done with this capability:
[/img]
[/img]
gnuplot 4.1 can now do it
FYI, this capability has just been added in gnuplot v4.1:
splot 'earthquakes.csv' using 1:2:3:4 with points pt 5 pointsize var linetype palette
And it can also plot text labels next to each marker, controlling the color of the text:
splot 'my.dat' using 1:2:(1):3:4 with labels notitle point pt 6 lw .1 left offset 1,0 font "Helvetica,7" tc pal
Just posting, FYI. No competition intended. The world fully needs a Java library to do this stuff..
splot 'earthquakes.csv' using 1:2:3:4 with points pt 5 pointsize var linetype palette
And it can also plot text labels next to each marker, controlling the color of the text:
splot 'my.dat' using 1:2:(1):3:4 with labels notitle point pt 6 lw .1 left offset 1,0 font "Helvetica,7" tc pal
Just posting, FYI. No competition intended. The world fully needs a Java library to do this stuff..
how to go about it
May I conclude from the silence that JFreeChart doesn't currently support this?
So, how would one go about this? Create a new subclass of the XY dataset that has additional methods such as:
getMarkShape(int series, int index)
getMarkSize(int series, int index)
getMarkFillColor(int series, int index)
getMarkOutlineColor(int series, int index)
getMarkTooltip(int series, int index)
(or perhaps just a getMarker(int,int) or drawMarker(g2......))
and then perhaps JFreeChart could make use of this "tabular" dataset view for drawing the scatterplot.
What do you think?
Any way this could be factored better so it's easy for a user to tweak which attributes get used for color,shape,size,etc. One might like to use a different attribute for the size without having to go re-write the code. Also, the color chosen might be with respect to a pallete of colors that depends on the range of the attribute being plotted. Instead of the dataset returning the color orange, it should just return a number, which gets histogrammed by the JFreeChart infrastructure and converted into a nice color spectrum.
Any OO gurus out there who could suggest a design that would factor well?
So, how would one go about this? Create a new subclass of the XY dataset that has additional methods such as:
getMarkShape(int series, int index)
getMarkSize(int series, int index)
getMarkFillColor(int series, int index)
getMarkOutlineColor(int series, int index)
getMarkTooltip(int series, int index)
(or perhaps just a getMarker(int,int) or drawMarker(g2......))
and then perhaps JFreeChart could make use of this "tabular" dataset view for drawing the scatterplot.
What do you think?
Any way this could be factored better so it's easy for a user to tweak which attributes get used for color,shape,size,etc. One might like to use a different attribute for the size without having to go re-write the code. Also, the color chosen might be with respect to a pallete of colors that depends on the range of the attribute being plotted. Instead of the dataset returning the color orange, it should just return a number, which gets histogrammed by the JFreeChart infrastructure and converted into a nice color spectrum.
Any OO gurus out there who could suggest a design that would factor well?
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: how to go about it
Silence from me usually means I'm too busy to respond to issues in the free support forum.potential user @HP wrote:May I conclude from the silence that JFreeChart doesn't currently support this?
Extending the XYDataset interface is the way that this has been done for other "special" plot types (e.g. high-low charts). It doesn't seem that clean a solution to me, but I haven't really had time to explore other alternatives. One idea would be to write an XYOb jectDataset interface, that is like the XYZDataset interface but the 'Z' is an object - then have renderers cast that to whatever they are expecting.potential user @HP wrote:So, how would one go about this? Create a new subclass of the XY dataset that has additional methods such as:
getMarkShape(int series, int index)
getMarkSize(int series, int index)
getMarkFillColor(int series, int index)
getMarkOutlineColor(int series, int index)
getMarkTooltip(int series, int index)
(or perhaps just a getMarker(int,int) or drawMarker(g2......))
and then perhaps JFreeChart could make use of this "tabular" dataset view for drawing the scatterplot.
What do you think?
Any way this could be factored better so it's easy for a user to tweak which attributes get used for color,shape,size,etc. One might like to use a different attribute for the size without having to go re-write the code. Also, the color chosen might be with respect to a pallete of colors that depends on the range of the attribute being plotted. Instead of the dataset returning the color orange, it should just return a number, which gets histogrammed by the JFreeChart infrastructure and converted into a nice color spectrum.
Any OO gurus out there who could suggest a design that would factor well?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: ?control marker shape/color/size per-point (not per-seri
i have now your same problem with a bubble chart..... do you have found a solution ?