IPresetData
Type interface
Settings for supplying preset data to be used in place of default template data.
Sources
IPresetData is an interface: it describes a shape of data and is not imported on its own.
Properties
dataType
Array<IChartData>Actual preset data.
Your dataset as an array of name: value objects
templatePropertyMapType
Map<string,string>Mapping of the actual preset data to standard template fields.
To use your data the Editor needs to know what fields in your dataset correspond to standard template fields.
For example, in the code below the suppiled dataset has
catandvalfields and the typical serial chart template hascategoryandvalue(orvalue1,value2, etc.) fields.So, we supply a map mapping
categorytocat, andvalueandvalue1toval.presetData: { data: [ { cat: 'c1', val: 10 }, { cat: 'c2', val: 20 }, { cat: 'c3', val: 40 }, { cat: 'c4', val: 18 } ], templatePropertyMap: new Map([ ['category', 'cat'], ['value', 'val'], ['value1', 'val'] ]) }