小编use*_*035的帖子

高图表以小时格式设置x轴值

我正在使用高图表进行图表绘制.我希望像这样的小时格式的x轴[00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19, 20,21,22,23]
我也不想使用我评论的类别参数

以下是Js

$('#container').highcharts({
                chart: {
                    zoomType: 'xy'
                },

                title: {
                    text: 'Average Monthly Temperature and Rainfall in Tokyo'
                },
                subtitle: {
                    text: 'Source: WorldClimate.com'
                },
                xAxis: [{
                    //categories: ['00', '01', '02', '03', '04', '05',
                        //'06', '07', '08', '09', '10', '11']
                        labels: {
                            formatter: function() {
                            return Highcharts.dateFormat('%H', this.value);

                        },
                        style: {
                            color: '#89A54E'
                        },

                        }

                }],
                yAxis: [{ // Primary yAxis
                    labels: {
                        //format: '{value}°C',
                        style: {
                            color: '#89A54E'
                        }
                    },
                    min:0,
                    //max:4,
                    tickInterval:2,

                    title: {
                        text: 'Temperature', …
Run Code Online (Sandbox Code Playgroud)

charts highcharts

0
推荐指数
1
解决办法
9499
查看次数

标签 统计

charts ×1

highcharts ×1