Package org.knowm.xchart.style
Class CategoryStyler
java.lang.Object
org.knowm.xchart.style.Styler
org.knowm.xchart.style.AxesChartStyler
org.knowm.xchart.style.CategoryStyler
-
Nested Class Summary
Nested classes/interfaces inherited from class org.knowm.xchart.style.AxesChartStyler
AxesChartStyler.TextAlignment
Nested classes/interfaces inherited from class org.knowm.xchart.style.Styler
Styler.ChartButtonPosition, Styler.ChartTheme, Styler.LegendLayout, Styler.LegendPosition, Styler.ToolTipType, Styler.YAxisPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getLabelsFontColor
(Color backgroundColor) double
int
boolean
boolean
boolean
boolean
boolean
protected void
setAvailableSpaceFill
(double availableSpaceFill) Sets the available space for rendering each category as a percentage.setDefaultSeriesRenderStyle
(CategorySeries.CategorySeriesRenderStyle chartCategorySeriesRenderStyle) Sets the default series render style for the chart (bar, stick, line, scatter, area, etc.) You can override the series render style individually on each Series object.setLabelsFont
(Font labelsFont) Sets the Font used for chart labelssetLabelsFontColor
(Color labelsFontColor) Sets the color of the Font used for chart labelssetLabelsFontColorAutomaticDark
(Color labelsFontColorAutomaticDark) setLabelsFontColorAutomaticEnabled
(boolean isLabelsFontColorAutomaticEnabled) setLabelsFontColorAutomaticLight
(Color labelsFontColorAutomaticLight) setLabelsPosition
(double labelsPosition) A number between 0 and 1 setting the vertical position of the data label.setLabelsRotation
(int labelsRotation) Sets the rotation (in degrees) for chart labels.setLabelsVisible
(boolean labelsVisible) Sets if labels should be added to charts.setOverlapped
(boolean isOverlapped) set whether or not series renderings (i.e.setShowStackSum
(boolean showStackSum) If the category chart is set to be "stacked", the total value of the stack can be painted above the stack.setStacked
(boolean isStacked) Set whether or not series renderings (i.e.void
Set the theme the styler should useMethods inherited from class org.knowm.xchart.style.AxesChartStyler
getAxisTickLabelsColor, getAxisTickLabelsFont, getAxisTickMarkLength, getAxisTickMarksColor, getAxisTickMarksStroke, getAxisTickPadding, getAxisTitleFont, getAxisTitlePadding, getDatePattern, getErrorBarsColor, getLocale, getPlotGridLinesColor, getPlotGridLinesStroke, getPlotMargin, getTimezone, getXAxisDecimalPattern, getXAxisLabelAlignment, getXAxisLabelAlignmentVertical, getXAxisLabelRotation, getXAxisMax, getXAxisMaxLabelCount, getXAxisMin, getXAxisTickLabelsColor, getxAxisTickLabelsFormattingFunction, getXAxisTickMarksColor, getXAxisTickMarkSpacingHint, getYAxisDecimalPattern, getYAxisGroupDecimalPatternMap, getYAxisGroupTickLabelsColorMap, getYAxisGroupTickMarksColorMap, getYAxisLabelAlignment, getYAxisMax, getYAxisMax, getYAxisMin, getYAxisMin, getYAxisTickLabelsColor, getyAxisTickLabelsFormattingFunction, getYAxisTickMarksColor, getYAxisTickMarkSpacingHint, isAxisTicksLineVisible, isAxisTicksMarksVisible, isErrorBarsColorSeriesColor, isPlotGridHorizontalLinesVisible, isPlotGridLinesVisible, isPlotGridVerticalLinesVisible, isPlotTicksMarksVisible, isXAxisLogarithmic, isXAxisLogarithmicDecadeOnly, isXAxisTicksVisible, isXAxisTitleVisible, isYAxisLogarithmic, isYAxisLogarithmicDecadeOnly, isYAxisTicksVisible, isYAxisTitleVisible, putYAxisGroupDecimalPatternMap, setAxisTickLabelsColor, setAxisTickLabelsFont, setAxisTickMarkLength, setAxisTickMarksColor, setAxisTickMarksStroke, setAxisTickPadding, setAxisTicksLineVisible, setAxisTicksMarksVisible, setAxisTicksVisible, setAxisTitleFont, setAxisTitlePadding, setAxisTitlesVisible, setDatePattern, setErrorBarsColor, setErrorBarsColorSeriesColor, setLocale, setPlotGridHorizontalLinesVisible, setPlotGridLinesColor, setPlotGridLinesStroke, setPlotGridLinesVisible, setPlotGridVerticalLinesVisible, setPlotMargin, setPlotTicksMarksVisible, setTimezone, setXAxisDecimalPattern, setXAxisLabelAlignment, setXAxisLabelAlignmentVertical, setXAxisLabelRotation, setXAxisLogarithmic, setXAxisLogarithmicDecadeOnly, setXAxisMax, setXAxisMaxLabelCount, setXAxisMin, setXAxisTickLabelsColor, setxAxisTickLabelsFormattingFunction, setXAxisTickMarksColor, setXAxisTickMarkSpacingHint, setXAxisTicksVisible, setXAxisTitleVisible, setYAxisDecimalPattern, setYAxisGroupTickLabelsColorMap, setYAxisGroupTickMarksColorMap, setYAxisLabelAlignment, setYAxisLogarithmic, setYAxisLogarithmicDecadeOnly, setYAxisMax, setYAxisMax, setYAxisMin, setYAxisMin, setYAxisTickLabelsColor, setyAxisTickLabelsFormattingFunction, setYAxisTickMarksColor, setYAxisTickMarkSpacingHint, setYAxisTicksVisible, setYAxisTitleVisible
Methods inherited from class org.knowm.xchart.style.Styler
getAnnotationLineColor, getAnnotationLineStroke, getAnnotationTextFont, getAnnotationTextFontColor, getAnnotationTextPanelBackgroundColor, getAnnotationTextPanelBorderColor, getAnnotationTextPanelFont, getAnnotationTextPanelFontColor, getAnnotationTextPanelPadding, getAntiAlias, getBaseFont, getChartBackgroundColor, getChartButtonBackgroundColor, getChartButtonBorderColor, getChartButtonFont, getChartButtonFontColor, getChartButtonMargin, getChartButtonPosition, getChartFontColor, getChartPadding, getChartTitleBoxBackgroundColor, getChartTitleBoxBorderColor, getChartTitleFont, getChartTitlePadding, getDecimalPattern, getLegendBackgroundColor, getLegendBorderColor, getLegendFont, getLegendLayout, getLegendPadding, getLegendPosition, getLegendSeriesLineLength, getMarkerSize, getPlotBackgroundColor, getPlotBorderColor, getPlotContentSize, getSeriesColors, getSeriesLines, getSeriesMarkers, getShowWithinAreaPoint, getTheme, getToolTipBackgroundColor, getToolTipBorderColor, getToolTipFont, getToolTipHighlightColor, getToolTipType, getXAxisTitleColor, getYAxisGroupPosistion, getYAxisGroupTitleColor, getYAxisLeftWidthHint, getYAxisTitleColor, isChartTitleBoxVisible, isChartTitleVisible, isLegendVisible, isPlotBorderVisible, isToolTipsAlwaysVisible, isToolTipsEnabled, setAnnotationLineColor, setAnnotationLineStroke, setAnnotationTextFont, setAnnotationTextFontColor, setAnnotationTextPanelBackgroundColor, setAnnotationTextPanelBorderColor, setAnnotationTextPanelFont, setAnnotationTextPanelFontColor, setAnnotationTextPanelPadding, setAntiAlias, setBaseFont, setChartBackgroundColor, setChartButtonBackgroundColor, setChartButtonBorderColor, setChartButtonFont, setChartButtonFontColor, setChartButtonMargin, setChartButtonPosition, setChartFontColor, setChartPadding, setChartTitleBoxBackgroundColor, setChartTitleBoxBorderColor, setChartTitleBoxVisible, setChartTitleFont, setChartTitlePadding, setChartTitleVisible, setDecimalPattern, setLegendBackgroundColor, setLegendBorderColor, setLegendFont, setLegendLayout, setLegendPadding, setLegendPosition, setLegendSeriesLineLength, setLegendVisible, setMarkerSize, setPlotBackgroundColor, setPlotBorderColor, setPlotBorderVisible, setPlotContentSize, setSeriesColors, setSeriesLines, setSeriesMarkers, setShowWithinAreaPoint, setToolTipBackgroundColor, setToolTipBorderColor, setToolTipFont, setToolTipHighlightColor, setToolTipsAlwaysVisible, setToolTipsEnabled, setToolTipType, setXAxisTitleColor, setYAxisGroupPosition, setYAxisGroupTitleColor, setYAxisLeftWidthHint, setYAxisTitleColor
-
Constructor Details
-
CategoryStyler
public CategoryStyler()Constructor
-
-
Method Details
-
setAllStyles
protected void setAllStyles() -
getDefaultSeriesRenderStyle
-
setDefaultSeriesRenderStyle
public CategoryStyler setDefaultSeriesRenderStyle(CategorySeries.CategorySeriesRenderStyle chartCategorySeriesRenderStyle) Sets the default series render style for the chart (bar, stick, line, scatter, area, etc.) You can override the series render style individually on each Series object.- Parameters:
chartCategorySeriesRenderStyle
-
-
getAvailableSpaceFill
public double getAvailableSpaceFill() -
setAvailableSpaceFill
Sets the available space for rendering each category as a percentage. For a bar chart with one series, it will be the width of the bar as a percentage of the maximum space alloted for the bar. If there are three series and three bars, the three bars will share the available space. This affects all category series render types, not only bar charts. Full width is 100%, i.e. 1.0- Parameters:
availableSpaceFill
-
-
isOverlapped
public boolean isOverlapped() -
setOverlapped
set whether or not series renderings (i.e. bars, stick, etc.) are overlapped. Otherwise they are placed side-by-side.- Parameters:
isOverlapped
-
-
isStacked
public boolean isStacked() -
setStacked
Set whether or not series renderings (i.e. bars, stick, etc.) are stacked.- Parameters:
isStacked
-
-
isLabelsVisible
public boolean isLabelsVisible() -
setLabelsVisible
Sets if labels should be added to charts. Each chart type has a different annotation type- Parameters:
labelsVisible
-
-
isShowStackSum
public boolean isShowStackSum() -
setShowStackSum
If the category chart is set to be "stacked", the total value of the stack can be painted above the stack.- Parameters:
showStackSum
-- Returns:
-
getLabelsFont
-
setLabelsFont
Sets the Font used for chart labels- Parameters:
labelsFont
-
-
getLabelsFontColor
-
getLabelsFontColor
-
setLabelsFontColor
Sets the color of the Font used for chart labels- Parameters:
labelsFontColor
-
-
getLabelsRotation
public int getLabelsRotation() -
setLabelsRotation
Sets the rotation (in degrees) for chart labels.- Parameters:
labelsRotation
-
-
getLabelsPosition
public double getLabelsPosition() -
setLabelsPosition
A number between 0 and 1 setting the vertical position of the data label. Default is 0.5 placing it in the center.- Parameters:
labelsPosition
-- Returns:
-
isLabelsFontColorAutomaticEnabled
public boolean isLabelsFontColorAutomaticEnabled() -
setLabelsFontColorAutomaticEnabled
-
getLabelsFontColorAutomaticLight
-
setLabelsFontColorAutomaticLight
-
getLabelsFontColorAutomaticDark
-
setLabelsFontColorAutomaticDark
-
setTheme
Set the theme the styler should use- Parameters:
theme
-
-