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 classStyler.ChartThemestatic classStyler.LegendLayoutstatic classStyler.LegendPositionstatic classStyler.TextAlignmentstatic classStyler.ToolTipTypestatic classStyler.YAxisPosition 
- 
Constructor Summary
Constructors Constructor Description Styler() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FontgetAnnotationsFont()booleangetAntiAlias()FontgetBaseFont()ColorgetChartBackgroundColor()ColorgetChartFontColor()intgetChartPadding()ColorgetChartTitleBoxBackgroundColor()ColorgetChartTitleBoxBorderColor()FontgetChartTitleFont()intgetChartTitlePadding()StringgetDecimalPattern()ColorgetLegendBackgroundColor()ColorgetLegendBorderColor()Set the chart legend border colorFontgetLegendFont()Styler.LegendLayoutgetLegendLayout()Set the legend layoutintgetLegendPadding()Styler.LegendPositiongetLegendPosition()intgetLegendSeriesLineLength()ColorgetPlotBackgroundColor()ColorgetPlotBorderColor()doublegetPlotContentSize()Color[]getSeriesColors()BasicStroke[]getSeriesLines()Marker[]getSeriesMarkers()ThemegetTheme()ColorgetToolTipBackgroundColor()ColorgetToolTipBorderColor()FontgetToolTipFont()ColorgetToolTipHighlightColor()Styler.ToolTipTypegetToolTipType()Styler.YAxisPositiongetYAxisGroupPosistion(int yAxisGroup)BooleanhasAnnotations()booleanisChartTitleBoxVisible()booleanisChartTitleVisible()booleanisLegendVisible()booleanisPlotBorderVisible()booleanisToolTipsAlwaysVisible()booleanisToolTipsEnabled()StylersetAnnotationsFont(Font annotationsFont)Sets the Font used for chart annotationsvoidsetAntiAlias(boolean newVal)StylersetBaseFont(Font baseFont)Set the base fontStylersetChartBackgroundColor(Color color)Set the chart background color - the part around the edge of the chartStylersetChartFontColor(Color color)Set the chart font color.StylersetChartPadding(int chartPadding)Set the chart paddingStylersetChartTitleBoxBackgroundColor(Color chartTitleBoxBackgroundColor)set the chart title box background colorStylersetChartTitleBoxBorderColor(Color chartTitleBoxBorderColor)set the chart title box border colorStylersetChartTitleBoxVisible(boolean isChartTitleBoxVisible)Set the chart title box visibilityStylersetChartTitleFont(Font chartTitleFont)Set the chart title fontStylersetChartTitlePadding(int chartTitlePadding)set the chart title padding; the space between the chart title and the plot areaStylersetChartTitleVisible(boolean isChartTitleVisible)Set the chart title visibilityStylersetDecimalPattern(String decimalPattern)Set the decimal formatter for all numbers on the chart rendered as StringsStylersetHasAnnotations(boolean hasAnnotations)Sets if annotations should be added to charts.StylersetLegendBackgroundColor(Color color)Set the chart legend background colorStylersetLegendBorderColor(Color legendBorderColor)StylersetLegendFont(Font font)Set the chart legend fontvoidsetLegendLayout(Styler.LegendLayout legendLayout)StylersetLegendPadding(int legendPadding)Set the chart legend paddingStylersetLegendPosition(Styler.LegendPosition legendPosition)sets the legend positionStylersetLegendSeriesLineLength(int legendSeriesLineLength)Set the chart legend series line lengthStylersetLegendVisible(boolean isLegendVisible)Set the chart legend visibilityStylersetPlotBackgroundColor(Color plotBackgroundColor)set the plot area's background colorStylersetPlotBorderColor(Color plotBorderColor)set the plot area's border colorStylersetPlotBorderVisible(boolean isPlotBorderVisible)sets the visibility of the border around the plot areaStylersetPlotContentSize(double plotContentSize)Sets the content size of the plot inside the plot area of the chart.StylersetSeriesColors(Color[] seriesColors)StylersetSeriesLines(BasicStroke[] seriesLines)StylersetSeriesMarkers(Marker[] seriesMarkers)StylersetToolTipBackgroundColor(Color toolTipBackgroundColor)StylersetToolTipBorderColor(Color toolTipBorderColor)StylersetToolTipFont(Font toolTipFont)StylersetToolTipHighlightColor(Color toolTipHighlightColor)StylersetToolTipsAlwaysVisible(boolean toolTipsAlwaysVisible)StylersetToolTipsEnabled(boolean toolTipsEnabled)StylersetToolTipType(Styler.ToolTipType toolTipType)voidsetYAxisGroupPosition(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)
 
 - 
 
 -