Java Code Examples for org.jfree.chart.plot.SpiderWebPlot#setLabelFont()

The following examples show how to use org.jfree.chart.plot.SpiderWebPlot#setLabelFont() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultChartService.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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;
}
 
Example 2
Source File: ChartImageGenerator.java    From dhis2-core with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private JFreeChart getRadarChart( final Visualization visualization, CategoryDataset dataSet )
{
    SpiderWebPlot plot = new SpiderWebPlot( dataSet, TableOrder.BY_ROW );
    plot.setLabelFont( LABEL_FONT );

    JFreeChart radarChart = new JFreeChart( visualization.getName(), TITLE_FONT, plot, !visualization.isHideLegend() );

    setBasicConfig( radarChart, visualization );

    return radarChart;
}
 
Example 3
Source File: StandardChartTheme.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 4
Source File: StandardChartTheme.java    From ccu-historian with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 5
Source File: StandardChartTheme.java    From SIMVA-SoS with Apache License 2.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 6
Source File: ChartJFreeChartOutputRadar.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void initChart_post_data_init(final IScope scope) {
	// TODO Auto-generated method stub
	super.initChart_post_data_init(scope);
	final SpiderWebPlot pp = (SpiderWebPlot) chart.getPlot();

	// final String sty = getStyle();
	// this.useSubAxis=false;
	// switch (sty) {
	// default: {
	if (this.series_label_position.equals("default")) {
		this.series_label_position = "legend";
	}
	// break;
	// }
	// }
	if (this.series_label_position.equals("xaxis")) {
		// this.useSubAxis=true;
	}

	if (!this.series_label_position.equals("legend")) {
		chart.getLegend().setVisible(false);
		// legend is useless, but I find it nice anyway... Could put back...
	}
	this.resetDomainAxis(scope);

	pp.setAxisLinePaint(axesColor);

	pp.setLabelFont(getLabelFont());
	if (textColor != null) {
		pp.setLabelPaint(textColor);
	}

	// if (ylabel != null && ylabel != "") {}
	if (this.series_label_position.equals("yaxis")) {
		// pp.getRangeAxis().setLabel(this.getChartdataset().getDataSeriesIds(scope).iterator().next());
		chart.getLegend().setVisible(false);
	}
	chart.getLegend().setVisible(true);

	if (xlabel != null && xlabel != "") {
		// pp.getDomainAxis().setLabel(xlabel);
	}

	if (this.series_label_position.equals("none")) {
		pp.setLabelPaint(this.backgroundColor);
	}

}
 
Example 7
Source File: StandardChartTheme.java    From ECG-Viewer with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 8
Source File: StandardChartTheme.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 9
Source File: RadarChartExpression.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
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() ) );
  }
  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 );
    }
  }

}
 
Example 10
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}
 
Example 11
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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);
}