1.legend动态加载
动态加载时不能直接对legend赋值。需定义变量构建对象,然后在赋值给option.legend = legend;
legend = { orient: 'vertical', x: 'left', textStyle: { color: "#fff" }, data: ['最高价(' + 10000 + ')', '最低价(' + 1000 + ')'] };
2.series动态加载其中的某个对象
series = [{ name: '最高价(' + 10000+ ')', type: 'pie', value: b, itemStyle: { normal: { color: "#da2b80" }, emphasis: { color: "#da2b80" } } }, { name: '最低价(' + 1000+ ')', type: 'pie', value: c, itemStyle: { normal: { color: "#ffa600" }, emphasis: { color: "#ffa600" } } }]; option.series[0]['data'] = series;