BUG:id duplicates
3.0.2
HTML
<script src="https://rawgit.com/ecomfe/echarts/master/dist/echarts.min.js"></script>
<div id="title">
BUG:id duplicates
<input type="button" id="a" value="选中" />
</div>
<div>
添加两个序列的时候,必须要有name值
</div>
<div id="container">
图表在这里
</div>
CSS
#title {
font-size: 30px;
}
#container {
width: 600px;
height: 400px;
border: 1px solid black;
}
JavaScript
var dd = echarts.init(document.getElementById("container"));
var options = {
series:
[
{
type:'pie',
radius: ['20%', '25%'],
center:["20%","20%"],
avoidLabelOverlap: true,
hoverAnimation :false,
label: {
normal: {
show: true,
position: 'center',
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
},
emphasis: {
show: true
}
},
data:[
{value:135, name:'视频广告'},
{value:1548}
]
},
]
};
dd.setOption(options);
$("#a").click(function(){
options.series = [
{
name:"ss",
type:'pie',
radius: ['20%', '25%'],
center:["20%","20%"],
avoidLabelOverlap: true,
hoverAnimation :false,
label: {
normal: {
show: true,
position: 'center',
textStyle: {
fontSize: '30',
fontWeight: 'bold'
}
}
},
data:[
{value:135, name:'视频广告'},
{value:1548}
]
}, {
name:"aa",
type:'pie',
radius: ['20%', '25%'],
...