博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于Highcharts的x轴密密麻麻的时间格式显示问题解决方法
阅读量:2288 次
发布时间:2019-05-09

本文共 1694 字,大约阅读时间需要 5 分钟。

把X轴改为这样 xAxis: {categories:obj.tdate,   //x轴显示格式['0000-00-00','0000-00-00','0000-00-00','0000-00-00','4','5']labels: {step:2,rotation: -25, align: 'right', style: { font: 'normal 13px Verdana, sans-serif'}}},

例子

function chart_line_basic(renderTo, categories, series, legendEnabled) {    this.renderTo = renderTo;    this.series = series;    this.categories = categories;    this.legendEnabled = legendEnabled;    this.step=0;    this.rotation=0;    if(categories.length>4)    {    this.step=2;    this.rotation=25;    }}chart_line_basic.prototype.formatterTooltip = function () { }chart_line_basic.prototype.showChart = function () {    var chart;    chart = new Highcharts.Chart({        chart: {            renderTo: this.renderTo,            type: 'line',//            marginRight: 130,//            marginBottom: 25        },        title: {            text: '',            x: -20 //center        },        subtitle: {            text: '',            x: -20        },        xAxis: {            labels:{            step:this.step,            rotation: this.rotation            },            categories: this.categories        },        yAxis: {            title: {                text: ''            },            plotLines: [{                value: 0,                width: 1,                color: '#808080'            }]        },        tooltip: {            formatter: this.formatterTooltip        },        legend: {            floating: true,            layout: 'vertical',            align: 'right',            verticalAlign: 'top',            x: -10,            y: 20,            borderWidth: 0,            enabled: this.legendEnabled        },        series: this.series    });};

 

转载地址:http://ufynb.baihongyu.com/

你可能感兴趣的文章
Perl 中的特殊变量 $&, $`,$' ,@_
查看>>
debian 下 perldoc 安装
查看>>
perl CPAN模块安装的配置文件
查看>>
常用vi指命
查看>>
php5 面向对像学习手扎
查看>>
IE 下的打印
查看>>
一个Mysql自动备份脚本
查看>>
常用Linux软件列表
查看>>
vi的使用
查看>>
Red Hat下WEB服务器的配置
查看>>
蝴蝶计划
查看>>
SWFObject: 基于Javascript的Flash媒体版本检测与嵌入模块
查看>>
ASP语法速查表
查看>>
post表单时的html报文的header信息
查看>>
用PHP开始你的MVC (一)整合你的站点入口
查看>>
用PHP开始你的MVC (二)抽象数据库接口
查看>>
用PHP开始你的MVC(三)实现你的Model层
查看>>
用PHP开始你的MVC (四)实现View层
查看>>
在PHP中利用XML技术构造远程服务(资料传输)
查看>>
PEAR简介:用PEAR来写你的下一个php程序
查看>>