推荐学习地址 => 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的显示格式的更多相关文章

  1. HighCharts中的无主题的2D折线图

    HighCharts中的无主题的2D折线图 1.设计源码 <!DOCTYPE html> <html> <head> <meta charset=" ...

  2. HighCharts中的Ajax请求的2D折线图

    HighCharts中的Ajax请求的2D折线图 设计源码: <!DOCTYPE html> <html> <head> <meta charset=&quo ...

  3. asp.net mvc 中 一种简单的 URL 重写

    asp.net mvc 中 一种简单的 URL 重写 Intro 在项目中想增加一个公告的功能,但是又不想直接用默认带的那种路由,感觉好low逼,想弄成那种伪静态化的路由 (别问我为什么不直接静态化, ...

  4. jsp中两种include的区别【转】

    引用文章:http://www.ibm.com/developerworks/cn/java/j-jsp04293/ http://www.cnblogs.com/lazycoding/archive ...

  5. Java中四种引用:强、软、弱、虚引用

    这篇文章非常棒:http://alinazh.blog.51cto.com/5459270/1276173 Java中四种引用:强.软.弱.虚引用 1.1.强引用当我们使用new 这个关键字创建对象时 ...

  6. [转]C++中四种类型转换符的总结

    C++中四种类型转换符的总结 一.reinterpret_cast用法:reinpreter_cast<type-id> (expression)    reinterpret_cast操 ...

  7. iOS开发UI篇—iOS开发中三种简单的动画设置

    iOS开发UI篇—iOS开发中三种简单的动画设置 [在ios开发中,动画是廉价的] 一.首尾式动画 代码示例: // beginAnimations表示此后的代码要“参与到”动画中 [UIView b ...

  8. 计算DNA中每种核苷酸的数目

    问题描述:计算DNA中每种核苷酸的数目 输入文件内容: 代码: 输出结果:

  9. protobuf-net 与 C#中几种序列化的比较

    C#中几种序列化的比较,此次比较只是比较了 序列化的耗时和序列后文件的大小. 几种序列化分别是: 1. XmlSerializer 2. BinaryFormatter 3. DataContract ...

随机推荐

  1. python selenuim如何判断下拉框是否加载出来,超过时间不再等待

    s_flag = True time_start = time.time() while s_flag: doc = etree.HTML(unicode.encode(driver.page_sou ...

  2. (转)Dubbo 简单Dome搭建

    (转)原地址https://blog.csdn.net/noaman_wgs/article/details/70214612/ Dubbo背景和简介 Dubbo开始于电商系统,因此在这里先从电商系统 ...

  3. let's encrypt部署免费泛域名证书

    环境说明 [root@localhost ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@localhos ...

  4. simpleXML技术解析xml文件(php)

    1.simpleXML的核心思想:以面向对象的方法来操作xml文件 此技术可以将xml文件的所有元素都转成对象.会返回一个对象数组,再用foreach遍历,即可得到元素的名称,内容,和属性值. tes ...

  5. iOS 开发中保留小数问题

    保留两位小数(四舍五入) - (void)viewDidLoad { [super viewDidLoad]; // 有时候我们需要对数据保留两位小数,而且需要四舍五入,并且需要把末尾多余的0给去掉\ ...

  6. Yii2.0 游客访问限制(转)

    最近在用Yii2.0做项目,其中需要实现一个功能:没有登录不能访问部分页面,即游客身份访问限制.查了半天资料,终于找到答案.解决方法如下: 在access里,access即访问的意思,其中有个配置项 ...

  7. HashMap JDK1.8实现原理

    HashMap概述 HashMap存储的是key-value的键值对,允许key为null,也允许value为null.HashMap内部为数组+链表的结构,会根据key的hashCode值来确定数组 ...

  8. EXKMP学习笔记QAQ

    因为一本通少了一些算法,所以我就自行补充了一些东西上去. EXKMP也就是扩展KMP,是一种特别毒瘤的东西 EXKMP确实很难,我理解他的时间与AC机的时间差不多,而且还很难记,因此一学会就马上写博客 ...

  9. Python3 time模块&datetime模块&random模块

    ''' time模块 ''' # import time # print(help(time)) # help()提供帮助 # print(time.time()) # 1970年开始到现在的秒数(时 ...

  10. UVA10474 Where is the Marble?【排序】

    参考:https://blog.csdn.net/q547550831/article/details/51326321 #include <iostream> #include < ...