如何用两种颜色创建Highcharts线图?

时间:2014-12-17 12:13:44

标签: jsp highcharts

我正在使用Highcharts创建折线图,我需要绘制原始线的不同颜色的一些点。 enter image description here

像图片一样,一些点和线是黑色的。我应该修改哪些属性来做到这一点? 请建议。代码:

$('#container').highcharts({
            chart: {
                type: 'line',
                height: '500',
                width: '750'
            },
            title: {
                text: 'Average Time Taken to Resolve Alerts (in Minutes)'
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                min: 0,
                gridLineWidth: 1,
                minorGridLineColor: '#E0E0E0',
                minorGridLineWidth: 2,
                minorTickLength: 3,
                minorTickInterval: 'auto',
                type: 'datetime',
                categories: ['Tue,03/02','','', 'Fri,03/05','','', 'Mon,03/08','','', 'Thu,03/11','','', 'Sun,03/14','','']
            },
            yAxis: {
                min: 0,
                //gridLineWidth: 1,
                //minorGridLineColor: '#E0E0E0',
                //minorGridLineWidth: 2,
                minorTickLength: 6,
                minorTickWidth: 2,
                minorTickInterval: 'auto',
                title: {
                    text: ''
                }
            },
            /* tooltip: {
                crosshairs: true,
                shared: true
            }, */
            /* legend: {
                enabled: false
            }, */
            plotOptions: {
                line: {
                    dataLabels: {
                        enable: true
                    },
                    marker: {
                        lineColor: 'black'
                    },
                    lineWidth: 1
                }
            },
            /* plotOptions: {
                series: {
                    borderWidth: 0,
                    dataLabels: {
                        enabled: true,
                        format: '{point.y:.1f}%'
                    }
                }
            }, */
            /* tooltip: {
                headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
                pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
            }, */

            series: [{
                name: '-Minutes',
                //data: brandsData
                data: [[3500],[2000],[1550],[1000],[800],[650],[500],[450],[300],[100],[550],[880],[1250],[0],[0]],
                color : ['#F7A22E']
            }]/* ,
            drilldown: {
                series: drilldownSeries
            } */
        });
    }
});

0 个答案:

没有答案