echarts-simple-option-player
This is a non-official library.
This is a simple option player for Apache ECharts 5.
This is a simple tool to manipulate several echarts options to play forward or backward or jump between each other and perform transition animation. setOption will be called internally in this tool when demanded to change option, where the transition
parameter of setOption will be made based on the setting of dataMeta
below.
Usage
const myChart = echarts.init(dom);
const player = ecSimpleOptionPlayer.create({
chart: function () {
return myChart;
},
seriesIndex: 0,
replaceMerge: ['xAxis', 'yAxis']
dataMeta: {
aaa: {
dimensions: ['qqq', 'www', 'eee', 'rrr']
},
bbb: {
dimensions: ['ccc', 'www', 'eee'],
uniqueDimension: 'www',
dividingMethod: 'duplicate'
},
...
},
optionList: [
{ key: 'Time_Income_Bar', option: option0, dataMetaKey: 'aaa' },
{ key: 'Population_Income_Scatter', option: option1, dataMetaKey: 'bbb' },
{ key: 'Time_Income_Pie', option: option2, dataMetaKey: 'aaa' },
...
]
});
player.next();
player.previous();
player.go('Time_Income_Pie');
player.getOptionKeys();
Also see this example.