Customizing the colors of individual series in HighCharts

前端 未结 3 1094
旧时难觅i
旧时难觅i 2021-02-14 01:08

I am using HighCharts for a line graph and i am attemping to change the line color for each series. I did find this example here but the data is hard coded. My data is pulled fr

3条回答
  •  既然无缘
    2021-02-14 02:06

    Top level config can contain colors field. It's an array from which series colors will be picked.

    See here.

    Here's working piece from my project

    var chart;
    $(document).ready(function () {
        chart = new Highcharts.Chart({
            chart:{
                renderTo:'perfchart',
                type:'line',
                marginRight:130,
                marginBottom:25
            },
            colors: ['#0000FF', '#0066FF', '#00CCFF'],
            title:{
                text:'Historical system performance',
                x:-20 //center
            },
    

    Appearance:

    highcharts colors

提交回复
热议问题