|
@@ -78,6 +78,34 @@ Highcharts.setOptions({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
Highcharts.getJSON('../ucenter/active_get.php', function (data) {
|
|
Highcharts.getJSON('../ucenter/active_get.php', function (data) {
|
|
|
|
|
+ var ohlc = [],
|
|
|
|
|
+ volume = [],
|
|
|
|
|
+ dataLength = data.length,
|
|
|
|
|
+ // set the allowed units for data grouping
|
|
|
|
|
+ groupingUnits = [[
|
|
|
|
|
+ 'week', // unit name
|
|
|
|
|
+ [1] // allowed multiples
|
|
|
|
|
+ ], [
|
|
|
|
|
+ 'month',
|
|
|
|
|
+ [1, 2, 3, 4, 6]
|
|
|
|
|
+ ]],
|
|
|
|
|
+
|
|
|
|
|
+ i = 0;
|
|
|
|
|
+
|
|
|
|
|
+ for (i; i < dataLength; i += 1) {
|
|
|
|
|
+ ohlc.push([
|
|
|
|
|
+ data[i][0], // the date
|
|
|
|
|
+ data[i][1], // open
|
|
|
|
|
+ data[i][2], // high
|
|
|
|
|
+ data[i][3], // low
|
|
|
|
|
+ data[i][4] // close
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+ volume.push([
|
|
|
|
|
+ data[i][0], // the date
|
|
|
|
|
+ data[i][5] // the volume
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// create the chart
|
|
// create the chart
|
|
|
Highcharts.stockChart('container', {
|
|
Highcharts.stockChart('container', {
|
|
@@ -90,17 +118,55 @@ Highcharts.setOptions({
|
|
|
title: {
|
|
title: {
|
|
|
text: gLocal.gui.progress_curve
|
|
text: gLocal.gui.progress_curve
|
|
|
},
|
|
},
|
|
|
|
|
+ yAxis: [{
|
|
|
|
|
+ labels: {
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ x: -3
|
|
|
|
|
+ },
|
|
|
|
|
+ title: {
|
|
|
|
|
+ text: gLocal.gui.EXP
|
|
|
|
|
+ },
|
|
|
|
|
+ height: '60%',
|
|
|
|
|
+ lineWidth: 2,
|
|
|
|
|
+ resize: {
|
|
|
|
|
+ enabled: true
|
|
|
|
|
+ }
|
|
|
|
|
+ }, {
|
|
|
|
|
+ labels: {
|
|
|
|
|
+ align: 'right',
|
|
|
|
|
+ x: -3
|
|
|
|
|
+ },
|
|
|
|
|
+ title: {
|
|
|
|
|
+ text: gLocal.gui.action
|
|
|
|
|
+ },
|
|
|
|
|
+ top: '65%',
|
|
|
|
|
+ height: '35%',
|
|
|
|
|
+ offset: 0,
|
|
|
|
|
+ lineWidth: 2
|
|
|
|
|
+ }],
|
|
|
|
|
+
|
|
|
tooltip: {
|
|
tooltip: {
|
|
|
- shared: true,
|
|
|
|
|
|
|
+ shared: false,
|
|
|
useHTML: true,
|
|
useHTML: true,
|
|
|
- pointFormatter: function() { return '<b>'+this.series.name + ' : ' + this.high + ' ' +gLocal.gui.h+ '<br>' +gLocal.gui.day_EXP + ' : ' + Math.round((this.high - this.low)*100)/100 + ' ' +gLocal.gui.h+'</b><br/>'; },
|
|
|
|
|
- valueDecimals: 2
|
|
|
|
|
|
|
+ pointFormatter: function() {
|
|
|
|
|
+ if(this.high){
|
|
|
|
|
+ return '<b><a href="../">'+this.series.name + ' : ' + this.high + ' ' +gLocal.gui.h+ '</a><br><a href="../">' +gLocal.gui.day_EXP + ' : ' + Math.round((this.high - this.low)*100)/100 + ' ' +gLocal.gui.h+'</a></b><br/>';
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ return '<b><a href="../">'+this.series.name + ' : ' + this.y + ' ' +gLocal.gui.times+'</a><span style="display:none;">'+this.x+'</span></b>';
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ valueDecimals: 2,//保留两位小數
|
|
|
|
|
+ split: true
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
series: [{
|
|
series: [{
|
|
|
type: 'ohlc',
|
|
type: 'ohlc',
|
|
|
name: gLocal.gui.EXP_in_total,
|
|
name: gLocal.gui.EXP_in_total,
|
|
|
- data: data,
|
|
|
|
|
|
|
+ data: ohlc,
|
|
|
dataGrouping: {
|
|
dataGrouping: {
|
|
|
units: [[
|
|
units: [[
|
|
|
'week', // unit name
|
|
'week', // unit name
|
|
@@ -110,7 +176,15 @@ Highcharts.setOptions({
|
|
|
[1, 2, 3, 4, 6]
|
|
[1, 2, 3, 4, 6]
|
|
|
]]
|
|
]]
|
|
|
}
|
|
}
|
|
|
- }]
|
|
|
|
|
|
|
+ }, {
|
|
|
|
|
+ type: 'column',
|
|
|
|
|
+ name: gLocal.gui.day_action,
|
|
|
|
|
+ data: volume,
|
|
|
|
|
+ yAxis: 1,
|
|
|
|
|
+ dataGrouping: {
|
|
|
|
|
+ units: groupingUnits
|
|
|
|
|
+ }
|
|
|
|
|
+ }]
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|