net.comrom.chart
Class RadarPlotter

java.lang.Object
  extended bynet.comrom.chart.ChartComponent
      extended bynet.comrom.chart.Plotter
          extended bynet.comrom.chart.RadarPlotter

public class RadarPlotter
extends Plotter

Class used to plot radar charts. The following example shows how to create a radar chart:
// data to plot
double[] d1={1,2,3,4,5};
double[] d2={2,3,4,4.2,3};
// create data series
LineDataSerie data1= new LineDataSerie(d1,new LineStyle(2f,GraphicsProvider.getColor(ChartColor.BLUE),LineStyle.LINE_NORMAL));
data1.drawPoint=true;
data1.valueFont=GraphicsProvider.getFont("Arial",ChartFont.BOLD,10);
LineDataSerie data2= new LineDataSerie(d2,new LineStyle(2f,GraphicsProvider.getColor(ChartColor.GREEN),LineStyle.LINE_NORMAL));
data2.drawPoint=true;
data2.valueFont=GraphicsProvider.getFont("Arial",ChartFont.BOLD,10);
data2.fillStyle=new FillStyle(GraphicsProvider.getColor(ChartColor.GREEN));
// create legend
Legend l=new Legend();
l.background=new FillStyle(GraphicsProvider.getColor(ChartColor.WHITE));
l.border=new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.BLACK),LineStyle.LINE_NORMAL);
l.addItem("Products",new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.BLUE),LineStyle.LINE_NORMAL));
l.addItem("Services",new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.GREEN),LineStyle.LINE_NORMAL));
// create title
Title title=new Title("Sales (thousands $)");
// create plotter
RadarPlotter plot=new RadarPlotter();
double[] fMaxs={6,6,6,6,6};
double[] fMins={0,0,0,0,0};
String[] factors={"Factor1","Factor2","Factor3","Factor4","Factor5","Factor6"};
plot.factorMaxs=fMaxs;
plot.factorMins=fMins;
plot.factorNames=factors;
plot.backStyle=new FillStyle(GraphicsProvider.getColor(ChartColor.YELLOW));
plot.gridStyle=new LineStyle(0.2f,GraphicsProvider.getColor(ChartColor.BLACK),LineStyle.LINE_DASHED);
plot.gridFont=GraphicsProvider.getFont("Arial",ChartFont.PLAIN,10);
// create chart using radar plotter
Chart chart=new Chart(title,plot,null,null);
chart.back=new FillStyle(GraphicsProvider.getColor(ChartColor.RED));
chart.back.gradientType=FillStyle.GRADIENT_HORIZONTAL;
chart.legend=l;
// add data series to the chart
chart.addSerie(data2);
chart.addSerie(data1);


Field Summary
 FillStyle backStyle
          back style to fill the chart
 boolean drawCircle
          if true a circle will be painted around the radarchart
 ChartColor factorColor
          color used to paint the factors
 ChartColor[] factorColors
          color of the factor labels
 ChartFont factorFont
          font used to paint the factors
 double[] factorMaxs
          maximum values of the factors.
 double[] factorMins
          minimum vaues of the factors
 java.lang.String[] factorNames
          names of the factors
 ChartFont gridFont
          grid's font
 ChartColor gridFontColor
          grid's font color
 LineStyle gridStyle
          grid's line style
 ChartColor[] pointColors
          color of the points.
 double[] pointColorScale
          ascending list of values used to select the color of the point.
 double radiusModifier
          modifies the size of the chart.
 java.lang.String tickLabelFormat
          format of the tick labels
 int ticks
          number of ticks in scale
 
Fields inherited from class net.comrom.chart.Plotter
back, backImage, depth, visibleHeight, visibleWidth, XScale, Y2Scale, YScale
 
Fields inherited from class net.comrom.chart.ChartComponent
height, width, x, y
 
Constructor Summary
RadarPlotter()
           
 
Methods inherited from class net.comrom.chart.Plotter
addSerie, getCombinable, getNeedsAxis, getSerie, getSeriesCount, plot, plotBackground, replaceSerie, setSerie
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radiusModifier

public double radiusModifier
modifies the size of the chart.


drawCircle

public boolean drawCircle
if true a circle will be painted around the radarchart


factorNames

public java.lang.String[] factorNames
names of the factors


factorColors

public ChartColor[] factorColors
color of the factor labels


factorMins

public double[] factorMins
minimum vaues of the factors


factorMaxs

public double[] factorMaxs
maximum values of the factors.


factorFont

public ChartFont factorFont
font used to paint the factors


factorColor

public ChartColor factorColor
color used to paint the factors


gridStyle

public LineStyle gridStyle
grid's line style


gridFont

public ChartFont gridFont
grid's font


gridFontColor

public ChartColor gridFontColor
grid's font color


ticks

public int ticks
number of ticks in scale


tickLabelFormat

public java.lang.String tickLabelFormat
format of the tick labels


backStyle

public FillStyle backStyle
back style to fill the chart


pointColors

public ChartColor[] pointColors
color of the points.


pointColorScale

public double[] pointColorScale
ascending list of values used to select the color of the point.

Constructor Detail

RadarPlotter

public RadarPlotter()