About Baidu echarts tooltip >

this is my data format

{
  "data":[{
    "yData": [1,4,5,7,11,20,30],
    "name": ["","","","","","",""]
  },{
    "yData": [2,5,9,12,22,28,31],
    "name": ["","","","","","",""]
  },{
    "yData": [1,7,13,16,18,23,25],
    "name": ["","","","","","",""]
  }],
  "name": ["","",""]
}
The

chart is as follows:

I think the broken line displays the corresponding name, in the data at each point. What should I do?

Thank you!


http://echarts.baidu.com/exam.
to see if it's the effect you want


there is a way:

tooltip: {
            trigger: 'item',
            formatter: function (data) {
                for(var i=0;i<data.seriesName.split(',').length;iPP) {
                    console.log(data)
                    return data.seriesName.split(',')[data.dataIndex]
                }
            }
        }
Menu