@Test public void testComputeChart() { System.out.println( "Start" ); RadarChartExpression radarChart = new RadarChartExpression(); TableModel tm = new AggregateTestDataTableModel(); Map<String, Object> data = new HashMap<String, Object>(); CollectorFunctionResult cfr = Mockito.mock( CollectorFunctionResult.class ); Mockito.when( cfr.getDataSet() ).thenReturn( Mockito.mock( org.jfree.data.general.Dataset.class ) ); data.put( "name1", cfr ); StaticDataRow dr = new StaticDataRow( data ); ProcessingContext pc = new DefaultProcessingContext(); DebugExpressionRuntime der = new DebugExpressionRuntime( dr, tm, 0, pc ); radarChart.setRuntime( der ); radarChart.setSeriesColor( new String[]{ "maroon", "#FDDF00" } ); radarChart.setDataSource( "name1" ); JFreeChartReportDrawable chart = (JFreeChartReportDrawable) radarChart.getValue(); Assert.assertTrue( "first color is maroon : ", ( ( (SpiderWebPlot) chart.getChart().getPlot() ).getSeriesPaint( 0 ).equals( ColorHelper.lookupColor( "maroon" ) ) ) ); Assert.assertTrue( "second color is #FDDF00 : ", ( ( (SpiderWebPlot) chart.getChart().getPlot() ).getSeriesPaint( 1 ).equals( Color.decode( "#FDDF00" ) ) ) ); System.out.println( "Finish" ); }
protected JFreeChart computeChart( final Dataset dataset ) { DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset(); if ( dataset instanceof DefaultCategoryDataset ) { defaultDataset = (DefaultCategoryDataset) dataset; } if ( drawgrid == true ) { initializeGrid( defaultDataset ); } final ExtendedSpiderWebPlot plot = new ExtendedSpiderWebPlot( defaultDataset ); for ( int i = 0; i < this.getSeriesColor().length; i++ ) { Color seriesColor; String colorDef = this.getSeriesColor( i ); if ( colorDef == null ) { seriesColor = Color.RED; } else { seriesColor = ColorHelper.lookupColor( colorDef ); if ( seriesColor == null ) { seriesColor = Color.decode( colorDef ); } } plot.setSeriesPaint( i, seriesColor ); } return new JFreeChart( computeTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, isShowLegend() ); }
RadarChartExpression extends AbstractChartExpression { protected JFreeChart computeChart( final Dataset dataset ) { DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset(); if ( dataset instanceof DefaultCategoryDataset ) { defaultDataset = (DefaultCategoryDataset) dataset; } if ( drawgrid == true ) { initializeGrid( defaultDataset ); } final ExtendedSpiderWebPlot plot = new ExtendedSpiderWebPlot( defaultDataset ); for ( int i = 0; i < this.getSeriesColor().length; i++ ) { Color seriesColor; String colorDef = this.getSeriesColor( i ); if ( colorDef == null ) { seriesColor = Color.RED; } else { seriesColor = ColorHelper.lookupColor( colorDef ); if ( seriesColor == null ) { seriesColor = Color.decode( colorDef ); } } plot.setSeriesPaint( i, seriesColor ); } return new JFreeChart( computeTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, isShowLegend() ); } }
RadarChartExpression extends AbstractChartExpression { protected JFreeChart computeChart( final Dataset dataset ) { DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset(); if ( dataset instanceof DefaultCategoryDataset ) { defaultDataset = (DefaultCategoryDataset) dataset; } if ( drawgrid == true ) { initializeGrid( defaultDataset ); } final ExtendedSpiderWebPlot plot = new ExtendedSpiderWebPlot( defaultDataset ); for ( int i = 0; i < this.getSeriesColor().length; i++ ) { Color seriesColor; String colorDef = this.getSeriesColor( i ); if ( colorDef == null ) { seriesColor = Color.RED; } else { seriesColor = ColorHelper.lookupColor( colorDef ); if ( seriesColor == null ) { seriesColor = Color.decode( colorDef ); } } plot.setSeriesPaint( i, seriesColor ); } return new JFreeChart( computeTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, isShowLegend() ); } RadarChartExpression(); }
RadarChartExpression extends AbstractChartExpression { protected JFreeChart computeChart( final Dataset dataset ) { DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset(); if ( dataset instanceof DefaultCategoryDataset ) { defaultDataset = (DefaultCategoryDataset) dataset; } if ( drawgrid == true ) { initializeGrid( defaultDataset ); } final ExtendedSpiderWebPlot plot = new ExtendedSpiderWebPlot( defaultDataset ); for ( int i = 0; i < this.getSeriesColor().length; i++ ) { Color seriesColor; String colorDef = this.getSeriesColor( i ); if ( colorDef == null ) { seriesColor = Color.RED; } else { seriesColor = ColorHelper.lookupColor( colorDef ); if ( seriesColor == null ) { seriesColor = Color.decode( colorDef ); } } plot.setSeriesPaint( i, seriesColor ); } return new JFreeChart( computeTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, isShowLegend() ); } RadarChartExpression(); void setGridintervall( final float gridintervall ); float getGridintervall(); void setDrawgrid( final boolean drawgrid ); boolean isDrawgrid(); void setRadarwebfilled( final boolean radarwebfilled ); boolean isRadarwebfilled(); void setHeadsize( final double headsize ); double getHeadsize(); void setThicknessprimaryseries( final float thicknessprimaryseries ); float getThicknessprimaryseries(); }
RadarChartExpression extends AbstractChartExpression { protected JFreeChart computeChart( final Dataset dataset ) { DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset(); if ( dataset instanceof DefaultCategoryDataset ) { defaultDataset = (DefaultCategoryDataset) dataset; } if ( drawgrid == true ) { initializeGrid( defaultDataset ); } final ExtendedSpiderWebPlot plot = new ExtendedSpiderWebPlot( defaultDataset ); for ( int i = 0; i < this.getSeriesColor().length; i++ ) { Color seriesColor; String colorDef = this.getSeriesColor( i ); if ( colorDef == null ) { seriesColor = Color.RED; } else { seriesColor = ColorHelper.lookupColor( colorDef ); if ( seriesColor == null ) { seriesColor = Color.decode( colorDef ); } } plot.setSeriesPaint( i, seriesColor ); } return new JFreeChart( computeTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, isShowLegend() ); } RadarChartExpression(); void setGridintervall( final float gridintervall ); float getGridintervall(); void setDrawgrid( final boolean drawgrid ); boolean isDrawgrid(); void setRadarwebfilled( final boolean radarwebfilled ); boolean isRadarwebfilled(); void setHeadsize( final double headsize ); double getHeadsize(); void setThicknessprimaryseries( final float thicknessprimaryseries ); float getThicknessprimaryseries();  }