1

I am using chartjs graph for angularjs my concern is the points on line graph i need to give them different colors based on ranges on data . can anyone help how can i do it to change fillcolor property

function drawChart(placeholder, values1, labels1) {
    var plot = $.plot(placeholder,
        [{
                data: values1,
                label: label1,
                lines: {
                    show: true,
                    lineWidth: 2,
                    fill: true,

                },
                points: {
                    show: true,
                    lineWidth: 3,
                    fill: true,
                    fillColor: '#fafafa'
                }

            },
        });
Enzo B.
  • 2,341
  • 1
  • 11
  • 33

1 Answers1

0

I don't have enough detail to know if your problem comes from there but the syntax of your code is incorrect.

You should have :

function drawChart(placeholder, values1, labels1) {
    var plot = $.plot(placeholder,
        [{
            data: values1,
            label: label1,
            lines: {
                show: true,
                lineWidth: 2,
                fill: true,

            },
            points: {
                show: true,
                lineWidth: 3,
                fill: true,
                fillColor: '#fafafa'
            }

        }]
    });
}
Enzo B.
  • 2,341
  • 1
  • 11
  • 33