Class ChartStyle
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.model.style.ChartStyle
-
- All Implemented Interfaces:
Serializable
public class ChartStyle extends AbstractConfigurationObject
Styles of chart- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChartStyle()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color
getBackgroundColor()
Color
getBorderColor()
Number
getBorderRadius()
Number
getBorderWidth()
String
getClassName()
Color
getPlotBackgroundColor()
String
getPlotBackgroundImage()
Color
getPlotBorderColor()
Number
getPlotBorderWidth()
Style
getStyle()
Gets various style defaults used.Boolean
isPlotShadow()
void
setBackgroundColor(Color backgroundColor)
Sets the background color of the outer chart area.void
setBorderColor(Color borderColor)
Sets the color of the outer chart border.void
setBorderRadius(Number borderRadius)
Sets the corner radius of the outer chart border.void
setBorderWidth(Number borderWidth)
Sets the pixel width of the outer chart border.void
setClassName(String className)
Sets the CSS class name to apply to the container DIV around the chart, allowing unique CSS styling for each chart.void
setPlotBackgroundColor(Color plotBackgroundColor)
Sets the background color of the plot area.void
setPlotBackgroundImage(String plotBackgroundImage)
Sets the background of the plot to an image specified by the provided URL.void
setPlotBorderColor(Color plotBorderColor)
Sets the color of the outer chart border.void
setPlotBorderWidth(Number plotBorderWidth)
Sets the pixel width of the plot area border.void
setPlotShadow(Boolean plotShadow)
Sets whether to apply a drop shadow to the plot area.void
setStyle(Style style)
Sets additional CSS styles to apply inline to the container div.
-
-
-
Method Detail
-
getBackgroundColor
public Color getBackgroundColor()
- Returns:
- The background color of the chart, null if not defined
- See Also:
setBackgroundColor(Color)
,getPlotBackgroundColor()
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
Sets the background color of the outer chart area. May be a gradient. Defaults to "#FFFFFF".- Parameters:
backgroundColor
-- See Also:
setPlotBackgroundColor(Color)
-
getPlotBackgroundColor
public Color getPlotBackgroundColor()
- Returns:
- The background color of the plot, null if not defined
- See Also:
setPlotBackgroundColor(Color)
,getBackgroundColor()
-
setPlotBackgroundColor
public void setPlotBackgroundColor(Color plotBackgroundColor)
Sets the background color of the plot area. May be a gradient. Defaults to null.- Parameters:
plotBackgroundColor
-- See Also:
setBackgroundColor(Color)
-
getPlotBackgroundImage
public String getPlotBackgroundImage()
- Returns:
- The background image of the plot, null if not defined
- See Also:
setPlotBackgroundImage(String)
-
setPlotBackgroundImage
public void setPlotBackgroundImage(String plotBackgroundImage)
Sets the background of the plot to an image specified by the provided URL. To set an image as the background for the entire chart, set a CSS background image on the container element. Defaults to null.- Parameters:
plotBackgroundImage
- The URL of the background image
-
isPlotShadow
public Boolean isPlotShadow()
- Returns:
- Whether a drop shadow is applied or null if not defined
- See Also:
setPlotShadow(Boolean)
-
setPlotShadow
public void setPlotShadow(Boolean plotShadow)
Sets whether to apply a drop shadow to the plot area. Requires that plotBackgroundColor be set.- Parameters:
plotShadow
-
-
getPlotBorderWidth
public Number getPlotBorderWidth()
- Returns:
- The width of the plot border or null if not defined
- See Also:
setPlotBorderWidth(Number)
-
setPlotBorderWidth
public void setPlotBorderWidth(Number plotBorderWidth)
Sets the pixel width of the plot area border. Defaults to 0.- Parameters:
plotBorderWidth
- Width of border
-
getClassName
public String getClassName()
- See Also:
setClassName(String)
-
setClassName
public void setClassName(String className)
Sets the CSS class name to apply to the container DIV around the chart, allowing unique CSS styling for each chart. Defaults to "".- Parameters:
className
-
-
getBorderWidth
public Number getBorderWidth()
- Returns:
- The width of the chart border, null if not defined
- See Also:
setBorderWidth(Number)
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
Sets the pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners. Defaults to 0.- Parameters:
borderWidth
- Border width
-
getBorderRadius
public Number getBorderRadius()
- Returns:
- The corner radius of the border, null if not defined
- See Also:
setBorderRadius(Number)
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
Sets the corner radius of the outer chart border. Defaults to 5.- Parameters:
borderRadius
- Radius or border
-
getPlotBorderColor
public Color getPlotBorderColor()
- Returns:
- The color of the plot border, null if not defined
- See Also:
setPlotBorderColor(Color)
-
setPlotBorderColor
public void setPlotBorderColor(Color plotBorderColor)
Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners. Defaults to "#4572A7".- Parameters:
plotBorderColor
-
-
getStyle
public Style getStyle()
Gets various style defaults used. This can be used to for example define default font family.- See Also:
setStyle(Style)
-
setStyle
public void setStyle(Style style)
Sets additional CSS styles to apply inline to the container div. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally. Defaults to:style: { fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font fontSize: '12px' }
- Parameters:
style
-
-
getBorderColor
public Color getBorderColor()
- Returns:
- The color of the plot border, null if not defined
- See Also:
setBorderColor(Color)
-
setBorderColor
public void setBorderColor(Color borderColor)
Sets the color of the outer chart border. Defaults to #4572A7.- Parameters:
borderColor
-
-
-