{{ target: partial-formatter-params-structure }}
{ componentType: 'series', // Series type seriesType: string, // Series index in option.series seriesIndex: number, // Series name seriesName: string, // Data name, or category name name: string, // Data index in input data array dataIndex: number, // Original data as input data: Object, // Value of data. In most series it is the same as data. // But in some series it is some part of the data (e.g., in map, radar) value: number|Array|Object, // encoding info of coordinate system // Key: coord, like ('x' 'y' 'radius' 'angle') // value: Must be an array, not null/undefined. Contain dimension indices, like: // { // x: [2] // values on dimension index 2 are mapped to x axis. // y: [0] // values on dimension index 0 are mapped to y axis. // } encode: Object, // dimension names list dimensionNames: Array<String>, // data dimension index, for example 0 or 1 or 2 ... // Only work in `radar` series. dimensionIndex: number, // Color of data color: string, {{ for: ${extra} as ${obj}, ${name} }}{{ if: ${extra}.hasOwnProperty(${name}) }} // ${obj.desc} ${name}: ${obj.type}, {{ /if }}{{ /for }} }
Note: the usage of encode and dimensionNames can be:
If data is:
dataset: { source: [ ['Matcha Latte', 43.3, 85.8, 93.7], ['Milk Tea', 83.1, 73.4, 55.1], ['Cheese Cocoa', 86.4, 65.2, 82.5], ['Walnut Brownie', 72.4, 53.9, 39.1] ] }
We can get values that corresponding to y axis by:
params.value[params.encode.y[0]]
If data is:
dataset: { dimensions: ['product', '2015', '2016', '2017'], source: [ {product: 'Matcha Latte', '2015': 43.3, '2016': 85.8, '2017': 93.7}, {product: 'Milk Tea', '2015': 83.1, '2016': 73.4, '2017': 55.1}, {product: 'Cheese Cocoa', '2015': 86.4, '2016': 65.2, '2017': 82.5}, {product: 'Walnut Brownie', '2015': 72.4, '2016': 53.9, '2017': 39.1} ] }
We can get values that corresponding to y axis by:
params.value[params.dimensionNames[params.encode.y[0]]]
{{ /target }}