highcharts曲线图

效果:

隐藏 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]
    }]
});

 

转载于:https://www.cnblogs.com/CoreXin/p/7079899.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值