hcharts学习笔记-轴反转的曲线图

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'spline',//光滑线段 即曲线
            inverted: true //反轴标志
        },
        title: {
            text: 'Atmosphere Temperature by Altitude'
        },
        subtitle: {
            text: 'According to the Standard Atmosphere Model'
        },
        xAxis: {
            reversed: false,//x轴坐标反转 现在的x轴为纵向
            title: {
                enabled: true,
                text: 'Altitude'
            },
            labels: {
                formatter: function() {
                    return this.value +'km';
                }
            },
            maxPadding: 0.05, //最大填充
            showLastLabel: true //显示最后一个坐标值
        },
        yAxis: {
            title: {
                text: 'Temperature'
            },
            labels: {
                formatter: function() {
                    return this.value + '°';
                }
            },
            lineWidth: 2 //y坐标轴宽度
        },
        legend: {
            enabled: false
        },
        tooltip: {
            headerFormat: '<b>{series.name}</b><br/>', //头部信息
            pointFormat: '{point.x} km: {point.y}°C' //具体信息
        },
        plotOptions: {
            spline: {
                marker: {
                    enable: false //根据鼠标位置自动定位到最近节点
                }
            }
        },
        series: [{
            name: 'Temperature',
            data: [[0, 15], [10, -50], [20, -56.5], [30, -46.5], [40, -22.1],
                [50, -2.5], [60, -27.7], [70, -55.7], [80, -76.5]]
        }]
    });
});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值