List of usage examples for org.jfree.chart.plot SpiderWebPlot setSeriesPaint
public void setSeriesPaint(int series, Paint paint)
From source file:org.sonar.plugins.core.charts.XradarChart.java
private void configureColors(SpiderWebPlot plot, ChartParameters params) { String[] colors = params.getValues(PARAM_COLOR, "|"); for (int i = 0; i < colors.length; i++) { plot.setSeriesPaint(i, Color.decode("0x" + colors[i])); }//from www .j av a2 s . c o m }
From source file:sernet.gs.ui.rcp.main.bsi.views.chart.MaturitySpiderChart.java
protected JFreeChart createSpiderChart(Object dataset) { SpiderWebPlot plot = new SpiderWebPlot((CategoryDataset) dataset); plot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); plot.setSeriesPaint(0, new Color(0.0f, 1f, 0f, 1f)); // green plot.setSeriesPaint(1, new Color(1f, 1f, 0f, 1f)); // yellow plot.setSeriesPaint(2, new Color(1f, 0f, 0f, 1f)); // red plot.setSeriesPaint(3, new Color(0f, 0f, 0f, 1f)); // grey plot.setWebFilled(true);//from w ww. ja va2 s . c o m JFreeChart chart = new JFreeChart(Messages.MaturitySpiderChart_0, TextTitle.DEFAULT_FONT, plot, false); LegendTitle legend = new LegendTitle(plot); legend.setPosition(RectangleEdge.BOTTOM); chart.addSubtitle(legend); return chart; }
From source file:sernet.gs.ui.rcp.main.bsi.views.chart.ISRSpiderChart.java
protected JFreeChart createSpiderChart(Object dataset) { SpiderWebPlot plot = new SpiderWebPlot((CategoryDataset) dataset); plot.setToolTipGenerator(new StandardCategoryToolTipGenerator()); plot.setSeriesPaint(0, new Color(0.0f, 1f, 0f, 1f)); // green plot.setSeriesPaint(1, new Color(1f, 1f, 0f, 1f)); // yellow plot.setSeriesPaint(2, new Color(1f, 0f, 0f, 1f)); // red plot.setSeriesPaint(3, new Color(0f, 0f, 0f, 1f)); // grey plot.setWebFilled(true);// ww w. j a va2 s .c o m JFreeChart chart = new JFreeChart(Messages.ISRSpiderChart_0, TextTitle.DEFAULT_FONT, plot, false); LegendTitle legend = new LegendTitle(plot); legend.setPosition(RectangleEdge.BOTTOM); chart.addSubtitle(legend); return chart; }
From source file:msi.gama.outputs.layers.charts.ChartJFreeChartOutputRadar.java
protected void resetRenderer(final IScope scope, final String serieid) { final SpiderWebPlot plot = (SpiderWebPlot) this.chart.getPlot(); final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid); if (!IdPosition.containsKey(serieid)) { // DEBUG.LOG("pb!!!"); } else {//from w w w.ja v a2 s . c o m final int myrow = IdPosition.get(serieid); if (myserie.getMycolor() != null) { plot.setSeriesPaint(myrow, myserie.getMycolor()); } if (this.series_label_position.equals("onchart")) { //// newr.setBaseItemLabelGenerator(new LabelGenerator()); // ItemLabelPosition itemlabelposition = new //// ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, //// TextAnchor.BOTTOM_CENTER); // newr.setBasePositiveItemLabelPosition(itemlabelposition); // newr.setBaseNegativeItemLabelPosition(itemlabelposition); // newr.setBaseItemLabelsVisible(true); } } }
From source file:org.squale.squaleweb.util.graph.KiviatMaker.java
/** * Create the JreeChart object/*from w ww . j a v a 2 s . c o m*/ * * @param showLegend indicate if it should display the legend or not * @param showBackground indicate if we want showBackground * @return The JreeChart object */ public JFreeChart getChart(boolean showLegend, boolean showBackground) { JFreeChart retChart = super.getChart(); // Creation of the graph if it not already exist if (null == retChart) { // Creation of the plot SpiderWebPlot plot = new SpiderWebPlot(mDataset); // Creation of the picture. The plot is inside the picture retChart = new JFreeChart(mTitle, TextTitle.DEFAULT_FONT, plot, false); // Display of the legend if (showLegend) { LegendTitle legendtitle = new LegendTitle(plot); legendtitle.setPosition(RectangleEdge.BOTTOM); retChart.addSubtitle(legendtitle); } // Definition of the style of the three first draw in the spiderWEbPlot. // This three first draw represent the scale for the mark 1.0, 2.0 and 3.0 in the plot // First we define the style final float miterLimit = 10.0f; final float[] dashPattern = { 5.0f, 3.0f }; BasicStroke dash = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE, // End cap BasicStroke.JOIN_MITER, // Join style miterLimit, // Miter limit dashPattern, // Dash pattern 0.0f); // We associate this style to the draw plot.setSeriesPaint(0, new Color(WebMessages.getInt("kiviat.color.1"))); plot.setSeriesOutlineStroke(0, dash); plot.setSeriesPaint(1, new Color(WebMessages.getInt("kiviat.color.2"))); plot.setSeriesOutlineStroke(1, dash); plot.setSeriesPaint(2, new Color(WebMessages.getInt("kiviat.color.3"))); plot.setSeriesOutlineStroke(2, dash); // Define the gap what is draw and the border of the plot plot.setInteriorGap(DEFAULT_GAP); // Define the style of the line stroke plot.setBaseSeriesOutlineStroke(new BasicStroke(2.0f)); // The max value put in the plot (for the scale) plot.setMaxValue(SCALE_MAX_VALUE); // Indicate if we want fill the inner of the draw plot.setWebFilled(FILL_RADAR); if (!showBackground) { // Set the background of the picture to white retChart.setBackgroundPaint(Color.WHITE); // Set the border of the plot to white plot.setOutlinePaint(Color.WHITE); } super.setChart(retChart); } return retChart; }
From source file:org.pentaho.plugin.jfreereport.reportcharts.RadarChartExpression.java
protected void configureChart(final JFreeChart chart) { super.configureChart(chart); //Create the stroke for the primary (= real) data series... final Stroke thick = new BasicStroke(thicknessprimaryseries); //...and apply that stroke to the series final SpiderWebPlot webPlot = (SpiderWebPlot) chart.getPlot(); webPlot.setLabelFont(Font.decode(getLabelFont())); if (StringUtils.isEmpty(getTooltipFormula()) == false) { webPlot.setToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula())); }/* ww w . ja va2 s . c o m*/ if (StringUtils.isEmpty(getUrlFormula()) == false) { webPlot.setURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula())); } final CategoryDataset categoryDataset = webPlot.getDataset(); final int count = categoryDataset.getRowCount(); for (int t = 0; t < count; t++) { if (categoryDataset.getRowKey(t) instanceof GridCategoryItem) { continue; } webPlot.setSeriesOutlineStroke(t, thick); } //Set the spiderweb filled (or not) webPlot.setWebFilled(radarwebfilled); //Set the size of the datapoints on the axis webPlot.setHeadPercent(headsize); //Set the color of the fake datasets (gridlines) to grey for (int t = 0; t < count; t++) { if (categoryDataset.getRowKey(t) instanceof GridCategoryItem) { webPlot.setSeriesPaint(t, Color.GRAY); } } }