Customize Style
From Documentation
Switching Bwteen Themes
ZK Charts provides many predefined color themes for use.
Here are a list of the themes that you can choose from:
- Default Theme
1 chart.setTheme(Theme.DEFAULT);
- Grid Theme
1 chart.setTheme(Theme.GRID);
- Skies Theme
1 chart.setTheme(Theme.SKIES);
- Gray Theme
1 chart.setTheme(Theme.GRAY);
- Dark Blue Theme
1 chart.setTheme(Theme.DARK_BLUE);
- Dark Green Theme
1 chart.setTheme(Theme.DARK_GREEN);
Customizing Colors
ZK Charts use Color class to apply the color to the color-changing method in the option, such as setBackgroundColor() or setFillColor(). Color supports solid color and gradient color.
Solid Color
Solid color can be specified as an RGB triplet or in hexadecimal format or any valid color format in browsers:
- RGB triplet - rgb(186,86,150)
- Hexadecimal format - #58BA7A
Gradient Color
Gradient could be defined by LinearGradient or RadialGradient, they have the similar attributes of SVG.
Linear Gradient
Radial Gradient
< Get Complete Source Code of This Book >