echarts In legend, only one tag of the same name and different types will be displayed.(legend中相同name,不同类型的标签,只会显示一个,怎样可以全部显示呢?)

unguejic  于 2022-10-26  发布在  Echarts
关注(0)|答案(3)|浏览(292)

Version

5.3.0

  • No response*

Steps to Reproduce

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  legend:{
   itemHeight: 8,
    textStyle: {
      color: '#8492A6',
      fontSize: 12,
      lineHeight: 20
    }
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name:'金额',
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'bar'
    },
     {
      name:'金额',
      data: [120, 200, 150, 80, 70, 110, 130],
      type: 'line'
    }
  ]
};

Current Behavior

Expected Behavior

I want the chart to show two different color types of legend's labels

Environment

- OS:window10:
- Browser:chrome 84.0.4147.125
- Framework:Vue@2

Any additional comments?

Encountered when encapsulating Echarts-based components

mnowg1ta

mnowg1ta1#

@XSe70 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

In legend, only one tag of the same name and different types will be displayed.

相关问题