1 2 package org.krysalis.jcharts.test; 3 4 import java.awt.Color ; 5 import java.awt.Paint ; 6 7 import org.krysalis.jcharts.chartData.ChartDataException; 8 import org.krysalis.jcharts.chartData.RadarChartDataSet; 9 import org.krysalis.jcharts.nonAxisChart.RadarChart; 10 import org.krysalis.jcharts.properties.ChartProperties; 11 import org.krysalis.jcharts.properties.LegendAreaProperties; 12 import org.krysalis.jcharts.properties.LegendProperties; 13 import org.krysalis.jcharts.properties.PropertyException; 14 import org.krysalis.jcharts.properties.RadarChartProperties; 15 16 21 class RadarTestDriver 22 { 23 24 30 public static void main( String [] args ) throws PropertyException, ChartDataException 31 { 32 RadarChartProperties radarChartProperties = new RadarChartProperties(); 33 radarChartProperties.setFillRadar(true); 34 radarChartProperties.setShowGridLines(true); 35 radarChartProperties.setScaleMaxValue(1.0); 36 radarChartProperties.setScaleIncrement(0.25); 37 38 double[][] data = {{0.53, 0.31, 0.38, 0.21, 0.17, 0.63, 0.38}, {0.24, 0.43, 0.65, 0.60, 0.31, 0.45, 0.38} }; 39 Paint [] paints = {Color.red , Color.blue}; 40 String [] legendLabels = {"Test Legend Label", "other data"}; 41 String [] axisLabels = {"label1", "label2", "label3", "label4","label5","label16", "label7"}; 42 RadarChartDataSet dataSet = new RadarChartDataSet( "sample title", data, legendLabels, paints, axisLabels, radarChartProperties ); 43 44 ChartProperties chartProperties = new ChartProperties(); 45 46 LegendProperties legendProperties = new LegendProperties(); 47 legendProperties.setPlacement( LegendAreaProperties.RIGHT ); 48 legendProperties.setNumColumns( 1 ); 49 50 RadarChart chart = new RadarChart( dataSet, legendProperties, chartProperties , 500, 400 ); 51 52 ChartTestDriver.exportImage( chart, "RadarChartTest.png" ); 53 } 54 55 56 57 } 58 | Popular Tags |