F2.Global
is the global configuration in F2, it contains following attributes:
We can get the default value of an attribute by console.log(F2.Global)
.
Name | Type | Description |
| Array / Number | the spacing between the chart plot area and the canvas border. See here. Default value is 'auto'. |
| Array / Number | The reserved spacing on the four sides of the chart canvas area. See here. |
| Object | The default configuration for different types of axes. |
| Array | The default color series. |
| String | The default color. |
| String | The default font family. |
| Object | The default configuration for different types of guides. |
| Object | The default configuration for different type of legends. |
| Array | The default setting for |
| Number | The default pixel ratio. |
| Object | The default style configuration for different shapes. |
| Array | The default size range for size mapping. |
| Object | The default tooltip configuration for tooltip. |
| String | The current version of F2. |
| Object | ratio of width for different shapes. |
Methods
Configure F2's charts style. For users to define their own style.
Parameters:
Name | Type | Description |
| Object | theme configuration |
Example:
F2.Global.setTheme({colors: [ '#F04864', '#D66BCA', '#8543E0', '#8E77ED', '#3436C7', '#737EE6', '#223273', '#7EA2E6' ],pixelRatio: 2,guide: {line: {stroke: '#F04864',lineWidth: 2}}});