New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
动态setOption后,点击toolbox中的还原按钮,图形消失了! #2596
Comments
不是bug,是你使用不对。你应该定义一个var options={},然后 后边是要用options.title.text = '新值',然后setOption(options),这样才是正确的逻辑。 |
额。。。我感觉是一样的呀,你说的这种方法。 |
=_=!!!瀑布汗 看明白你那句错哪了吗? |
噗。。。。我肯定把那个 setInterval 通通给删了。。再做测试的。。 |
不偷懒了,下面是完整的demo配置项
|
option = {
title: {
text: '堆叠区域图'
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['邮件营销','联盟广告','视频广告','直接访问','搜索引擎']
},
toolbox: {
feature: {
restore : {show: true},
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['周一','周二','周三','周四','周五','周六','周日']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'邮件营销',
type:'line',
stack: '总量',
areaStyle: {normal: {}},
data:[120, 132, 101, 134, 90, 230, 210]
},
{
name:'联盟广告',
type:'line',
stack: '总量',
areaStyle: {normal: {}},
data:[220, 182, 191, 234, 290, 330, 310]
},
{
name:'视频广告',
type:'line',
stack: '总量',
areaStyle: {normal: {}},
data:[150, 232, 201, 154, 190, 330, 410]
},
{
name:'直接访问',
type:'line',
stack: '总量',
areaStyle: {normal: {}},
data:[320, 332, 301, 334, 390, 330, 320]
},
{
name:'搜索引擎',
type:'line',
stack: '总量',
label: {
normal: {
show: true,
position: 'top'
}
},
areaStyle: {normal: {}},
data:[820, 932, 901, 934, 1290, 1330, 1320]
}
]
};
setTimeout(function() {
option.title.text = '22';
myChart.setOption(option);
}, 1000); |
如果这么去做,是可以的。。 文档不是说 setOption,默认合并之前的配置项吗 |
reset 功能好像是有这个问题,我们看一下,谢谢反馈 |
前边说的定义var options={}不是说重新定义一个,只是举个例子,用法是要修改前边原有的配置项,然后setOption |
#2593 |
OptionManager._optionBackup 不是最新合并后的option,recreat的时候,就完蛋了。 确定是个bug。 |
http://echarts.baidu.com/gallery/editor.html?c=dynamic-data
还用这个例子。。
先动态设置一下title,
然后点击toolbox中的还原按钮,,,图形消失了,只留下了 标题 22。。。。(图形应该没变化才对)
不知道是我使用上的问题?还是echarts的bug。。。
The text was updated successfully, but these errors were encountered: