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 ...
随机推荐
- python写爬虫的弯路
一开始按照视频上的找了笔趣阁的网站先爬一部小说, 找了<遮天>,但是章节太多,爬起来太慢, 就换了一个几十章的小说. 根据视频里的去写了代码, 在正则表达式哪里出了很大的问题. from ...
- Percona-Tookit工具包之pt-table-checksum
Preface The master-slave replication is commonly used in our product evironment.On account o ...
- 微信小程序 提示框延时跳转
wx.showToast({ title: '成功', icon: 'success', duration: 2000, success:function(){ console.log('haha') ...
- 洛谷 U45568 赌神:决斗
题目描述 \mathcal{tomoo}tomoo决定与\mathcal{CYJian}CYJian进行决斗! 已知\mathcal{tomoo}tomoo有\mathcal{N}N张扑克牌,每张扑克 ...
- 查看ubuntu版本号命令
1.uname -a 查看内核版本号 2.cat /etc/issue 查看ubuntu版本号 3.sudo lsb_release -a 查看ubuntu版本号
- python与mysql的连接过程
1.cmd---pip3 install PyMySQL2.>>>import pymysql3.mysql>create database bookdb character ...
- 网络编程之socket的运用
一,socket用法 socket是什么 ? Socket是应用层与TCP/IP协议族通信的中间软件抽象层,它是一组接口.在设计模式中,Socket其实就是一个门面模式,它把复杂的TCP/IP协议族隐 ...
- 关于nodejs DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
const mongoose = require('mongoose') mongoose.connect("mongodb://localhost:27017/study", { ...
- 集合--数据结构与算法JavaScript描述(9)
集合 Set 概念 (跟高中时数学课上学的集合几乎一模一样哦哈哈) 集合是一种包含不同元素的数据结构. 集合中的元素称为成员. 集合的两个最重要的特性: 集合中的成员是无序的. 集合中不允许相同成员存 ...
- JDBC 的使用
使用 MariaDB,JDBC 所有操作全部使用预处理 SQL 的基本类型与 Java 类型的对应关系 CHAR(N) - String VARCHAR(N) - String BOOLEN - bo ...