var intradayChart = { init : function(ucode,code,callback){ var self = this; //$.getJSON('/'+lang+'/data/chart/intradayChart/code/'+code, function(_data) { $.when( $.getJSON('/'+lang+'/data/chart/OHLC/code/'+ucode+'/type/intraday'), $.getJSON('/'+lang+'/data/chart/OHLC/code/'+code+'/type/intraday') ).then(function(_ucode, _code) { //var data = self.decode(_data); var decode_ucode = self.decode(_ucode[0]); var decode_code = self.decode(_code[0]); //console.log(decode_code.length,decode_ucode.length); $('#intradayChartContainer').highcharts('StockChart', self.getJSON(decode_ucode,decode_code)); if (callback!==undefined){ //callback(chart,data); } }); }, decode : function(_data){ return _data.mainData; }, getJSON : function(udata, data){ //var last = data.last; //var ulast = data.ulast; var last=[]; var ulast=[]; for (i = 0; i < udata.length; i++) { ulast.push([udata[i][0],udata[i][4]]); } if(data!=null){ for (i = 0; i < data.length; i++) { last.push([data[i][0], data[i][4]]); } } 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: { 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: 0, lineWidth: 0, showLastLabel: true, }], tooltip: { backgroundColor: 'none', borderWidth: 0, shadow: false, useHTML: true, padding: 0, formatter: function() { var html =''; if(undefined !=this.points[0]){ html = ' 標的 '+this.points[0].y+""; html += '    '; } if(undefined !=this.points[1]){ html += '權證 '+this.points[1].y+""; } return ""+html+""; }, positioner: function () { return { x: 70, y: -5 }; } }, navigator : { enabled : false }, scrollbar : { enabled : false }, series : [{ data : ulast, yAxis: 1, useHTML: true, color: '#80DBD5', lineWidth: 2, states: { hover: { lineWidth: 2, } } },{ data : last, useHTML: true, color: '#FF4E77', lineWidth: 2, states: { hover: { lineWidth: 2, } } } ], exporting: { enabled: false }, rangeSelector:{ enabled: false } }; } }