Package org.knowm.xchart.style
Class Styler
- java.lang.Object
-
- org.knowm.xchart.style.Styler
-
- Direct Known Subclasses:
AxesChartStyler
,DialStyler
,PieStyler
,RadarStyler
public abstract class Styler extends Object
The styler is used to manage all things related to styling of the vast number of Chart components- Author:
- timmolter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Styler.ChartTheme
static class
Styler.LegendLayout
static class
Styler.LegendPosition
static class
Styler.TextAlignment
static class
Styler.ToolTipType
static class
Styler.YAxisPosition
-
Constructor Summary
Constructors Constructor Description Styler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Font
getAnnotationsFont()
boolean
getAntiAlias()
Font
getBaseFont()
Color
getChartBackgroundColor()
Color
getChartFontColor()
int
getChartPadding()
Color
getChartTitleBoxBackgroundColor()
Color
getChartTitleBoxBorderColor()
Font
getChartTitleFont()
int
getChartTitlePadding()
String
getDecimalPattern()
Color
getLegendBackgroundColor()
Color
getLegendBorderColor()
Set the chart legend border colorFont
getLegendFont()
Styler.LegendLayout
getLegendLayout()
Set the legend layoutint
getLegendPadding()
Styler.LegendPosition
getLegendPosition()
int
getLegendSeriesLineLength()
Color
getPlotBackgroundColor()
Color
getPlotBorderColor()
double
getPlotContentSize()
Color[]
getSeriesColors()
BasicStroke[]
getSeriesLines()
Marker[]
getSeriesMarkers()
Theme
getTheme()
Color
getToolTipBackgroundColor()
Color
getToolTipBorderColor()
Font
getToolTipFont()
Color
getToolTipHighlightColor()
Styler.ToolTipType
getToolTipType()
Styler.YAxisPosition
getYAxisGroupPosistion(int yAxisGroup)
Boolean
hasAnnotations()
boolean
isChartTitleBoxVisible()
boolean
isChartTitleVisible()
boolean
isLegendVisible()
boolean
isPlotBorderVisible()
boolean
isToolTipsAlwaysVisible()
boolean
isToolTipsEnabled()
Styler
setAnnotationsFont(Font annotationsFont)
Sets the Font used for chart annotationsvoid
setAntiAlias(boolean newVal)
Styler
setBaseFont(Font baseFont)
Set the base fontStyler
setChartBackgroundColor(Color color)
Set the chart background color - the part around the edge of the chartStyler
setChartFontColor(Color color)
Set the chart font color.Styler
setChartPadding(int chartPadding)
Set the chart paddingStyler
setChartTitleBoxBackgroundColor(Color chartTitleBoxBackgroundColor)
set the chart title box background colorStyler
setChartTitleBoxBorderColor(Color chartTitleBoxBorderColor)
set the chart title box border colorStyler
setChartTitleBoxVisible(boolean isChartTitleBoxVisible)
Set the chart title box visibilityStyler
setChartTitleFont(Font chartTitleFont)
Set the chart title fontStyler
setChartTitlePadding(int chartTitlePadding)
set the chart title padding; the space between the chart title and the plot areaStyler
setChartTitleVisible(boolean isChartTitleVisible)
Set the chart title visibilityStyler
setDecimalPattern(String decimalPattern)
Set the decimal formatter for all numbers on the chart rendered as StringsStyler
setHasAnnotations(boolean hasAnnotations)
Sets if annotations should be added to charts.Styler
setLegendBackgroundColor(Color color)
Set the chart legend background colorStyler
setLegendBorderColor(Color legendBorderColor)
Styler
setLegendFont(Font font)
Set the chart legend fontvoid
setLegendLayout(Styler.LegendLayout legendLayout)
Styler
setLegendPadding(int legendPadding)
Set the chart legend paddingStyler
setLegendPosition(Styler.LegendPosition legendPosition)
sets the legend positionStyler
setLegendSeriesLineLength(int legendSeriesLineLength)
Set the chart legend series line lengthStyler
setLegendVisible(boolean isLegendVisible)
Set the chart legend visibilityStyler
setPlotBackgroundColor(Color plotBackgroundColor)
set the plot area's background colorStyler
setPlotBorderColor(Color plotBorderColor)
set the plot area's border colorStyler
setPlotBorderVisible(boolean isPlotBorderVisible)
sets the visibility of the border around the plot areaStyler
setPlotContentSize(double plotContentSize)
Sets the content size of the plot inside the plot area of the chart.Styler
setSeriesColors(Color[] seriesColors)
Styler
setSeriesLines(BasicStroke[] seriesLines)
Styler
setSeriesMarkers(Marker[] seriesMarkers)
Styler
setToolTipBackgroundColor(Color toolTipBackgroundColor)
Styler
setToolTipBorderColor(Color toolTipBorderColor)
Styler
setToolTipFont(Font toolTipFont)
Styler
setToolTipHighlightColor(Color toolTipHighlightColor)
Styler
setToolTipsAlwaysVisible(boolean toolTipsAlwaysVisible)
Styler
setToolTipsEnabled(boolean toolTipsEnabled)
Styler
setToolTipType(Styler.ToolTipType toolTipType)
void
setYAxisGroupPosition(int yAxisGroup, Styler.YAxisPosition yAxisPosition)
Set the YAxis group position.
-
-
-
Method Detail
-
getBaseFont
public Font getBaseFont()
-
setBaseFont
public Styler setBaseFont(Font baseFont)
Set the base font- Parameters:
baseFont
-- Returns:
- styler
-
getChartBackgroundColor
public Color getChartBackgroundColor()
-
setChartBackgroundColor
public Styler setChartBackgroundColor(Color color)
Set the chart background color - the part around the edge of the chart- Parameters:
color
-
-
getChartFontColor
public Color getChartFontColor()
-
setChartFontColor
public Styler setChartFontColor(Color color)
Set the chart font color. includes: Chart title, axes label, legend- Parameters:
color
-
-
getChartPadding
public int getChartPadding()
-
setChartPadding
public Styler setChartPadding(int chartPadding)
Set the chart padding- Parameters:
chartPadding
-
-
getSeriesColors
public Color[] getSeriesColors()
-
getSeriesLines
public BasicStroke[] getSeriesLines()
-
setSeriesLines
public Styler setSeriesLines(BasicStroke[] seriesLines)
-
getSeriesMarkers
public Marker[] getSeriesMarkers()
-
getChartTitleFont
public Font getChartTitleFont()
-
setChartTitleFont
public Styler setChartTitleFont(Font chartTitleFont)
Set the chart title font- Parameters:
chartTitleFont
-- Returns:
-
isChartTitleVisible
public boolean isChartTitleVisible()
-
setChartTitleVisible
public Styler setChartTitleVisible(boolean isChartTitleVisible)
Set the chart title visibility- Parameters:
isChartTitleVisible
-
-
isChartTitleBoxVisible
public boolean isChartTitleBoxVisible()
-
setChartTitleBoxVisible
public Styler setChartTitleBoxVisible(boolean isChartTitleBoxVisible)
Set the chart title box visibility- Parameters:
isChartTitleBoxVisible
-
-
getChartTitleBoxBackgroundColor
public Color getChartTitleBoxBackgroundColor()
-
setChartTitleBoxBackgroundColor
public Styler setChartTitleBoxBackgroundColor(Color chartTitleBoxBackgroundColor)
set the chart title box background color- Parameters:
chartTitleBoxBackgroundColor
-
-
getChartTitleBoxBorderColor
public Color getChartTitleBoxBorderColor()
-
setChartTitleBoxBorderColor
public Styler setChartTitleBoxBorderColor(Color chartTitleBoxBorderColor)
set the chart title box border color- Parameters:
chartTitleBoxBorderColor
-
-
getChartTitlePadding
public int getChartTitlePadding()
-
setChartTitlePadding
public Styler setChartTitlePadding(int chartTitlePadding)
set the chart title padding; the space between the chart title and the plot area- Parameters:
chartTitlePadding
-
-
getLegendBackgroundColor
public Color getLegendBackgroundColor()
-
setLegendBackgroundColor
public Styler setLegendBackgroundColor(Color color)
Set the chart legend background color- Parameters:
color
-
-
getLegendBorderColor
public Color getLegendBorderColor()
Set the chart legend border color- Returns:
-
getLegendFont
public Font getLegendFont()
-
isLegendVisible
public boolean isLegendVisible()
-
setLegendVisible
public Styler setLegendVisible(boolean isLegendVisible)
Set the chart legend visibility- Parameters:
isLegendVisible
-
-
getLegendPadding
public int getLegendPadding()
-
setLegendPadding
public Styler setLegendPadding(int legendPadding)
Set the chart legend padding- Parameters:
legendPadding
-
-
getLegendSeriesLineLength
public int getLegendSeriesLineLength()
-
setLegendSeriesLineLength
public Styler setLegendSeriesLineLength(int legendSeriesLineLength)
Set the chart legend series line length- Parameters:
legendSeriesLineLength
-- Returns:
-
getLegendPosition
public Styler.LegendPosition getLegendPosition()
-
setLegendPosition
public Styler setLegendPosition(Styler.LegendPosition legendPosition)
sets the legend position- Parameters:
legendPosition
-
-
getLegendLayout
public Styler.LegendLayout getLegendLayout()
Set the legend layout- Returns:
-
setLegendLayout
public void setLegendLayout(Styler.LegendLayout legendLayout)
-
getPlotBackgroundColor
public Color getPlotBackgroundColor()
-
setPlotBackgroundColor
public Styler setPlotBackgroundColor(Color plotBackgroundColor)
set the plot area's background color- Parameters:
plotBackgroundColor
-
-
getPlotBorderColor
public Color getPlotBorderColor()
-
setPlotBorderColor
public Styler setPlotBorderColor(Color plotBorderColor)
set the plot area's border color- Parameters:
plotBorderColor
-
-
isPlotBorderVisible
public boolean isPlotBorderVisible()
-
setPlotBorderVisible
public Styler setPlotBorderVisible(boolean isPlotBorderVisible)
sets the visibility of the border around the plot area- Parameters:
isPlotBorderVisible
-
-
getPlotContentSize
public double getPlotContentSize()
-
setPlotContentSize
public Styler setPlotContentSize(double plotContentSize)
Sets the content size of the plot inside the plot area of the chart. To fill the area 100%, use a value of 1.0.- Parameters:
plotContentSize
- - Valid range is between 0 and 1.
-
isToolTipsEnabled
public boolean isToolTipsEnabled()
-
setToolTipsEnabled
public Styler setToolTipsEnabled(boolean toolTipsEnabled)
-
isToolTipsAlwaysVisible
public boolean isToolTipsAlwaysVisible()
-
setToolTipsAlwaysVisible
public Styler setToolTipsAlwaysVisible(boolean toolTipsAlwaysVisible)
-
getToolTipType
public Styler.ToolTipType getToolTipType()
-
setToolTipType
public Styler setToolTipType(Styler.ToolTipType toolTipType)
-
getToolTipBackgroundColor
public Color getToolTipBackgroundColor()
-
getToolTipBorderColor
public Color getToolTipBorderColor()
-
getToolTipFont
public Font getToolTipFont()
-
getToolTipHighlightColor
public Color getToolTipHighlightColor()
-
hasAnnotations
public Boolean hasAnnotations()
-
setHasAnnotations
public Styler setHasAnnotations(boolean hasAnnotations)
Sets if annotations should be added to charts. Each chart type has a different annotation type- Parameters:
hasAnnotations
-
-
getAnnotationsFont
public Font getAnnotationsFont()
-
setAnnotationsFont
public Styler setAnnotationsFont(Font annotationsFont)
Sets the Font used for chart annotations- Parameters:
annotationsFont
-
-
getDecimalPattern
public String getDecimalPattern()
-
setDecimalPattern
public Styler setDecimalPattern(String decimalPattern)
Set the decimal formatter for all numbers on the chart rendered as Strings- Parameters:
decimalPattern
- - the pattern describing the decimal format
-
getYAxisGroupPosistion
public Styler.YAxisPosition getYAxisGroupPosistion(int yAxisGroup)
-
setYAxisGroupPosition
public void setYAxisGroupPosition(int yAxisGroup, Styler.YAxisPosition yAxisPosition)
Set the YAxis group position.- Parameters:
yAxisGroup
-yAxisPosition
-
-
getTheme
public Theme getTheme()
-
getAntiAlias
public boolean getAntiAlias()
-
setAntiAlias
public void setAntiAlias(boolean newVal)
-
-