HighCharts学习笔记

目录

  • xAxis自定义时间刻度的显示

 

xAxis自定义时间刻度

我们先来看下HighCharts图表的xAxis对象有哪些属性(红色标记重要属性):
allowDecimals: Boolean
categories: Array
dateTimeLabelFormats: Object
minTickInterval: Number
offset: Number
showFirstLabel: Boolean
showLastLabel: Boolean
tickColor: Color
title
typeString
//轴线的类型。可选项:"linear","logarithmic","datetime" or "category"
tickIntervalNumber
//在轴线上单位刻度的间距
labels
startOnTickBoolean
endOnTickBoolean
events
 
详细参考:
 
1)在X轴显示例01-01的时间刻度
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(‘#container‘).highcharts({
    xAxis: {
        type: ‘datetime‘,
        labels: {
            formatter: function () {
                return Highcharts.dateFormat(‘%m-%d ‘, this.value);
            }
        },
        startOnTick: true,
        endOnTick: true,
    },
    series: [{
        pointStart: Date.UTC(2014, 1, 1), //JS时间戳 1388534400000
        data: [29.9, 19.9, 42.9, 20.9]
    }]
});

HighCharts学习笔记

HighCharts学习笔记

上一篇:ABAP modify screen:修改屏幕,实现隐藏、禁止输入字段


下一篇:Replication--复制延迟的诊断和解决