Global Configuration
Previous
Quick Start
Next
Upgrade
Loading...
Ant Design Charts allows you to customize themes and component configuration to satisfy business and brand requirements. ConfigProvider
component makes this possible.
You can pick a built-in theme:
import { ConfigProvider } from '@ant-design/charts';<ConfigProvider common={{ theme: 'dark' }}><MyApp /></ConfigProvider>;
Or create your own theme:
import { ConfigProvider } from '@ant-design/charts';<ConfigProvidercommon={{theme: {type: 'dark', // based on dark themecolor: '#66ccff',category10: ['#123456', '#654321', ... ],axis: {labelFill: '#666666',}},}}><MyApp /></ConfigProvider>;
Global component configuration make it easier and faster to create customized charts. All configuration of all kinds of charts are supported.
import { ConfigProvider } from '@ant-design/charts';<ConfigProvider// For Line Chartline={{shape: 'smooth',style: {lineWidth: 2,},}}// For Pie Chartpie={{legend: {color: {title: false,position: 'right',rowPadding: 5,},},}}><MyApp /></ConfigProvider>;