码迷,mamicode.com
首页 > 其他好文 > 详细

highcharts曲线图

时间:2017-06-26 13:43:49      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:span   cat   大小   value   air   push   pre   1.5   shai   

效果:

技术分享

隐藏 xy 轴说明

.highcharts-legend {
    display:none
}

 

Json 数据:

var days =[];
var achievingrates=[]
_.each(data, function (item)
{
    days.push(item.day);
    achievingrates.push(item.achievingrate);                   
});                
chart1.xAxis[0].setCategories(days);
chart1.series[0].setData(achievingrates);

定义:

chart1 = new Highcharts.Chart({
    chart: {
        type: spline,
        renderTo: container,
        backgroundColor: rgba(0,0,0,0)‘--背景色
    },
    title: {
        text: 單日達成趨勢,
        x: -20, //center
        style: {
            fontSize:25px,--字体大小颜色
            color: "#FFFF00",
            fill: #FFFFFF
        }
    },
    xAxis: {
        categories: [一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月],
        labels: {
            style:
            {
                color: "#FFFF00",--横轴字体大小颜色
                fontSize: "15px"
            }
        }
    },
    yAxis: {
        title: {
            text: ‘‘
        },
        labels: {
            formatter: function () {
                return this.value + ‘‘
            },
            style:
            {
                color: "#FFFF00",--y轴颜色大小
                fontSize: "15px"
            }
        }
    },
    tooltip: {
        crosshairs: true,
        shared: true
    },
    colors: [#FFFF00],--线条颜色
    plotOptions: {
        spline: {
            marker: {
                radius: 4,
                lineColor: #FFFF00,--线条颜色
                lineWidth: 1
            }
        },
    },
    series: [{
        data: [7.0, 6.9, 9.5, 14.5, 18.2, 21.5, 25.2, 26.5, 23.3, 18.3, 13.9, 9.6]
    }]
});

 

highcharts曲线图

标签:span   cat   大小   value   air   push   pre   1.5   shai   

原文地址:http://www.cnblogs.com/CoreXin/p/7079899.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!