highcharts中的仪表盘刻度的区域用文字代替
来源:互联网 发布:unity3d格式 解包 编辑:程序博客网 时间:2024/05/16 03:39
显示该文字的位置,必须要有刻度,不然该文字会因为找不到位置而不显示
``` python yAxis: { min: 0, max: 500, minorTickInterval: 'auto', minorTickWidth: 1, minorTickLength: 10, minorTickPosition: 'inside', minorTickColor: 'transparent', tickPixelInterval: 30, tickWidth: 2, tickPosition: 'inside', tickLength: 10, tickColor: 'transparent', tickPositions:['50','150','250','350','450'], // labels: { // // step: 50, // rotation: 'auto' // // // // }, title: { // text: 'km/h' }, plotBands: [ { from: 0, to: 100, color: '#0c9fe2', innerRadius: '100%', outerRadius: '75%' /* , label: { text: '手动', rotation:'30', textAlign: 'center', verticalAlign:'bottom', x: 100, style: { fontSize: '12px', fontWeight: 600 } }*/ }, { from: 100, to: 200, color: '#DDDF0D', innerRadius: '100%', outerRadius: '75%' /*, label: { text: '自动', rotation:'-60', textAlign: 'center', verticalAlign:'middle', x: 100 }*/ }, { from: 200, to: 300, color:'#E3170D', innerRadius: '100%', outerRadius: '75%' /*, label: { text: 'MDI', rotation:'0', textAlign: 'center', verticalAlign:'middle', x: 250 } */ }, { from: 300, to: 400, color:'#5cb85c', innerRadius: '100%', outerRadius: '75%' /*, label: { text: '编辑', rotation:'60', textAlign: 'center', verticalAlign:'bottom', x: 340 }*/ }, { from: 400, to: 500, color:'#DDDF0D', innerRadius: '100%', outerRadius: '75%' /*, label: { text: '手摇', rotation:'150', textAlign: 'right', verticalAlign:'bottom', x: 300 }*/ } ], labels: { y:20, formatter: function () { console.log('-----') console.log(this.value+''); switch (this.value+''){ case '50': return '手动'; case '150': return '自动'; case '250': return 'MDI'; case '350': return '编辑'; case '450': return '手摇'; default: return ''; } }, distance:30, style:{ color:'#ccc', fontSize: '18px', } } }
设定哪些区域显示什么名字,里面可以加字体旋转角度,要自己调整series: [ { name: '系统操作模式', dataLabels:{ borderWidth: 0, formatter:function(){ console.log('+++====='); console.log(this.y); var yy=this.y; if(yy>0&&yy<=100){ return '手动'; } if(yy>100&&yy<=200){ return '自动'; } if(yy>200&&yy<=300){ return 'MDI'; } if(yy>300&&yy<=400){ return '编辑'; } if(yy>400&&yy<=500){ return '手摇'; } }, style:{"color": "contrast", "fontSize": "36px", "fontWeight": "bold", "textOutline": "1px 1px contrast" } }, data: [ { name: '系统操作模式:', y:datas, sliced: true, selected: true } ], tooltip: { // valueSuffix: ' km/h' } } ]
阅读全文
1 0
- highcharts中的仪表盘刻度的区域用文字代替
- 3.canvas实现刻度仪表盘的绘制
- 用省略号代替span中的长文字
- HighCharts自定义坐标轴刻度
- Highcharts仪表盘制作
- highcharts仪表盘(1)
- highcharts之仪表盘clock
- Highcharts 制作仪表盘 gauge
- 太长的文字用省略号来代替
- css省略超出的文字,用...代替
- highcharts图表 去掉highcharts的logo 改变y轴的刻度 改变背景颜色 去掉图例
- 设置当TextView中的文字超过TextView的容量时,用省略号代替
- 设置当TextView中的文字超过TextView的容量时,用省略号代替
- 设置当TextView中的文字超过TextView的容量时,用省略号代替
- 控制文字长度,多出的文字用省略号代替
- 控制文字长度,多出的文字用省略号代替
- 文字区域的提取
- 如何改变sencha-chart的刻度item显示文字
- Python多进程multiprocessing使用示例
- Spring (二)依赖注入原理 , bean 作用域, 其他配置
- Code forces -764D Timofey and rectangles
- 数据库小结
- AOP中通知(advice)、切点(pointcut)和连接点(join point)的概念
- highcharts中的仪表盘刻度的区域用文字代替
- response对象的使用
- SharedPreferences数据存储类的简单使用
- 隐式类型转换(C语言)
- odoo初学遇到问题小集锦
- Linux服务器运维:使用Crontab定期清理tomcat日志
- Python3.5——文件读与写详解(上)
- vs2012偷梁换柱法之改变一个没有m_hWnd的active控件窗口大小
- 微信小程序支付 java