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 ...
随机推荐
- #leetcode刷题之路5-最长回文子串
给定一个字符串 s,找到 s 中最长的回文子串.你可以假设 s 的最大长度为 1000. 示例 1:输入: "babad"输出: "bab"注意: " ...
- 前行记录 - NOIP2018游记
NOIP2018游记 - 前行记录 NOIP2018 完跪……滚回学校考半期 QwQ 这篇不是题解 awa ,题解之后会发布的,毕竟我还没有AC呢 又及……G2020 陌路笙歌 - 再见(╯▽╰) 感 ...
- chromium之tracked_objects
// For each thread, we have a ThreadData that stores all tracking info generated // on this thread. ...
- (转)Dubbo 简单Dome搭建
(转)原地址https://blog.csdn.net/noaman_wgs/article/details/70214612/ Dubbo背景和简介 Dubbo开始于电商系统,因此在这里先从电商系统 ...
- Centos7安装FastDFS
离线安装包准备: 将相关的安装包上传到 /usr/local 目录,安装包下载 并解压到当前目录 1.安装 gcc yum install -y gcc gcc-c++ 2.安装 perl yum i ...
- ubuntu 14.04离线安装docker和docker compose
准备安装包 1.下载docker docker支持以下版本的ubuntu系统Artful 17.10 (Docker CE 17.11 Edge)Zesty 17.04Xenial 16.04 (LT ...
- 网站标题被篡改成北京赛车、PK10的解决处理办法
客户网站于近日被跳转到赌博网站,打开后直接跳转到什么北京赛车,PK10等内容的网站上去,客户网站本身做了百度的推广,导致所有访问用户都跳转到赌博网站上去,给客户带来很大的经济损失,再一个官方网站的形象 ...
- Leecode刷题之旅-C语言/python-9.回文数
/* * @lc app=leetcode.cn id=9 lang=c * * [9] 回文数 * * https://leetcode-cn.com/problems/palindrome-num ...
- IO复用——select系统调用
1.select函数 此函数用于在一段时间内,监听用户感兴趣的文件描述符上的可读.可写和异常等事件. #include<sys/select.h> int select(int nfds, ...
- vue---day04
1. Node.js 1.1 介绍: - Node.js 是一个JavaScript运行环境,实质上是对Chrome V8引擎的封装. - Node.js 不是一个 JavaScript 框架,不同于 ...