highcharts 相关笔记

  1. 使用vue + highstock 画k线图
    参考:https://www.jianshu.com/p/38035a9f1c88

  2. 修改交易量柱形图颜色重写方法
    参考:https://stackoverflow.com/questions/12653644/change-color-of-volume-columns-high-low-in-highcharts

Highcharts.seriesTypes.column.prototype.pointAttribs = (function(func) {
return function(point, state) {
var attribs = func.apply(this, arguments);
var candleSeries = this.chart.series[0]; // Probably you'll need to change the index
var candlePoint = candleSeries.points.filter(function(p) { return p.index == point.index; })[0];
var color = (candlePoint.open < candlePoint.close) ? 'red' : 'green'; // Replace with your colors
attribs.fill = state == 'hover' ? Highcharts.Color(color).brighten(0.3).get() : color;
return attribs;
};
}(Highcharts.seriesTypes.column.prototype.pointAttribs));
  1. 隐藏范围选择器
Highcharts.setOptions({
lang: {
rangeSelectorZoom: '' // 不显示 'zoom' 文字
}
})
rangeSelector:{
// 不适用范围选择器
// enabled:false,
buttons:[
{
type:'month',
count:6,
text:''
}
],
selected:0,
// 不显示日期选择框
inputEnabled : false,
},
  1. 本地化配置
    参考:https://www.hcharts.cn/docs/basic-lang/
Highcharts.setOptions({
lang:{
contextButtonTitle:"图表导出菜单",
decimalPoint:".",
downloadJPEG:"下载JPEG图片",
downloadPDF:"下载PDF文件",
downloadPNG:"下载PNG文件",
downloadSVG:"下载SVG文件",
drillUpText:"返回 {series.name}",
loading:"加载中",
months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
noData:"没有数据",
numericSymbols: [ "千" , "兆" , "G" , "T" , "P" , "E"],
printChart:"打印图表",
resetZoom:"恢复缩放",
resetZoomTitle:"恢复图表",
shortMonths: [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec"],
thousandsSep:",",
weekdays: ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六","星期天"]
}
});
  1. 时区问题
    参考:https://blog.csdn.net/li_001/article/details/69382136

  2. 动态设置数据
    参考:https://blog.csdn.net/jiary5201314/article/details/39548873

  3. 其他
    参考:https://blog.csdn.net/xiaojiang0829/article/details/28265833#comments

posted on   朝朝暮Mu  阅读(13)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示