Package org.knowm.xchart.style
Class Styler
java.lang.Object
org.knowm.xchart.style.Styler
- Direct Known Subclasses:
AxesChartStyler
,DialStyler
,PieStyler
,RadarStyler
The styler is used to manage all things related to styling of the vast number of Chart components
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
static enum
static enum
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
int
int
Set the chart legend border colorSet the legend layoutint
int
int
double
Color[]
Marker[]
boolean
getTheme()
getYAxisGroupPosistion
(int yAxisGroup) getYAxisGroupTitleColor
(int yAxisGroup) int
boolean
boolean
boolean
boolean
boolean
boolean
setAnnotationLineColor
(Color annotationLineColor) setAnnotationLineStroke
(BasicStroke annotationLineStroke) setAnnotationTextFont
(Font annotationTextFont) setAnnotationTextFontColor
(Color annotationTextFontColor) setAnnotationTextPanelBorderColor
(Color borderColor) setAnnotationTextPanelFontColor
(Color annotationTextPanelFontColor) setAnnotationTextPanelPadding
(int annotationTextPanelPadding) setAntiAlias
(boolean newVal) setBaseFont
(Font baseFont) Set the base fontsetChartBackgroundColor
(Color color) Set the chart background color - the part around the edge of the chartsetChartButtonBackgroundColor
(Color chartButtonBackgroundColor) setChartButtonBorderColor
(Color chartButtonBorderColor) setChartButtonFont
(Font chartButtonFont) setChartButtonFontColor
(Color chartButtonFontColor) setChartButtonMargin
(int chartButtonMargin) setChartButtonPosition
(Styler.ChartButtonPosition chartButtonPosition) setChartFontColor
(Color color) Set the chart font color.setChartPadding
(int chartPadding) Set the chart paddingsetChartTitleBoxBackgroundColor
(Color chartTitleBoxBackgroundColor) set the chart title box background colorsetChartTitleBoxBorderColor
(Color chartTitleBoxBorderColor) set the chart title box border colorsetChartTitleBoxVisible
(boolean isChartTitleBoxVisible) Set the chart title box visibilitysetChartTitleFont
(Font chartTitleFont) Set the chart title fontsetChartTitlePadding
(int chartTitlePadding) set the chart title padding; the space between the chart title and the plot areasetChartTitleVisible
(boolean isChartTitleVisible) Set the chart title visibilitysetDecimalPattern
(String decimalPattern) Set the decimal formatter for all numbers on the chartsetLegendBackgroundColor
(Color color) Set the chart legend background colorsetLegendBorderColor
(Color legendBorderColor) setLegendFont
(Font font) Set the chart legend fontsetLegendLayout
(Styler.LegendLayout legendLayout) setLegendPadding
(int legendPadding) Set the chart legend paddingsetLegendPosition
(Styler.LegendPosition legendPosition) sets the legend positionsetLegendSeriesLineLength
(int legendSeriesLineLength) Set the chart legend series line lengthsetLegendVisible
(boolean isLegendVisible) Set the chart legend visibilitysetMarkerSize
(int markerSize) Sets the size of the markers (in pixels)setPlotBackgroundColor
(Color plotBackgroundColor) set the plot area's background colorsetPlotBorderColor
(Color plotBorderColor) set the plot area's border colorsetPlotBorderVisible
(boolean isPlotBorderVisible) sets the visibility of the border around the plot areasetPlotContentSize
(double plotContentSize) Sets the content size of the plot inside the plot area of the chart.setSeriesColors
(Color[] seriesColors) setSeriesLines
(BasicStroke[] seriesLines) setSeriesMarkers
(Marker[] seriesMarkers) setShowWithinAreaPoint
(boolean showWithinAreaPoint) setToolTipBackgroundColor
(Color toolTipBackgroundColor) setToolTipBorderColor
(Color toolTipBorderColor) setToolTipFont
(Font toolTipFont) setToolTipHighlightColor
(Color toolTipHighlightColor) setToolTipsAlwaysVisible
(boolean toolTipsAlwaysVisible) setToolTipsEnabled
(boolean toolTipsEnabled) setToolTipType
(Styler.ToolTipType toolTipType) setXAxisTitleColor
(Color xAxisTitleColor) setYAxisGroupPosition
(int yAxisGroup, Styler.YAxisPosition yAxisPosition) Set the Y-Axis group position.setYAxisGroupTitleColor
(int yAxisGroup, Color yAxisColor) setYAxisLeftWidthHint
(int yAxisLeftWidthHint) Set the width of the Y-Axis tick labels on the left side of the chart.setYAxisTitleColor
(Color yAxisColor)
-
Constructor Details
-
Styler
public Styler()
-
-
Method Details
-
getBaseFont
-
setBaseFont
Set the base font- Parameters:
baseFont
-- Returns:
- styler
-
getChartBackgroundColor
-
setChartBackgroundColor
Set the chart background color - the part around the edge of the chart- Parameters:
color
-
-
getChartFontColor
-
setChartFontColor
Set the chart font color. includes: Chart title, axes label, legend- Parameters:
color
-
-
getChartPadding
public int getChartPadding() -
setChartPadding
Set the chart padding- Parameters:
chartPadding
-
-
getSeriesColors
-
setSeriesColors
-
getSeriesLines
-
setSeriesLines
-
getSeriesMarkers
-
setSeriesMarkers
-
getChartTitleFont
-
setChartTitleFont
Set the chart title font- Parameters:
chartTitleFont
-- Returns:
-
isChartTitleVisible
public boolean isChartTitleVisible() -
setChartTitleVisible
Set the chart title visibility- Parameters:
isChartTitleVisible
-
-
isChartTitleBoxVisible
public boolean isChartTitleBoxVisible() -
setChartTitleBoxVisible
Set the chart title box visibility- Parameters:
isChartTitleBoxVisible
-
-
getChartTitleBoxBackgroundColor
-
setChartTitleBoxBackgroundColor
set the chart title box background color- Parameters:
chartTitleBoxBackgroundColor
-
-
getChartTitleBoxBorderColor
-
setChartTitleBoxBorderColor
set the chart title box border color- Parameters:
chartTitleBoxBorderColor
-
-
getChartTitlePadding
public int getChartTitlePadding() -
setChartTitlePadding
set the chart title padding; the space between the chart title and the plot area- Parameters:
chartTitlePadding
-
-
isLegendVisible
public boolean isLegendVisible() -
setLegendVisible
Set the chart legend visibility- Parameters:
isLegendVisible
-
-
getLegendBackgroundColor
-
setLegendBackgroundColor
Set the chart legend background color- Parameters:
color
-
-
getLegendBorderColor
Set the chart legend border color- Returns:
-
setLegendBorderColor
-
getLegendFont
-
setLegendFont
Set the chart legend font- Parameters:
font
-
-
getLegendPadding
public int getLegendPadding() -
setLegendPadding
Set the chart legend padding- Parameters:
legendPadding
-
-
getLegendSeriesLineLength
public int getLegendSeriesLineLength() -
setLegendSeriesLineLength
Set the chart legend series line length- Parameters:
legendSeriesLineLength
-- Returns:
-
getLegendPosition
-
setLegendPosition
sets the legend position- Parameters:
legendPosition
-
-
getLegendLayout
Set the legend layout- Returns:
-
setLegendLayout
-
getPlotBackgroundColor
-
setPlotBackgroundColor
set the plot area's background color- Parameters:
plotBackgroundColor
-
-
getPlotBorderColor
-
setPlotBorderColor
set the plot area's border color- Parameters:
plotBorderColor
-
-
isPlotBorderVisible
public boolean isPlotBorderVisible() -
setPlotBorderVisible
sets the visibility of the border around the plot area- Parameters:
isPlotBorderVisible
-
-
getPlotContentSize
public double getPlotContentSize() -
setPlotContentSize
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.
-
getAnnotationTextPanelBackgroundColor
-
setAnnotationTextPanelBackgroundColor
-
getAnnotationTextPanelBorderColor
-
setAnnotationTextPanelBorderColor
-
getAnnotationTextPanelFont
-
setAnnotationTextPanelFont
-
getAnnotationTextPanelFontColor
-
setAnnotationTextPanelFontColor
-
getAnnotationTextPanelPadding
public int getAnnotationTextPanelPadding() -
setAnnotationTextPanelPadding
-
getAnnotationTextFont
-
setAnnotationTextFont
-
getAnnotationTextFontColor
-
setAnnotationTextFontColor
-
getAnnotationLineStroke
-
setAnnotationLineStroke
-
getAnnotationLineColor
-
setAnnotationLineColor
-
getChartButtonBackgroundColor
-
setChartButtonBackgroundColor
-
getChartButtonBorderColor
-
setChartButtonBorderColor
-
getChartButtonFontColor
-
setChartButtonFontColor
-
getChartButtonFont
-
setChartButtonFont
-
getChartButtonMargin
public int getChartButtonMargin() -
setChartButtonMargin
-
getChartButtonPosition
-
setChartButtonPosition
-
isToolTipsEnabled
public boolean isToolTipsEnabled() -
setToolTipsEnabled
-
isToolTipsAlwaysVisible
public boolean isToolTipsAlwaysVisible() -
setToolTipsAlwaysVisible
-
getToolTipType
-
setToolTipType
-
getToolTipBackgroundColor
-
setToolTipBackgroundColor
-
getToolTipBorderColor
-
setToolTipBorderColor
-
getToolTipFont
-
setToolTipFont
-
getToolTipHighlightColor
-
setToolTipHighlightColor
-
getDecimalPattern
-
setDecimalPattern
Set the decimal formatter for all numbers on the chart- Parameters:
decimalPattern
- - the pattern describing the decimal format
-
getYAxisGroupPosistion
-
setYAxisGroupPosition
Set the Y-Axis group position.- Parameters:
yAxisGroup
-yAxisPosition
-
-
getAntiAlias
public boolean getAntiAlias() -
setAntiAlias
-
getYAxisLeftWidthHint
public int getYAxisLeftWidthHint() -
setYAxisLeftWidthHint
Set the width of the Y-Axis tick labels on the left side of the chart. This can help to align the start of the X-Axis for two or more charts that are arranged in a column of charts.- Parameters:
yAxisLeftWidthHint
-
-
setShowWithinAreaPoint
-
getShowWithinAreaPoint
public boolean getShowWithinAreaPoint() -
getXAxisTitleColor
-
setXAxisTitleColor
-
getYAxisTitleColor
-
setYAxisTitleColor
-
getYAxisGroupTitleColor
-
setYAxisGroupTitleColor
-
getMarkerSize
public int getMarkerSize() -
setMarkerSize
Sets the size of the markers (in pixels)- Parameters:
markerSize
-
-
getTheme
-