Why is the tooltip of the latest version of echarts's k chart "opening price", "closing price", "highest price" and "lowest price" not displayed?

this is its official instance echarts k diagram instance

there is code in the instance to set up the display of these data, but it doesn"t work

  tooltip: {
   formatter: function (param) {
    param = param[0];
    return [
     "Date: " + param.name + "<hr size=1 style="margin: 3px 0">",
     "Open: " + param.data[0] + "<br/>",
     "Close: " + param.data[1] + "<br/>",
     "Lowest: " + param.data[2] + "<br/>",
     "Highest: " + param.data[3] + "<br/>"
    ].join("");
  }

excuse me, is this data no longer supported by echarts?
Why does it have this code in its official instance?


look at the document: there is a sentence in it Note: series.tooltip is only valid when tooltip.trigger is' item'.

in the example of the official website, series.tooltip.trigger is not set, so option.tooltip.trigger prevails, option.tooltip.trigger is' axis', so series.tooltip.formatter is not executed, and option.tooltip.formatter, is executed, which is the default format.

so in this example you need to add an attribute trigger: 'item' to series.tooltip, and that's fine

I have also encountered the problem of

. It is a version problem. If there is no necessary version requirement, just back the version of echart to the third largest version. I fell back to 3.8.5

.
Menu