score:2

Accepted answer

yes, you can use scriptable options if you want the dot to not show, you can also pass null values so the point gets skipped or you can use the object format to specify to which labels the datapoint needs to be matched:

var options = {
  type: 'line',
  data: {
    labels: ["red", "blue", "yellow", "green", "purple", "orange"],
    datasets: [{
        label: 'scriptable radius',
        data: [12, 19, 0, 5, 2, 3],
        bordercolor: 'pink',
        backgroundcolor: 'pink',
        radius: (ctx, a, b) => (ctx.parsed.y === 0 ? 0 : 8)
      },
      {
        label: 'null value',
        data: [7, 11, null, 8, 3, 7],
        bordercolor: 'orange',
        backgroundcolor: 'orange'
      },
      {
        label: 'object notation',
        data: [{
          x: 'red',
          y: 6
        }, {
          x: 'blue',
          y: 4
        }, {
          x: 'green',
          y: 8
        }, {
          x: 'purple',
          y: 12
        }, {
          x: 'orange',
          y: 3
        }, ],
        bordercolor: 'lime',
        backgroundcolor: 'lime'
      }
    ]
  },
  options: {}
}

var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
new chart(ctx, options);
<body>
  <canvas id="chartjscontainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/3.5.1/chart.js"></script>
</body>


Related Query

More Query from same tag