I'm working on a program, collecting around twenty slider values from JSliders (bad sliders from values -4 up to 0 and good sliders from 0 to +4)
looking like this:
My program collects all these 20 sliders in an array, catching the values of the changed sliders.
The program should, therefore, create a Chart, to view these values. Therefore I have to use a Spider chart
as you can see here:
spider
I made a collection, adding my series to a graph:
final XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(r1); dataset.addSeries(r2);
Added the dataset to my chart via JFreeChart
designed a plot: final XYPlot plot = xylineChart.getXYPlot();
coded my axis:
` ValueAxis domainAxis = plot.getDomainAxis(); // y
ValueAxis rangeAxis = plot.getRangeAxis(); // x
domainAxis.setRange(0.0, 1.0);
((NumberAxis) domainAxis).setTickUnit(new NumberTickUnit(0.5));
rangeAxis.setRange(0.0, 1.0);
((NumberAxis) rangeAxis).setTickUnit(new NumberTickUnit(0.5));
plot.getRangeAxis().setRange(-4, 4); // Y Achse Range
plot.getDomainAxis().setRange(-4,4);
final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
// renderer.setSeriesShapesVisible(0, false);
renderer.setSeriesPaint( 0 , Color.RED );
renderer.setSeriesLinesVisible(0, false);
renderer.setSeriesPaint( 1 , Color.GREEN );
renderer.setSeriesLinesVisible(1, false);
plot.setRenderer(renderer);
So my question is now, how to display the points at the right position of my spider chart.
Do I have to add a coordinate System for every single point here?
for example, I would like to display sozialer Druck
(=social pressure) my Slider value from above -4
, then I have to set the coordinates (-3/-2)
for -3
then (-2.6,-1.6)
and so on for every single point.
Could anybody help me make this easier? (I can't really change the background graphic to something like a bar chart or anything easier, unfortunately)
Thank you! @luxora