ScatterPlotDemo: How to get triangle-shaped series only!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
snkm007
Posts: 24
Joined: Tue Oct 16, 2007 1:52 pm

ScatterPlotDemo: How to get triangle-shaped series only!

Post by snkm007 » Fri Nov 02, 2007 11:15 am

Hello All,

I'm wondernig as to which API should I use to plot traingle-shaped series items only in the ScatterPlotDemo chart.

Any idea on the approach to this problem.

Thanks,
SNK

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 » Fri Nov 02, 2007 6:20 pm

You need JFreeChart 1.0.6 for this:

Code: Select all

        GeneralPath gp = new GeneralPath();
        gp.moveTo(0.0, 3.0);
        gp.lineTo(3.0, -3.0);
        gp.lineTo(-3.0, -3.0);
        gp.closePath();
        renderer.setAutoPopulateSeriesShape(false);
        renderer.setBaseShape(gp);
...otherwise you'll need to call setSeriesShape(int, shape) for each series on your chart. Whatever shape you supply should be centered on (0, 0) when you define it (JFreeChart will translate the shape to the right place on the chart later).
David Gilbert
JFreeChart Project Leader

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

snkm007
Posts: 24
Joined: Tue Oct 16, 2007 1:52 pm

Circumscribing a triangle (series) shape!

Post by snkm007 » Tue Nov 13, 2007 8:18 am

Hi,

Using GeneralPath, no doubt, helps in getting the shape we want the series to display.

However, if I need to circumscribe a triangle i.e., to say if I need to have common centre for both shapes - triangle and circle- for two different datasets, is there any API available for that?

How do I fix the centre of the shape for a TimeSeriesCollection series in a ScatterPlot?...

Thanks in advance for any help.

Regards,
SNK

Locked