com.java4less.rchart
Class RadarPlotter

java.lang.Object
  |
  +--com.java4less.rchart.ChartComponent
        |
        +--com.java4less.rchart.Plotter
              |
              +--com.java4less.rchart.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
com.java4less.rchart.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 ofd 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 thechart.
 java.lang.String tickLabelFormat
          format of the tick labels
 int ticks
          number of ticks in scale
 
Fields inherited from class com.java4less.rchart.Plotter
back, backImage, depth, visibleHeight, visibleWidth, XScale, Y2Scale, YScale
 
Fields inherited from class com.java4less.rchart.ChartComponent
height, width, x, y
 
Constructor Summary
RadarPlotter()
          constructor
 
Methods inherited from class com.java4less.rchart.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 thechart. The default value is 1. A value of 0.5 will create a chart half the size of the default.


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 ofd 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. See also pointColorScale


pointColorScale

public double[] pointColorScale
ascending list of values used to select the color of the point. See also pointColors.
For example pointColors={Color.red,Color.white,Color.blue} and pointColorScale={10,20} will
- paint a red point if value is < 10 - paint a white point if value is >10 and < 20 - paint a blue point if value is > 20

Constructor Detail

RadarPlotter

public RadarPlotter()
constructor