magicType可以手动触发切换line, bar, stack, ...等模式吗
暂时写的是:定义控件lineChart。
$("#lineChart").click(function() {
myChart.dispatchAction({
type: 'magictypechanged',
currentType : "line"
});
});
切换成了
myChart.dispatchAction({
type: 'changeMagicType',
currentType : "line"
});
能探测到事件变化,
myChart.on('magictypechanged', ...
但是图没有被刷新诶
参数还需要传入 newOption
刚好刷源代码的时候也看到了newOption,仔细看了下这个函数,

不是特别理解newOption需要指定什么。外部复现整个处理流程也不太现实?
可以的,mychart._componentsMap[" - 0_toolbox"]._features['magicType'].model.iconPaths.line.trigger('click');
这里的 " - 0_toolbox" ,可能你需要通过 Object.getOwnPropertyNames(mychart._componentsMap) 来确定里面的特殊字符。
This issue is closed due to not being active. Please feel free to open it again (for the author) or create a new one and reference this (for others) if you have further questions.
Most helpful comment
可以的,mychart._componentsMap[" - 0_toolbox"]._features['magicType'].model.iconPaths.line.trigger('click');
这里的 " - 0_toolbox" ,可能你需要通过 Object.getOwnPropertyNames(mychart._componentsMap) 来确定里面的特殊字符。