HighCharts常见使用问题总结(个人笔记)
来源:互联网 发布:mac project软件 编辑:程序博客网 时间:2024/05/22 22:59
1、隐藏掉HightChart自带的官网链接
添加以下代码:credits: { enabled: false //去掉官网链接}此节点是官方标准的控制版权信息的节点,属性包括:enabled(是否显示,默认true)、href(链接地址,默认highchart官网)、position(控制位置)、style(样式)、text(文字内容)
2、3D饼图添加legend效果。
(1)在plotOptions/pie节点下添加showInLegend属性(在其他地方添加不好使)(2)在主节点下添加legend设置$('#container').highcharts({ ... plotOptions: { pie: { innerSize: 100, depth: 45, showInLegend:true } }, legend: { layout: 'vertical', ... labelFormatter: function () { //百分比格式化 return this.name + '('+this.percentage+'%)'; } } ...})
官网上API是这样说的:showInLegend: Boolean
Whether to display this particular series or series type in the legend. Since 2.1, pies are not shown in the legend by default.
意思是说是否要显示这个特殊的数据序列或者数据图例。从2.1版本开始,饼图默认不显示此图例
3、HightCharts数字格式化方法(内容摘抄自HightCharts中文社区)。
(1)函数构造及参数
Highcharts.numberFormat (Number number, [Number decimals], [String decimalPoint], [String thousandsSep])
–参数列表–
number 需要格式化的数字
decimals 小数保留位数,最后一位是四舍五入,默认为 0(可选参数)
decimalPoint 小数点符,默认是“.”(可选参数)
thousandsSep 千位符,默认是“,” (可选参数)
返回值类型:String(2)示例
对于数字 12223.8723
Highcharts.numberFormat(12223.87)= 12,224(默认精度是0)
Highcharts.numberFormat(12223.87, 2)= 12223.87(保留两位小数)
Highcharts.numberFormat(12223.87, 2, “,”, ” “)= 12223,87(小数点用“,”,千分符用“ ”)
Highcharts.numberFormat(12223.87, 2, “.”, “”)= 12223.87(不显示千分符)(3)具体应用
应用前:
formatter: function() {
return this.point.name + this.percentage + ‘%’;
}
应用后:
formatter: function() {
return this.point.name + Highcharts.numberFormat(this.percentage,2) + ‘%’;
}
- HighCharts常见使用问题总结(个人笔记)
- Echart常见使用问题总结(个人笔记)
- Highcharts 个人笔记
- highcharts封装使用总结
- highcharts使用总结
- HighCharts.js使用总结
- vba 个人使用总结笔记
- web软件常见安全问题(个人总结)
- (个人笔记)linux常见命令行
- 数学建模学习笔记(八大常见建模问题总结)
- Android 笔记(个人总结)
- Highcharts学习笔记-line(内存使用监视)
- Highcharts学习笔记-饼状图(内存使用监视)
- MPAndroidChart使用(个人笔记)
- SVN使用(个人笔记)
- highcharts插件使用总结和开发中遇到的问题及解决办法
- Highcharts学习笔记(一)
- [总结时间Summary Time] Highcharts的一些常见操作
- Tyvj1073
- linux(十三)之磁盘分区、创建文件系统、挂载
- Python学习笔记(1)
- WOJ1171-Recursive Function
- 邝斌的ACM模板(Baby-Step Giant-Step)
- HighCharts常见使用问题总结(个人笔记)
- 基于SurfaceTexture的静默/无预览拍照方案
- 二叉树
- C++ std::vector指定位置插入
- Law of Commutation HDU
- 视频播放问题总结
- mysql索引优缺点以及创建的时机
- WOJ1187-Difference Minimizing
- kshon学习笔记之android相对布局