Josh
Josh

Reputation: 10624

Control which lines have points?

With Chart.js, you can set in the options of the graph to show points or not:

pointDot: true,

I have a graph with three static lines and one line that shows some fluctuations. I'd like the straight lines not to have points but the fluctuation line show the points. Is there a setting somewhere on the line that I can set the point size to nothing?

** Edit **

Each line is its own set of data configured like this:

 datasets: [
    {
        label: "Cycle Time Per Last Piece",
        strokeColor: "red",
        fillColor: "red",
        pointHighlightFill: "red",
        data: [@foreach (var item in Model.DataPoints) {
        @(Model.ExpectedCycleTimePerPart * 1.20M)@:,
             }]
    },
    {
        label: "Expected Cycle Time Per Part",
        strokeColor: "black",
        pointHighlightFill: "black",
        data: [@foreach (var item in Model.DataPoints) {
        @Model.ExpectedCycleTimePerPart@:,
             }]
     }

Upvotes: 1

Views: 165

Answers (1)

potatopeelings
potatopeelings

Reputation: 41085

The pointDot option drives the display property, so you can do something like

myChart.datasets[0].points[2].display = false;

where myChart is your chart object.

Upvotes: 2

Related Questions