org.sonar.api.charts
Class AbstractChart

java.lang.Object
  extended by org.sonar.api.charts.AbstractChart
All Implemented Interfaces:
Chart, Extension, ServerComponent, ServerExtension
Direct Known Subclasses:
DistributionAreaChart, DistributionBarChart, XradarChart

public abstract class AbstractChart
extends Object
implements Chart

An extension point to generate JFreeChart charts

Since:
1.10

Field Summary
static Color[] COLORS
           
static int FONT_SIZE
           
static Color GRID_COLOR
           
static Color OUTLINE_COLOR
           
 
Constructor Summary
AbstractChart()
           
 
Method Summary
protected  void configureColors(org.jfree.data.Values2D dataset, org.jfree.chart.plot.CategoryPlot plot, String[] colorsHex)
          Helper to set color of series.
 BufferedImage generateImage(ChartParameters params)
          Generates a JFreeChart chart using a set of parameters
protected abstract  org.jfree.chart.plot.Plot getPlot(ChartParameters params)
           
protected  boolean hasLegend()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sonar.api.charts.Chart
getKey
 

Field Detail

FONT_SIZE

public static final int FONT_SIZE
See Also:
Constant Field Values

OUTLINE_COLOR

public static final Color OUTLINE_COLOR

GRID_COLOR

public static final Color GRID_COLOR

COLORS

public static final Color[] COLORS
Constructor Detail

AbstractChart

public AbstractChart()
Method Detail

getPlot

protected abstract org.jfree.chart.plot.Plot getPlot(ChartParameters params)

hasLegend

protected boolean hasLegend()

generateImage

public BufferedImage generateImage(ChartParameters params)
Generates a JFreeChart chart using a set of parameters

Specified by:
generateImage in interface Chart
Parameters:
params - the chart parameters
Returns:
the generated chart

toString

public String toString()
Overrides:
toString in class Object

configureColors

protected void configureColors(org.jfree.data.Values2D dataset,
                               org.jfree.chart.plot.CategoryPlot plot,
                               String[] colorsHex)
Helper to set color of series. If the parameter colorsHex is null, then default Sonar colors are used.



Copyright © 2009-2012 SonarSource. All Rights Reserved.