1

是否可以在下面的 canvasjs 组合图中仅禁用一个系列的工具提示?

  data: [
  {
      type: "area",
      color: "red",        // change color here
      fillOpacity: 1,
      dataPoints: [
    { x: 0, y: 100 },
    { x: 100, y: 100 }
    ]
  },
    {
        type: "area",
        color: "yellow",
        toolTipContent: " ",
        dataPoints: [
    { x: 0, y: 10 },
    { x: 100, y: 100 }
    ]
    }
 ]

这是我的小提琴的链接: https ://jsfiddle.net/Abhishek1191/s71djz9m/2

我在小提琴内绘制了四个独立的系列。3区1线。如果有人可以让我知道我是否可以禁用区域系列的工具提示。

提前致谢

4

1 回答 1

2

不是将 toolTipContent 设置为空字符串,而是将 toolTipContent 设置为 null,这将禁用单个 dataPoint / dataSeries 的工具提示。在您的 jsfiddle 中,您使用的是不支持此功能的 v1.4.1。请下载最新版本。这是工作代码

var  chart =  new  CanvasJS.Chart("container",
{
    data: [
    {
        toolTipContent: null,
        type: "column",
        dataPoints:[
            { x: 10, y: 20}
        ]
    }
    ]
});
chart.render();
于 2015-05-18T13:57:19.983 回答