', '最高 : ' + max + ' ', '最低 : ' + min + '
', '漲跌幅 : ' + chaRate +'%' + '
' +'
', '成交量 : ' + volumeHtml + '
', '成交額 : ' + turnoverHtml + '
' ].join(''); } }, axisPointer: { link: {xAxisIndex: 'all'}, label: { backgroundColor: '#777' } }, visualMap: { show: false, seriesIndex: 5, dimension: 2, pieces: [{ value: 1, color: downColor }, { value: -1, color: upColor }] }, grid: [ { left: '13%', right: '10%', height: chartTopHeight }, { left: '13%', right: '10%', top: '72%', height: '20%' } ], xAxis: [ { type: 'category', data: data.categoryDataGang, scale: true, boundaryGap : true, axisLine: { onZero: false, lineStyle:{ color:'#6ca584' } }, splitLine: { show: true, lineStyle:{ color:'#e3f3f7' } }, axisLabel:{ margin:15, color:"#666" }, axisTick:{show:false}, splitNumber: 20, min: 'dataMin', max: 'dataMax', axisPointer: { z: 100 } }, { type: 'category', gridIndex: 1, data: data.categoryDataGang, scale: true, boundaryGap : true, axisLine: { onZero: false, lineStyle:{ color:'#6ca584' } }, axisTick: {show: false}, splitLine: { show: true, lineStyle:{ color:'#e3f3f7' } }, axisLabel: {show: false}, splitNumber: 20, min: 'dataMin', max: 'dataMax' } ], yAxis: [ { name:'價錢临朐天艺数控设备厂', nameLocation: 'end', nameTextStyle:{ color:'#666', padding:[0,0,0,-45] }, scale: true, splitNumber: 4, splitLine:{ show:true, lineStyle:{ color:'#e3f3f7' } }, axisLabel:{ color:'#666', margin:0, textStyle: { color: 'black' } }, axisTick:{ show:false }, axisLine:{ lineStyle:{ color:'#e3f3f7' } } }, { name:lineName ? '成交量' : '', nameLocation: 'end', nameTextStyle:{ color:'#666', padding:[0,0,0,-55] }, scale: true, gridIndex: 1, splitNumber: 2, min:0, axisLabel: { show: lineWord, margin: 0, color: '#666', formatter:function(value,index){ var language="zh-cn"; var value=calVolumeUnit(language,value,1); return value; } }, axisLine: { show: true, lineStyle:{ color:"#e3f3f7" } }, axisTick: {show: false}, splitLine: { show: true, lineStyle:{ color:'#e3f3f7' } }, }, { name:'', nameLocation: 'end', nameTextStyle:{ color:'#666', padding:[0,0,0,56] }, splitNumber: 3, axisTick:{ show: false, }, axisLabel: { show: true, margin:20, color:'#6ca584', formatter: '', textStyle: { color: function (value, index) { if(value>0){ return 'red'; }else if (value<0){ return 'green'; }else{ return 'black'; } } } }, splitLine: { show:false, lineStyle: { color: '#6ca584' } }, axisLine:{ show:true, lineStyle:{ color:'#e3f3f7' } }, }, { name:lineName ? '成交額' : '', nameLocation: 'end', nameTextStyle:{ color:'#666', padding:[0,0,0,56] }, scale: true, gridIndex:1, splitNumber: 2, splitLine:{ show:false, lineStyle:{ color:'#e3f3f7' } }, axisLabel:{ color:'#666', show:lineWord, margin:3, formatter:function (value, index) { var language="zh-cn"; var value=calTurnoverUnit(language,value,1); return value; } }, axisTick:{ show:false }, axisLine:{ lineStyle:{ color:'#e3f3f7' } } }, ], series: [ { name: '上証所', type: 'candlestick', barMaxWidth: '10', markPoint:{ silent:true, }, data: data.values, itemStyle: { normal: { color: downColor, color0: upColor, borderColor: null, borderColor0: null } }, }, { name: '百分比', type: 'line', data: data.PercentageNum, yAxisIndex:2, symbol:'none', symbolSize:0, lineStyle:{ width:0 }, }, { name:lineName ? '成交量' : '', type: 'bar', barMaxWidth: '10', xAxisIndex: 1, yAxisIndex: 1, data: data.volumes, color:'#d85342', }, { name:lineName ? '成交額' : '', type: 'bar', barMaxWidth: '10', xAxisIndex: 1, yAxisIndex: 3, data: data.valuesMoney, color:'#6ca584' } ] }, true); setTimeout(function (){ window.onresize = function () { myChart.resize(); } },20) }}function splitDatas(rawDatas) { var categoryData = []; var values = []; var volumes = []; //var volumesWan = []; var Percentage = []; for (var i = 0; i < rawDatas.length; i++) { values.push(rawDatas[i][1]); volumes.push(rawDatas[i][2]); Percentage.push((rawDatas[i][3]*100).toFixed(2)) } //function getWan(name,newName){ // $.each(name, function (i,item){ // var num = (item/10000).toFixed(2); // newName.push(num); // }) // } // getWan(volumesWan,volumes); function TimeData (stockCode) { var h = 9; var m = 30; var ary = []; for (var i = 0; i<10000;i++) { var str = (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m); ary.push(str); if (m < 59) { m = m + 1; } else { m = 0; h = h+ 1; } if(isKcb(stockCode)) { if (h === 15 && m === 31) { break; } } else { if (h === 15 && m === 1) { break; } } } if(isKcb(stockCode)) { ary.splice(331,5); ary[330] = "15:00/15:05"; } ary.splice(121,90); ary[120] = "11:30/13:00"; categoryData = ary; }; TimeData(688206); return { categoryData: categoryData, values: values, volumes: volumes, Percentage:Percentage, };}timeAjaxUrl();function timeAjaxUrl(){ myChart.showLoading(); $.ajax({ url: SSE.Config.HANGQING_PREFIX + "/line/688206", type: "GET", data: { begin: 0, end: -1, select: 'time,price,volume' }, dataType: "jsonp", success: function (data) { timePicture(data); } }); function timePicture(rawData){ var lineData = rawData.line; var d = dateConvert({data: rawData.line, date: rawData.date}); var d = percentConvert({data: rawData.line, prev_close: rawData.prev_close}); var data = splitDatas(d); myChart.hideLoading(); myChart.setOption(option = { backgroundColor: '#fff', animation: true, title:{ left:'left', text:isKcb(688206) ? ['{b|(688206)} {a|}']:['{b|(688206)}'], textStyle:{ rich:{ a:{ backgroundColor: { image: '../static/picture/icon.png', align: 'right', }, }, b:{ color:'#5d5d5d', fontSize: 12, padding:[0,10], } } } }, tooltip: { trigger: 'axis', axisPointer: { type: 'cross' ,label:{ show:false, } }, backgroundColor: 'rgba(245, 245, 245, 0.8)', borderWidth: 1, borderColor: '#ccc', padding: 10, textStyle: { color: '#000' }, formatter:function(params) { var stockPrice,chgRate,volume,volumeHtml; for(var i=0;i<3;i++){ if(params[i].seriesIndex==0){ stockPrice=params[i].data; }else if(params[i].seriesIndex==1){ chgRate=params[i].data; }else if(params[i].seriesIndex==2){ volume=params[i].data; } } var language="zh-cn"; volumeHtml=calVolumeUnit(language,volume,1); return [ '' + params[1].name + '
', '股價:'+ stockPrice + '
', '漲跌幅:' + chgRate+ '%
', '成交量:' + volumeHtml+'
', ].join(''); } }, axisPointer: { link: {xAxisIndex: 'all'}, label: { backgroundColor: '#777' } }, visualMap: { show: false, seriesIndex: 5, dimension: 2, pieces: [{ value: 1, color: downColor }, { value: -1, color: upColor }] }, grid: [ { left: '13%', right: '10%', height: chartTopHeight }, { left: '13%', right: '10%', top: '72%', height: '20%' } ], xAxis: [ { type: 'category', data: data.categoryData, scale: true, boundaryGap : true, axisLine: { onZero: false, lineStyle:{ color:'#6ca584' } }, splitLine: { show: true, lineStyle:{ color:'#d9eff4' } }, axisLabel:{ show:true, margin:15, color:'#666', interval:lineWidth, showMaxLabel:true }, axisTick:{show:false}, splitNumber: 4, min: '09:30', max: isKcb(688206) ? '15:30':'15:00', axisPointer: { z: 100 } }, { type: 'category', gridIndex: 1, data: data.categoryData, scale: true, boundaryGap : true, axisLine: { onZero: false, lineStyle:{ color:'#6ca584' } }, axisTick: {show: false}, splitLine: { show: true, lineStyle:{ color:'#d9eff4' } }, axisLabel: {show: false}, splitNumber: 20, min: '09:30', max: isKcb(688206) ? '15:30':'15:00', } ], yAxis: [ { name:'價錢', nameLocation: 'end', nameTextStyle:{ color:'#666', padding:[0,0,0,-35] }, scale: true, axisLabel:{ color:'#6ca584', //inside:true, margin:0, textStyle: { color: function (value, index) { var preClose=rawData.prev_close; if(value>preClose){ return 'red'; }else if (value0){ return 'red'; }else if (value<0){ return 'green'; }else{ return 'black'; } } } }, axisTick:{ show:false }, axisLine:{ lineStyle:{ color:'#e3f3f7' } } }, ], series: [ { name: '', type: 'line', symbolSize: 1, data: data.values, smooth: true, lineStyle: { normal: {opacity: 0.9} }, itemStyle:{ color:'#7cc7da' }, lineStyle:{ width:2, type:'solid', shadowBlur:100, shadowColor:'rgba(24,223,121,1)', shadowOffsetY:45 }, areaStyle: { }, markLine: { symbol: 'none', label: { position: 'insideEndTop', formatter: '{b}: {c}' }, lineStyle: { type: 'dashed', color: '#000000', width: 1 }, name: '昨收', data: [ { name: '昨收', yAxis: rawData.prev_close } ] } }, { name: '百分比', type: 'line', symbolSize: 0, data: data.Percentage, smooth: false, lineStyle: { normal: {opacity: 0.9} }, itemStyle:{ color:'#7cc7da', }, symbol:'none', symbolSize:0, lineStyle:{ width:0 }, yAxisIndex: 3 }, { name:lineName ? '成交量' : '', type: 'bar', barMaxWidth: '10', xAxisIndex: 1, yAxisIndex: 1, data: data.volumes, color:'#d85342' }, ] }, true); setTimeout(function (){ window.onresize = function () { myChart.resize(); } },20) }}