HighCharts中几种tooltip的显示格式
推荐学习地址 => https://www.hcharts.cn/docs/basic-tooltip
https://api.hcharts.cn/#Highcharts.numberFormat
这里给出两个常用的例子
1.折线图横坐标为时间轴时,想显示成

.ts中相关highcharts配置:
$scope.overviewChart = <HighChartsNGConfig>{
options: {
title: {
text: ``
},
chart: {
type: 'line'
},
yAxis: {
min: 0,
title: { text: null },
labels: {
formatter: function () {
return this.value + "%";
}
}
},
xAxis: {
type: "datetime",
dateTimeLabelFormats: {
day: '%b/%e',
month: '%y年%b月',
week: '%b/%e',
year: '%Y年',
millisecond: '%b/%e',
}
// dateTimeLabelFormats: { // don't display the dummy year
// month: '%e. %b',
// year: '%b'
// },
},
tooltip: {
formatter: function () {
var d = new Date(this.x);
var s = '<b>' + d.getFullYear() + '年' + (d.getMonth() + 1) + '月' + d.getDate() + '日' + '</b>';
s += '<br/><span style="color:' + this.point.series.color + '">' + this.point.series.name + ': ' +
this.point.y.toFixed(2) + '%' + ' </span>';
return s;
}
},
legend: {
enabled: true
},
},
}
2. tootip想把数字显示成带有千位符号的,如这样:


饼图的配置代码
//图中数字显示成带千位符号的
Highcharts.setOptions({
lang: {
thousandsSep: ','
}
});
//http code概念饼图
$scope.pieChart = <HighChartsNGConfig>{
options: {
title: {
text: ``
},
chart: {
type: 'pie',
height: 300,
},
tooltip: {
// headerFormat: '{point.name}<br>',
// pointFormat: '{series.name}: <b>{point.y}%</b>'
},
plotOptions: {
pie: {
innerSize: 150,
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false,
},
showInLegend: true
}
},
},
loading: false
};
HighCharts中几种tooltip的显示格式的更多相关文章
- HighCharts中的无主题的2D折线图
HighCharts中的无主题的2D折线图 1.设计源码 <!DOCTYPE html> <html> <head> <meta charset=" ...
- HighCharts中的Ajax请求的2D折线图
HighCharts中的Ajax请求的2D折线图 设计源码: <!DOCTYPE html> <html> <head> <meta charset=&quo ...
- asp.net mvc 中 一种简单的 URL 重写
asp.net mvc 中 一种简单的 URL 重写 Intro 在项目中想增加一个公告的功能,但是又不想直接用默认带的那种路由,感觉好low逼,想弄成那种伪静态化的路由 (别问我为什么不直接静态化, ...
- jsp中两种include的区别【转】
引用文章:http://www.ibm.com/developerworks/cn/java/j-jsp04293/ http://www.cnblogs.com/lazycoding/archive ...
- Java中四种引用:强、软、弱、虚引用
这篇文章非常棒:http://alinazh.blog.51cto.com/5459270/1276173 Java中四种引用:强.软.弱.虚引用 1.1.强引用当我们使用new 这个关键字创建对象时 ...
- [转]C++中四种类型转换符的总结
C++中四种类型转换符的总结 一.reinterpret_cast用法:reinpreter_cast<type-id> (expression) reinterpret_cast操 ...
- iOS开发UI篇—iOS开发中三种简单的动画设置
iOS开发UI篇—iOS开发中三种简单的动画设置 [在ios开发中,动画是廉价的] 一.首尾式动画 代码示例: // beginAnimations表示此后的代码要“参与到”动画中 [UIView b ...
- 计算DNA中每种核苷酸的数目
问题描述:计算DNA中每种核苷酸的数目 输入文件内容: 代码: 输出结果:
- protobuf-net 与 C#中几种序列化的比较
C#中几种序列化的比较,此次比较只是比较了 序列化的耗时和序列后文件的大小. 几种序列化分别是: 1. XmlSerializer 2. BinaryFormatter 3. DataContract ...
随机推荐
- 有个数组 我现在需要把数组里面的值按照n个一组,赋予一个新的数组
有个数组 我现在需要把数组里面的值按照七个一组,赋予一个新的数组
- CPU运行的流程
- Linux系统VPS主机SSH常用命令
putty查询log文当里的"test"关键字 /home/iotserver/WebServer3_log# grep "test" log.log.bak2 ...
- BootStrap的动态模态框及静态模态框
1.要用bootStrap这个框架就必须要重载它的class类,也就是说class要一样 代码如下: 有疑问的可以在下面留言,欢迎大家一起交流 1.1动态模态框 <!DOCTYPE html&g ...
- Idea 2017 激活方法
http://www.cnblogs.com/suiyueqiannian/p/6754091.html
- Qt——信号与槽
自定义槽函数,槽函数可以是任何位置定义的函数(成员函数,静态函数,全局函数),但是槽函数的函数类型要和信号的函数类型一致.
- Android面试收集录 电话、短信和联系人、多媒体技术
1.请写出调用系统拨号界面? Intent intent=new Intent(Intent.ACTION_DIAL,Uri.pase("tel:12345678910")); s ...
- android开发过程中项目中遇到的坑----布点问题
我们在红点push 的到达和点击的地方,都加了布点.后来功能上了线,发现,每天的点击都比到达高! 这肯定不科学. 赶紧查问题,打开程序,发红点,关闭程序,布点上传.没问题.数据部门可以收到红点啊! 从 ...
- Java笔试题-线程编程方面
Ja 线程编程方面 60.java中有几种方法可以实现一个线程?用什么关键字修饰同步方法?stop()和suspend()方法为何不推荐使用? 答:有两种实现方法,分别是继承Thread类与实现R ...
- win10子系统Ubuntu18.04下安装图形界面
前提:windows 10 已经安装WSL(windows subsystem for linux),并能正确运行Bash. 要想使用Linux的图形用户界面通常有两种方法,一种是使用X-Window ...