var underlyingIntradayChart = { init : function(code,callback){ var self = this; //$.getJSON('/'+lang+'/data/chart/underlyingIntradayChart/code/'+code, function(_data) { $.getJSON('/'+lang+'/data/chart/OHLC/code/'+code+'/type/intraday', function(_data) { var data = self.decode(_data); $('#underlyingIntradayChartContainer').highcharts('StockChart', self.getJSON(data)); if (callback!==undefined){ //callback(chart,data); } }); }, decode : function(_data){ return _data.mainData; }, getJSON : function(data){ //var last = data.last; //var ulast = data.ulast; var last=[]; for (i = 0; i < data.length; i++) { //last.push([data[i][0], data[i][1], data[i][2], data[i][3], data[i][4]]); last.push([data[i][0], data[i][4]]); /*if(self.chartType != "candle" && self.period!="intraday"){ last.push([data[i][0], data[i][1]]); //turnover.push([data[i][0] , data[i][2]]); }else{ if(self.chartType != "candle") { last.push([data[i][0], data[i][4]]); //turnover.push([data[i][0] , data[i][6]]); }else{ last.push([data[i][0], data[i][1], data[i][2], data[i][3], data[i][4]]); //turnover.push([data[i][0] , data[i][6]]); } }*/ } var dp = 0; return { chart:{ spacing: [0, 0, 0, 0], useHTML: true, // plotBorderWidth: 1, marginTop: 3, }, xAxis:{ type: 'datetime', // gridLineWidth: 1, gridLineWidth: 0, tickColor: '#00000000', lineColor: '#00000000', labels: { style: {color: "#C9C9C9"}, formatter : function() { return Highcharts.dateFormat('%H:%M', this.value); } }, /*tickPositioner: function () { //tickPositioner for daily var positions = []; var msec = 60*60*1000; var lastday = 0; data.last[data.last.length-1][0]; for (i=0;i


格", rotation: 0, y: -30, margin: 15, style: {color: "#000"} }, labels:{ align:'left', x:10, y:5, formatter: function () { // return (this.isFirst)?"":this.value; return this.value; }, style: {color: "#000"} }, tickAmount : 6, lineWidth: 0, showLastLabel: true, }, */ { title: { enabled: false, useHTML: true, text: "


", rotation: 0, y: -30, margin: 15, style: {color: "#000"} }, labels:{ align:'right', x:-10, y:5, formatter: function () { // return (this.isFirst)?"":this.value; return this.value; }, style: {color: "#000"} }, tickAmount : 6, opposite: false, gridLineWidth: 1, lineWidth: 0, showLastLabel: true, }], tooltip: { backgroundColor: 'none', borderWidth: 0, shadow: false, useHTML: true, padding: 0, formatter: function() { var html = ' 標的 '+this.points[0].y+""; // html += '    '; // html += '權證 '+this.points[1].y+""; return ""+html+""; }, positioner: function () { return { x: 40, y: -5 }; } }, navigator : { enabled : false }, scrollbar : { enabled : false }, series : [ { data : last, type : "line", // yAxis: 1, useHTML: true, color: '#FF4E77', lineWidth: 2, states: { hover: { lineWidth: 2, } } }, /* { data : last, useHTML: true, color: '#FF4E77', lineWidth: 2, states: { hover: { lineWidth: 2, } } } */ ], exporting: { enabled: false }, rangeSelector:{ enabled: false } }; } }