Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the different legend icon for different series in same chart

Tags:

echarts

enter image description here

As shown in the figure above, I need to remove the circle in the middle of the third icon, but keep the shape of the other two charts rectangular.But when I set legend.icon = 'line', the shape of the other two icons changed.What should I do?

like image 222
Junfan Avatar asked Oct 15 '25 04:10

Junfan


1 Answers

Nobody in the world knows that you did wrong because no one has seen your code but legend supports separate icons for each series.

var option = {
  //...
  legend: {
    data: [
      { name: 'Series1', icon: 'circle'   }, 
      { name: 'Series2', icon: 'triangle' }, 
      { name: 'Series3', icon: 'diamond'  }, 
    ]
  }
  //...
}

enter image description here

like image 175
Sergey Fedorov Avatar answered Oct 19 '25 15:10

Sergey Fedorov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!