0

In my image below, is it possible to make the first point remain 1 until the second point becomes zero? and the second point remains zero until the third point becomes 1. It could be done by passing the data as a square, but just asking perhaps there is a way to do so in Chart Js.

enter image description here

Luke Galea
  • 179
  • 2
  • 15

1 Answers1

0

Taken from here - use the following code for a stepped line graph.

var config = {
        type: 'line',
        data: {
            datasets: [{
                label: "My dataset",
                data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
                steppedLine: true,
            }
   }
Luke Galea
  • 179
  • 2
  • 15