在 Chartjs 中为指针填充颜色

Fill color to pointer in Chartjs

我正在使用散点图。悬停在一个点上时,表示点颜色的框未填充

我需要用线条的颜色填充它,而不仅仅是边框的颜色。

Fiddle

这是我的数据集:

this.ScatterChart.data.datasets.push({
  label: this.label,
  data: this.Axiscoordinates,
  fill: false,
  lineTension: 0.1,
  borderColor: SetColor,
  color: SetColor,
  backGroundColor: SetColor,
  borderWidth: 1,
  yAxisID: this.yAxisUnit,
  showLine: true
});

在您的数据集对象中将 backgroundColor 设置为您想要的颜色,这将解决问题

datasets: [
  {
    data: []
    backgroundColor: color
  }
]

编辑:我的错误 backgroundColor 是小写的 g 而不是大写的