public final class Template extends Object
A template can be used when initializing the Chart framework to declare global options for all
charts.
For example, it can be used to declare the same color palate for all charts in one place without having to declare it multiple times.
All these options can be also set in the Options class, and take precedence over the values set
in the Template class.
Constructor and Description |
---|
Template() |
Modifier and Type | Method and Description |
---|---|
String |
getLegendPosition()
Returns the legend position.
|
boolean |
isShowLegend()
Returns
true if legend has display. |
void |
setColors(Set<Color> colors)
Sets the color of the charts.
|
void |
setLegendPosition(LegendPosition position)
The legend's position, if it is set to show.
|
void |
setNumberOfColumnsInTheLegend(int noColumns)
Deprecated.
Since 2.5.0, the number of columns in the legend always is 1.
|
void |
showGrid(boolean show)
Determines whether or not to show the grid.
|
void |
showLegend(boolean show)
Determines whether to show the legend.
|
void |
showTooltip(boolean show)
Determines whether or not to show a tool-tip on mouse hover.
|
public void setColors(Set<Color> colors)
These colors are used for lines, points, bars or pie-chart slice, depending on the chart.
If the chart contains more elements than defined colors, values are automatically chosen for
the missing colors.
public boolean isShowLegend()
true
if legend has display.public void showLegend(boolean show)
Default value: true
.
public String getLegendPosition()
public void setLegendPosition(LegendPosition position)
Default value: NorthWest
.
public void setNumberOfColumnsInTheLegend(int noColumns)
Legend entries are shown as part of a table with the specified number of columns.
Note: When setting more than one column and item labels are long, the
user will have to scroll to see other legend items.
Default value: 1
.
public void showGrid(boolean show)
Note: The grid is composed of the axis, axis ticks, axis labels and the actual grid on
the chart.
Setting this value to false will not show the axis ticks and the axis labels even if the options are set to true, as
no axis are being shown at all.
Note: When this option is set to false points near the edges may not be completely drawn.
Default value: true
.
public void showTooltip(boolean show)
Default value: false
.