highcharts.js
4.9 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
(function(H) {
var protocol = window.location.protocol;
var defaultOptionsZhCn = {
lang: {
contextButtonTitle: "",
decimalPoint: ".",
downloadJPEG: "",
downloadPDF: "",
downloadPNG: "",
downloadSVG: "",
drillUpText: "返回 {series.name}",
invalidDate: "无效的时间",
loading: "加载中...",
months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
noData: "没有数据",
numericSymbols: null,
printChart: "",
resetZoom: "重置缩放比例",
resetZoomTitle: "重置为原始大小",
shortMonths: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
thousandsSep: ",",
weekdays: ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
rangeSelectorFrom: "开始时间",
rangeSelectorTo: "结束时间",
rangeSelectorZoom: "范围",
zoomIn: "缩小",
zoomOut: "放大"
},
global: {
canvasToolsURL: protocol + "//cdn.hcharts.cn/highcharts/modules/canvas-tools.js",
VMLRadialGradientURL: protocol + +"//cdn.hcharts.cn/highcharts/gfx/vml-radial-gradient.png"
},
title: {
text: "图表标题"
},
tooltip: {
dateTimeLabelFormats: {
millisecond: "%H:%M:%S.%L",
second: "%H:%M:%S",
minute: "%H:%M",
hour: "%H:%M",
day: "%Y-%m-%d",
week: "%Y-%m-%d",
month: "%Y-%m",
year: "%Y"
},
split: false
},
exporting: {
url: protocol + "//export.highcharts.com.cn"
},
credits: {
text: "",
href: "https://www.highcharts.com.cn"
},
xAxis: {
dateTimeLabelFormats: {
millisecond: "%H:%M:%S.%L",
second: "%H:%M:%S",
minute: "%H:%M",
hour: "%H:%M",
day: "%Y-%m-%d",
week: "%Y-%m",
month: "%Y-%m",
year: "%Y"
}
},
rangeSelector: {
inputDateFormat: "%Y-%m-%d",
buttonTheme: {
width: "auto",
style: {
fontSize: "12px",
padding: "4px"
}
},
buttons: [{
type: "month",
count: 1,
text: "月"
},
{
type: "month",
count: 3,
text: "季度"
},
{
type: "month",
count: 6,
text: "半年"
},
{
type: "ytd",
text: "YTD"
},
{
type: "year",
count: 1,
text: "年"
},
{
type: "all",
text: "所有"
}]
},
plotOptions: {
series: {
dataGrouping: {
dateTimeLabelFormats: {
millisecond: ["%Y-%m-%d %H:%M:%S.%L", "%Y-%m-%d %H:%M:%S.%L", " ~ %H:%M:%S.%L"],
second: ["%Y-%m-%d %H:%M:%S", "%Y-%m-%d %H:%M:%S", " ~ %H:%M:%S"],
minute: ["%Y-%m-%d %H:%M", "%Y-%m-%d %H:%M", " ~ %H:%M"],
hour: ["%Y-%m-%d %H:%M", "%Y-%m-%d %H:%M", " ~ %H:%M"],
day: ["%Y-%m-%d", "%Y-%m-%d", " ~ %Y-%m-%d"],
week: ["%Y-%m-%d", "%Y-%m-%d", " ~ %Y-%m-%d"],
month: ["%Y-%m", "%Y-%m", " ~ %Y-%m"],
year: ["%Y", "%Y", " ~ %Y"]
}
}
},
ohlc: {
tooltip: {
split: false,
pointFormat: '<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>' + "开盘:{point.open}<br/>" + "最高:{point.high}<br/>" + "最低:{point.low}<br/>" + "收盘:{point.close}<br/>"
}
},
candlestick: {
tooltip: {
split: false,
pointFormat: '<span style="color:{point.color}">●</span> <b> {series.name}</b><br/>' + "开盘:{point.open}<br/>" + "最高:{point.high}<br/>" + "最低:{point.low}<br/>" + "收盘:{point.close}<br/>"
}
}
}
};
H.setOptions(defaultOptionsZhCn)
})(Highcharts);