关于Highcharts的x轴密密麻麻的时间格式显示问题解决方法
来源:互联网 发布:windows 1.0 开源 编辑:程序博客网 时间:2024/04/28 06:25
把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 });};
<script type="text/javascript"> $(function () { var renderTo = "container_1"; //如果没有可以用NULL表示:空 ,而0表示从0开始 var series = [{ name: 'Tokyo', data: [7.0, 6.9, null, 14.5, 18.2, 21.5, 25.2, 26.5]}]; var categories = ['一周', '二周', '三周', '四周', '五周', '六周', '七周', '八周']; var legendEnabled = true; var _line_basic = new chart_line_basic(renderTo, categories, series, legendEnabled); _line_basic.formatterTooltip = function () { return this.x + ': ' + this.y + '%'; } _line_basic.showChart(); }); </script>
<div id="container_1" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
- 关于Highcharts的x轴密密麻麻的时间格式显示问题解决方法
- highcharts中如何正确显示时间格式的x轴
- json格式的时间显示Date问题解决方法
- Highcharts隐藏x轴文字的方法
- Highcharts中x轴为时间时的设置
- 关于highcharts的x轴自适应的问题,reflow :true,
- 关于highcharts时间轴与数据绑定的问题
- 关于时间格式的一些处理方法
- 关于时间格式的
- 关于PhotoShop中保存CMYK格式TIFF文件在GDI+错误地显示颜色的问题解决方法
- 关于日期时间格式的显示问题(python)
- json格式的时间显示为正常年月日的方法
- 关于tensorboard的使用不显示的问题解决方法
- HighCharts的显示问题
- highcharts柱形图中x轴数据的类型
- 关于linux的时间问题解决
- 不同的时间格式 显示
- 时间格式的显示 format
- JVM学习笔记(三)------内存管理和垃圾回收 .
- 【JBoss】JNDI与JBossNS
- 殊途同归——总结asp.net
- 数据库连接池
- cocos2d-x在visio studio2008打印信息到控制台
- 关于Highcharts的x轴密密麻麻的时间格式显示问题解决方法
- JVM学习笔记(四)------内存调优 .
- 转]try-except
- VS 调试 ffmpeg 源码
- reinterpret_cast
- Linux设备模型
- 什么时候使用接口?什么时候使用抽象?选择Java接口还是抽象类 (转)
- 【语言-C++】Xml处理(chenlu1):UTF-8 的中文Key= 中文Value的解析()
- 你离开的21天,我学会了shell运维自动化 ----世界末日后最NB的IT书