/** * Applies the attributes of this theme to a {@link SpiderWebPlot}. * * @param plot the plot (<code>null</code> not permitted). */ protected void applyToSpiderWebPlot(SpiderWebPlot plot) { plot.setLabelFont(this.regularFont); plot.setLabelPaint(this.axisLabelPaint); plot.setAxisLinePaint(this.axisLabelPaint); }
/** * Sets the outline stroke for ALL series in the plot. If this is set to * {@code null}, then a list of paints is used instead (to allow * different colors to be used for each series). * * @param stroke the stroke ({@code null} permitted). */ public void setSeriesOutlineStroke(Stroke stroke) { this.seriesOutlineStroke = stroke; fireChangeEvent(); }
RectangleInsets insets = getInsets(); insets.trim(area); drawBackground(g2, area); drawOutline(g2, area); Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getForegroundAlpha())); calculateMaxValue(seriesCount, catCount); double gapHorizontal = area.getWidth() * getInteriorGap(); double gapVertical = area.getHeight() * getInteriorGap(); double angle = getStartAngle() + (getDirection().getFactor() * cat * 360 / catCount); Point2D endPoint = getWebPoint(radarArea, angle, 1); g2.setStroke(this.axisLineStroke); g2.draw(line); drawLabel(g2, radarArea, 0.0, cat, angle, 360.0 / catCount); drawRadarPoly(g2, radarArea, centre, info, series, catCount, headH, headW); drawNoDataMessage(g2, area);
Rectangle2D labelBounds = getLabelFont().getStringBounds(label, frc); LineMetrics lm = getLabelFont().getLineMetrics(label, frc); double ascent = lm.getAscent(); Point2D labelLocation = calculateLabelLocation(labelBounds, ascent, plotArea, startAngle); g2.setPaint(getLabelPaint()); g2.setFont(getLabelFont()); g2.drawString(label, (float) labelLocation.getX(), (float) labelLocation.getY());
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset ({@code null} permitted). * * @see #getDataset() */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
private JFreeChart getRadarChart( BaseChart chart, CategoryDataset dataSet ) { SpiderWebPlot plot = new SpiderWebPlot( dataSet, TableOrder.BY_ROW ); plot.setLabelFont( LABEL_FONT ); JFreeChart radarChart = new JFreeChart( chart.getName(), TITLE_FONT, plot, !chart.isHideLegend() ); setBasicConfig( radarChart, chart ); return radarChart; }
RectangleInsets insets = getInsets(); insets.trim(area); drawBackground(g2, area); drawOutline(g2, area); Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getForegroundAlpha())); calculateMaxValue(seriesCount, catCount); double gapHorizontal = area.getWidth() * getInteriorGap(); double gapVertical = area.getHeight() * getInteriorGap(); double angle = getStartAngle() + (getDirection().getFactor() * cat * 360 / catCount); Point2D endPoint = getWebPoint(radarArea, angle, 1); g2.setStroke(this.axisLineStroke); g2.draw(line); drawLabel(g2, radarArea, 0.0, cat, angle, 360.0 / catCount); drawRadarPoly(g2, radarArea, centre, info, series, catCount, headH, headW); drawNoDataMessage(g2, area);
Rectangle2D labelBounds = getLabelFont().getStringBounds(label, frc); LineMetrics lm = getLabelFont().getLineMetrics(label, frc); double ascent = lm.getAscent(); Point2D labelLocation = calculateLabelLocation(labelBounds, ascent, plotArea, startAngle); g2.setPaint(getLabelPaint()); g2.setFont(getLabelFont()); g2.drawString(label, (float) labelLocation.getX(), (float) labelLocation.getY());
/** * Sets the dataset used by the plot and sends a {@link PlotChangeEvent} * to all registered listeners. * * @param dataset the dataset (<code>null</code> permitted). * * @see #getDataset() */ public void setDataset(CategoryDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... if (this.dataset != null) { this.dataset.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self to trigger plot change event datasetChanged(new DatasetChangeEvent(this, dataset)); }
/** * Sets the webFilled flag and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param flag the flag. * * @see #isWebFilled() */ public void setWebFilled(boolean flag) { this.webFilled = flag; fireChangeEvent(); }
/** * Applies the attributes of this theme to a {@link SpiderWebPlot}. * * @param plot the plot ({@code null} not permitted). */ protected void applyToSpiderWebPlot(SpiderWebPlot plot) { plot.setLabelFont(this.regularFont); plot.setLabelPaint(this.axisLabelPaint); plot.setAxisLinePaint(this.axisLabelPaint); }
/** * Sets the outline paint for ALL series in the plot. If this is set to * {@code null}, then a list of paints is used instead (to allow * different colors to be used for each series). * * @param paint the paint ({@code null} permitted). */ public void setSeriesOutlinePaint(Paint paint) { this.seriesOutlinePaint = paint; fireChangeEvent(); }
/** * Sets the head percent and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param percent the percent. * * @see #getHeadPercent() */ public void setHeadPercent(double percent) { this.headPercent = percent; fireChangeEvent(); }
/** * Sets the axis label gap and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param gap the gap. * * @see #getAxisLabelGap() */ public void setAxisLabelGap(double gap) { this.axisLabelGap = gap; fireChangeEvent(); }
/** * Sets the outline stroke for ALL series in the plot. If this is set to * </code> null</code>, then a list of paints is used instead (to allow * different colors to be used for each series). * * @param stroke the stroke (<code>null</code> permitted). */ public void setSeriesOutlineStroke(Stroke stroke) { this.seriesOutlineStroke = stroke; fireChangeEvent(); }
/** * Sets the webFilled flag and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param flag the flag. * * @see #isWebFilled() */ public void setWebFilled(boolean flag) { this.webFilled = flag; fireChangeEvent(); }
/** * Sets the head percent and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param percent the percent. * * @see #getHeadPercent() */ public void setHeadPercent(double percent) { this.headPercent = percent; fireChangeEvent(); }
/** * Sets the maximum value any category axis can take and sends * a {@link PlotChangeEvent} to all registered listeners. * * @param value the maximum value. * * @see #getMaxValue() */ public void setMaxValue(double value) { this.maxValue = value; fireChangeEvent(); }
/** * Sets the paint for ALL series in the plot. If this is set to * {@code null}, then a list of paints is used instead (to allow different * colors to be used for each series of the radar group). * * @param paint the paint ({@code null} permitted). * * @see #getSeriesPaint() */ public void setSeriesPaint(Paint paint) { this.seriesPaint = paint; fireChangeEvent(); }
/** * Sets the URL generator for the plot and sends a * {@link PlotChangeEvent} to all registered listeners. * * @param generator the generator ({@code null} permitted). * * @see #getURLGenerator() * * @since 1.0.2 */ public void setURLGenerator(CategoryURLGenerator generator) { this.urlGenerator = generator; fireChangeEvent(); }