hqchart 1.1.13786 → 1.1.13793
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/umychart.vue.js
CHANGED
|
@@ -1327,7 +1327,8 @@ this.JSChartContainer.Draw();}};this.CreateResizeListener=function(){var _this4=
|
|
|
1327
1327
|
this.CreateToolbar=function(option){};//创建设置div窗口
|
|
1328
1328
|
this.CreateSettingDiv=function(option){};this.Focus=function(){if(this.CanvasElement)this.CanvasElement.focus();};//切换股票代码接口
|
|
1329
1329
|
this.ChangeSymbol=function(symbol,option){if(this.JSChartContainer)this.JSChartContainer.ChangeSymbol(symbol,option);};//K线切换指标
|
|
1330
|
-
this.ChangeIndex=function(windowIndex,indexName,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeIndex=='function')this.JSChartContainer.ChangeIndex(windowIndex,indexName,option);}
|
|
1330
|
+
this.ChangeIndex=function(windowIndex,indexName,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeIndex=='function')this.JSChartContainer.ChangeIndex(windowIndex,indexName,option);};//切换一个窗口指标,包含叠加指标,以及这个窗口的属性
|
|
1331
|
+
this.ChangeIndexWindow=function(windowIndex,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeIndexWindow=='function')this.JSChartContainer.ChangeIndexWindow(windowIndex,option);};this.AddIndexWindow=function(indexName,option){if(this.JSChartContainer&&typeof this.JSChartContainer.AddIndexWindow=='function')this.JSChartContainer.AddIndexWindow(indexName,option);};this.AddScriptIndexWindow=function(indexInfo,option){if(this.JSChartContainer&&typeof this.JSChartContainer.AddScriptIndexWindow=='function')this.JSChartContainer.AddScriptIndexWindow(indexInfo,option);};this.AddAPIIndexWindow=function(indexData,option){if(this.JSChartContainer&&typeof this.JSChartContainer.AddAPIIndexWindow=='function')this.JSChartContainer.AddAPIIndexWindow(indexData,option);};this.RemoveIndexWindow=function(id){if(this.JSChartContainer&&typeof this.JSChartContainer.RemoveIndexWindow=='function')this.JSChartContainer.RemoveIndexWindow(id);};this.ChangeScriptIndex=function(windowIndex,indexData,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeScriptIndex=='function')this.JSChartContainer.ChangeScriptIndex(windowIndex,indexData,option);};this.ChangePyScriptIndex=function(windowIndex,indexData)//切换py指标
|
|
1331
1332
|
{if(this.JSChartContainer&&typeof this.JSChartContainer.ChangePyScriptIndex=='function')this.JSChartContainer.ChangePyScriptIndex(windowIndex,indexData);};this.GetIndexInfo=function(){if(this.JSChartContainer&&typeof this.JSChartContainer.GetIndexInfo=='function')return this.JSChartContainer.GetIndexInfo();else return[];};this.ChangeInstructionIndex=function(indexName,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeInstructionIndex=='function')this.JSChartContainer.ChangeInstructionIndex(indexName,option);};this.ChangeInstructionScriptIndex=function(indexData){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeInstructionIndex=='function')this.JSChartContainer.ChangeInstructionScriptIndex(indexData);};this.CancelInstructionIndex=function(){if(this.JSChartContainer&&typeof this.JSChartContainer.CancelInstructionIndex=='function')this.JSChartContainer.CancelInstructionIndex();};//K线周期切换
|
|
1332
1333
|
this.ChangePeriod=function(period,option){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangePeriod=='function')this.JSChartContainer.ChangePeriod(period,option);};//K线复权切换
|
|
1333
1334
|
this.ChangeRight=function(right){if(this.JSChartContainer&&typeof this.JSChartContainer.ChangeRight=='function')this.JSChartContainer.ChangeRight(right);};//叠加股票
|
|
@@ -2107,7 +2108,24 @@ if(event&&event.Callback){var data={PreventDefault:false,CommandID:cmdID,Args:ar
|
|
|
2107
2108
|
this.CreateChartPaintExtend=function(chart,windowIndex){if(windowIndex<0)return false;var subFrame=this.Frame.SubFrame[windowIndex];if(!subFrame||!subFrame.Frame)return false;var frame=subFrame.Frame;chart.Canvas=this.Canvas;chart.ChartBorder=frame.ChartBorder;chart.ChartFrame=frame;this.ChartPaintEx.push(chart);return true;};//删除指标窗口扩展图形 option={ ChartID:图形ID, WindowIndex:窗口 }
|
|
2108
2109
|
this.DeleteChartPaintExtend=function(option,bCallDestroy){if(!option)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.ChartPaintEx))return;if(IFrameSplitOperator.IsNumber(option.WindowIndex)){var windowIndex=option.WindowIndex;if(!this.Frame.SubFrame[windowIndex])return;var subFrame=this.Frame.SubFrame[windowIndex].Frame;if(!subFrame)return;var paint=[];//踢出当前窗口的指标画法
|
|
2109
2110
|
var deleteCount=0;for(var i=0;i<this.ChartPaintEx.length;++i){var item=this.ChartPaintEx[i];var bFind=item.ChartFrame.Guid==subFrame.Guid||item.ChartFrame==subFrame;if(!bFind){paint.push(item);}else{++deleteCount;if(bCallDestroy===true){if(item&&item.OnDestroy)item.OnDestroy();//图形销毁
|
|
2110
|
-
}}}if(deleteCount>0)this.ChartPaintEx=paint;}};this.ClearCurrnetDrawPicture=function(){this.CurrentChartDrawPicture=null;};this.CreateDragSelectRect=function(option){var chart=g_ExtendChartPaintFactory.Create("RectDragPaint",option);if(!chart)return null;if(option&&option.Enable===true)chart.Enable=true;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ChartDragSelectRect=chart;};this.ClearDragSelectRect=function(){if(!this.ChartDragSelectRect)return;this.ChartDragSelectRect.ClearPoint();};this.ShowDragSelectRect=function(ptStart,ptEnd){if(!this.ChartDragSelectRect)return;this.ChartDragSelectRect.SetFirstPoint(ptStart.X,ptStart.Y);this.ChartDragSelectRect.SetSecondPoint(ptEnd.X,ptEnd.Y);this.ChartDragSelectRect.Draw();}
|
|
2111
|
+
}}}if(deleteCount>0)this.ChartPaintEx=paint;}};this.ClearCurrnetDrawPicture=function(){this.CurrentChartDrawPicture=null;};this.CreateDragSelectRect=function(option){var chart=g_ExtendChartPaintFactory.Create("RectDragPaint",option);if(!chart)return null;if(option&&option.Enable===true)chart.Enable=true;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.SetOption(option);this.ChartDragSelectRect=chart;};this.ClearDragSelectRect=function(){if(!this.ChartDragSelectRect)return;this.ChartDragSelectRect.ClearPoint();};this.ShowDragSelectRect=function(ptStart,ptEnd){if(!this.ChartDragSelectRect)return;this.ChartDragSelectRect.SetFirstPoint(ptStart.X,ptStart.Y);this.ChartDragSelectRect.SetSecondPoint(ptEnd.X,ptEnd.Y);this.ChartDragSelectRect.Draw();};//切换窗口指标 option={ Window:{}, OverlayIndex:[], Frame:{ }}
|
|
2112
|
+
this.ChangeIndexWindow=function(windowIndex,option){JSConsole.Chart.Log('[KLineChartContainer::ChangeIndexWindow] windowIndex, option',windowIndex,option);if(windowIndex<0||windowIndex>=this.Frame.SubFrame.length)return false;if(!option)return false;var frame=this.Frame.SubFrame[windowIndex];if(option.Delete){var item=option.Delete;if(item.Window===true)this.DeleteIndexPaint(windowIndex);//删除主指标
|
|
2113
|
+
if(item.Overlay===true)this.DeleteWindowsOverlayIndex(windowIndex);//清空叠加指标
|
|
2114
|
+
}//清空标题栏
|
|
2115
|
+
var titleIndex=windowIndex+1;this.TitlePaint[titleIndex].Data=[];this.TitlePaint[titleIndex].Title=null;if(option.Window)//主指标
|
|
2116
|
+
{this.DeleteIndexPaint(windowIndex);//删除主指标
|
|
2117
|
+
var item=option.Window;if(item.Script)//自定义指标脚本
|
|
2118
|
+
{this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
|
|
2119
|
+
}else if(item.API)//后台指标
|
|
2120
|
+
{var apiItem=item.API;this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexID=item.Index;var indexItem=JSIndexMap.Get(indexID);if(indexItem){this.WindowIndex[windowIndex]=indexItem.Create();this.CreateWindowIndex(windowIndex);}else{var systemScript=new JSIndexScript();var indexInfo=systemScript.Get(indexID);if(indexInfo){JSIndexScript.ModifyAttribute(indexInfo,item);this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo);//脚本执行
|
|
2121
|
+
}}}this.SetSubFrameAttribute(frame,item,option.Frame);}//叠加指标
|
|
2122
|
+
var aryOverlayIndex=[];if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){this.DeleteWindowsOverlayIndex(windowIndex);//清空叠加指标
|
|
2123
|
+
for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Index)item.IndexName=item.Index;item.WindowIndex=windowIndex;if(item.Windows>=0)item.WindowIndex=item.Windows;var overlay=this.CreateOverlayWindowsIndex(item);if(!overlay)continue;aryOverlayIndex.push({WindowsIndex:item.WindowIndex,Overlay:overlay});}}//刷新指标
|
|
2124
|
+
var bindData=this.ChartPaint[0].Data;this.BindIndexData(windowIndex,bindData);//请求主指标
|
|
2125
|
+
for(var i=0;i<aryOverlayIndex.length;++i)//请求叠加指标
|
|
2126
|
+
{var item=aryOverlayIndex[i];this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);}this.UpdataDataoffset();//更新数据偏移
|
|
2127
|
+
this.ResetFrameXYSplit();this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
2128
|
+
this.Draw();};}function GetDevicePixelRatio(){if(typeof window=='undefined')return 1;return window.devicePixelRatio||1;}function GetFontHeight(context,font,word){if(!context)return null;if(font)context.font=font;var text='擎';if(IFrameSplitOperator.IsString(word))text=word;var fontInfo=context.measureText(text);var textHeight=fontInfo.fontBoundingBoxAscent+fontInfo.fontBoundingBoxDescent;if(!IFrameSplitOperator.IsNumber(textHeight))textHeight=fontInfo.width+2*GetDevicePixelRatio();return textHeight;}function IsPhoneWeb(){var userAgentInfo=navigator.userAgent;var Agents=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod");for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0)return true;}return false;}function OnKeyDown(e)//键盘事件
|
|
2111
2129
|
{if(this.JSChartContainer&&this.JSChartContainer.OnKeyDown)this.JSChartContainer.OnKeyDown(e);}function OnWheel(e)//上下滚动事件
|
|
2112
2130
|
{if(this.JSChartContainer&&this.JSChartContainer.OnWheel)this.JSChartContainer.OnWheel(e);}function ToFixed(number,precision){var b=1;if(isNaN(number))return number;if(number<0)b=-1;var multiplier=Math.pow(10,precision);var value=Math.round(Math.abs(number)*multiplier)/multiplier*b;if(/^(\d+(?:\.\d+)?)(e)([\-]?\d+)$/.test(value))var s=value.toFixed2(precision);else var s=value.toString();var rs=s.indexOf('.');if(rs<0&&precision>0){rs=s.length;s+='.';}while(s.length<=rs+precision){s+='0';}return s;}Number.prototype.toFixed2=Number.prototype.toFixed;//备份下老的
|
|
2113
2131
|
Number.prototype.toFixed=function(precision){return ToFixed(this,precision);};function Guid(){function S4(){return((1+Math.random())*0x10000|0).toString(16).substring(1);}return"guid"+(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());}function GetScrollPosition(){var scrollPos={};var scrollTop=0;var scrollLeft=0;if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollLeft)){scrollTop=document.documentElement.scrollTop;scrollLeft=document.documentElement.scrollLeft;}else if(document.body){scrollTop=document.body.scrollTop;scrollLeft=document.body.scrollLeft;}scrollPos.Top=scrollTop;scrollPos.Left=scrollLeft;return scrollPos;}//修正线段有毛刺
|
|
@@ -9444,7 +9462,7 @@ function FuturesTimeData(){this.TIME_SPLIT=[//ID=0 9:00-10:15,10:31-11:30,13:31-
|
|
|
9444
9462
|
[MARKET_SUFFIX_NAME.DCE+'-JD',{Time:0,Decimal:0,Name:"鸡蛋"}],[MARKET_SUFFIX_NAME.DCE+'-FB',{Time:0,Decimal:2,Name:"纤板"}],[MARKET_SUFFIX_NAME.DCE+'-BB',{Time:0,Decimal:2,Name:"胶板"}],[MARKET_SUFFIX_NAME.DCE+'-PP',{Time:6,Decimal:0,Name:"丙烯"}],[MARKET_SUFFIX_NAME.DCE+'-JM',{Time:6,Decimal:1,Name:'焦煤'}],[MARKET_SUFFIX_NAME.DCE+'-EG',{Time:6,Decimal:0,Name:'乙二醇'}],[MARKET_SUFFIX_NAME.DCE+'-EB',{Time:6,Decimal:0,Name:'苯乙烯'}],[MARKET_SUFFIX_NAME.DCE+'-CS',{Time:6,Decimal:0,Name:'淀粉'}],[MARKET_SUFFIX_NAME.DCE+'-PG',{Time:6,Decimal:0,Name:'液化气'}],[MARKET_SUFFIX_NAME.DCE+'-RR',{Time:6,Decimal:0,Name:'梗米'}],[MARKET_SUFFIX_NAME.DCE+'-LH',{Time:0,Decimal:0,Name:'生猪'}],//上期所
|
|
9445
9463
|
[MARKET_SUFFIX_NAME.SHFE+'-CU',{Time:4,Decimal:0,Name:"铜"}],[MARKET_SUFFIX_NAME.SHFE+'-AL',{Time:4,Decimal:0,Name:"铝"}],[MARKET_SUFFIX_NAME.SHFE+'-NI',{Time:4,Decimal:0,Name:"镍"}],[MARKET_SUFFIX_NAME.SHFE+'-SN',{Time:4,Decimal:0,Name:'沪锡'}],[MARKET_SUFFIX_NAME.SHFE+'-ZN',{Time:4,Decimal:0,Name:"沪锌"}],[MARKET_SUFFIX_NAME.SHFE+'-PB',{Time:4,Decimal:0,Name:'沪铅'}],[MARKET_SUFFIX_NAME.SHFE+'-RU',{Time:6,Decimal:0,Name:"天然橡胶"}],[MARKET_SUFFIX_NAME.SHFE+'-FU',{Time:6,Decimal:0,Name:"燃料油"}],[MARKET_SUFFIX_NAME.SHFE+'-RB',{Time:6,Decimal:0,Name:"螺纹钢"}],[MARKET_SUFFIX_NAME.SHFE+'-BU',{Time:6,Decimal:0,Name:'石油沥青'}],[MARKET_SUFFIX_NAME.SHFE+'-HC',{Time:6,Decimal:0,Name:"热轧卷板"}],[MARKET_SUFFIX_NAME.SHFE+'-SP',{Time:6,Decimal:0,Name:"纸浆"}],[MARKET_SUFFIX_NAME.SHFE+'-WR',{Time:0,Decimal:0,Name:"线材"}],[MARKET_SUFFIX_NAME.SHFE+'-AG',{Time:5,Decimal:0,Name:"白银"}],[MARKET_SUFFIX_NAME.SHFE+'-AU',{Time:5,Decimal:2,Name:"黄金"}],[MARKET_SUFFIX_NAME.SHFE+'-SS',{Time:4,Decimal:0,Name:'不锈钢'}],[MARKET_SUFFIX_NAME.SHFE+'-AO',{Time:4,Decimal:0,Name:'氧化铝'}],[MARKET_SUFFIX_NAME.SHFE+'-BR',{Time:6,Decimal:0,Name:'合成橡胶'}],//上期所-能源
|
|
9446
9464
|
[MARKET_SUFFIX_NAME.SHFE+'-NR',{Time:6,Decimal:1,Name:'20号胶'}],[MARKET_SUFFIX_NAME.SHFE+'-SC',{Time:5,Decimal:1,Name:'原油'}],[MARKET_SUFFIX_NAME.SHFE+'-LU',{Time:6,Decimal:0,Name:'低硫燃油'}],[MARKET_SUFFIX_NAME.SHFE+'-BC',{Time:4,Decimal:0,Name:'国际铜'}],[MARKET_SUFFIX_NAME.SHFE+'-EC',{Time:0,Decimal:0,Name:'集运指数'}],//郑州期货交易所
|
|
9447
|
-
[MARKET_SUFFIX_NAME.CZCE+'-CF',{Time:6,Decimal:0,Name:"棉花"}],[MARKET_SUFFIX_NAME.CZCE+'-SR',{Time:6,Decimal:0,Name:"白糖"}],[MARKET_SUFFIX_NAME.CZCE+'-MA',{Time:6,Decimal:0,Name:"甲醇"}],[MARKET_SUFFIX_NAME.CZCE+'-ZC',{Time:6,Decimal:1,Name:'动力煤'}],[MARKET_SUFFIX_NAME.CZCE+'-TA',{Time:6,Decimal:0,Name:"精对苯二甲酸(PTA)"}],[MARKET_SUFFIX_NAME.CZCE+'-RM',{Time:6,Decimal:0,Name:'菜籽粕'}],[MARKET_SUFFIX_NAME.CZCE+'-OI',{Time:6,Decimal:0,Name:"菜籽油"}],[MARKET_SUFFIX_NAME.CZCE+'-ME',{Time:3,Decimal:0,Name:"甲醇(老)"}],[MARKET_SUFFIX_NAME.CZCE+'-FG',{Time:6,Decimal:0,Name:'平板玻璃'}],[MARKET_SUFFIX_NAME.CZCE+'-WS',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-WT',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-GN',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RO',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RS',{Time:0,Decimal:0,Name:"菜籽"}],[MARKET_SUFFIX_NAME.CZCE+'-ER',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RI',{Time:0,Decimal:0,Name:"早籼稻"}],[MARKET_SUFFIX_NAME.CZCE+'-WH',{Time:0,Decimal:0,Name:"强麦"}],[MARKET_SUFFIX_NAME.CZCE+'-AP',{Time:0,Decimal:0,Name:"苹果"}],[MARKET_SUFFIX_NAME.CZCE+'-PM',{Time:0,Decimal:0,Name:"普麦"}],[MARKET_SUFFIX_NAME.CZCE+'-QM',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-TC',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-JR',{Time:0,Decimal:0,Name:"粳稻"}],[MARKET_SUFFIX_NAME.CZCE+'-LR',{Time:0,Decimal:0,Name:"晚籼稻"}],[MARKET_SUFFIX_NAME.CZCE+'-SF',{Time:0,Decimal:0,Name:"硅铁"}],[MARKET_SUFFIX_NAME.CZCE+'-SM',{Time:0,Decimal:0,Name:"锰硅"}],[MARKET_SUFFIX_NAME.CZCE+'-CJ',{Time:0,Decimal:2,Name:"红枣"}],[MARKET_SUFFIX_NAME.CZCE+'-CY',{Time:6,Decimal:0,Name:"棉纱"}],[MARKET_SUFFIX_NAME.CZCE+'-UR',{Time:0,Decimal:0,Name:"尿素"}],[MARKET_SUFFIX_NAME.CZCE+'-SA',{Time:6,Decimal:0,Name:"纯碱"}],[MARKET_SUFFIX_NAME.CZCE+'-PF',{Time:6,Decimal:0,Name:"短纤"}],[MARKET_SUFFIX_NAME.CZCE+'-PK',{Time:0,Decimal:0,Name:"花生"}],//中期所
|
|
9465
|
+
[MARKET_SUFFIX_NAME.CZCE+'-CF',{Time:6,Decimal:0,Name:"棉花"}],[MARKET_SUFFIX_NAME.CZCE+'-SR',{Time:6,Decimal:0,Name:"白糖"}],[MARKET_SUFFIX_NAME.CZCE+'-MA',{Time:6,Decimal:0,Name:"甲醇"}],[MARKET_SUFFIX_NAME.CZCE+'-ZC',{Time:6,Decimal:1,Name:'动力煤'}],[MARKET_SUFFIX_NAME.CZCE+'-TA',{Time:6,Decimal:0,Name:"精对苯二甲酸(PTA)"}],[MARKET_SUFFIX_NAME.CZCE+'-RM',{Time:6,Decimal:0,Name:'菜籽粕'}],[MARKET_SUFFIX_NAME.CZCE+'-OI',{Time:6,Decimal:0,Name:"菜籽油"}],[MARKET_SUFFIX_NAME.CZCE+'-ME',{Time:3,Decimal:0,Name:"甲醇(老)"}],[MARKET_SUFFIX_NAME.CZCE+'-FG',{Time:6,Decimal:0,Name:'平板玻璃'}],[MARKET_SUFFIX_NAME.CZCE+'-WS',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-WT',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-GN',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RO',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RS',{Time:0,Decimal:0,Name:"菜籽"}],[MARKET_SUFFIX_NAME.CZCE+'-ER',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-RI',{Time:0,Decimal:0,Name:"早籼稻"}],[MARKET_SUFFIX_NAME.CZCE+'-WH',{Time:0,Decimal:0,Name:"强麦"}],[MARKET_SUFFIX_NAME.CZCE+'-AP',{Time:0,Decimal:0,Name:"苹果"}],[MARKET_SUFFIX_NAME.CZCE+'-PM',{Time:0,Decimal:0,Name:"普麦"}],[MARKET_SUFFIX_NAME.CZCE+'-QM',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-TC',{Time:0,Decimal:0}],[MARKET_SUFFIX_NAME.CZCE+'-JR',{Time:0,Decimal:0,Name:"粳稻"}],[MARKET_SUFFIX_NAME.CZCE+'-LR',{Time:0,Decimal:0,Name:"晚籼稻"}],[MARKET_SUFFIX_NAME.CZCE+'-SF',{Time:0,Decimal:0,Name:"硅铁"}],[MARKET_SUFFIX_NAME.CZCE+'-SM',{Time:0,Decimal:0,Name:"锰硅"}],[MARKET_SUFFIX_NAME.CZCE+'-CJ',{Time:0,Decimal:2,Name:"红枣"}],[MARKET_SUFFIX_NAME.CZCE+'-CY',{Time:6,Decimal:0,Name:"棉纱"}],[MARKET_SUFFIX_NAME.CZCE+'-UR',{Time:0,Decimal:0,Name:"尿素"}],[MARKET_SUFFIX_NAME.CZCE+'-SA',{Time:6,Decimal:0,Name:"纯碱"}],[MARKET_SUFFIX_NAME.CZCE+'-PF',{Time:6,Decimal:0,Name:"短纤"}],[MARKET_SUFFIX_NAME.CZCE+'-PK',{Time:0,Decimal:0,Name:"花生"}],[MARKET_SUFFIX_NAME.CZCE+'-PR',{Time:6,Decimal:0,Name:"瓶片"}],//中期所
|
|
9448
9466
|
[MARKET_SUFFIX_NAME.CFFEX+'-TF',{Time:1,Decimal:3,Name:"二债"}],[MARKET_SUFFIX_NAME.CFFEX+'-TS',{Time:1,Decimal:3,Name:"五债"}],[MARKET_SUFFIX_NAME.CFFEX+'-IH',{Time:2,Decimal:1,Name:'上证股指期货'}],[MARKET_SUFFIX_NAME.CFFEX+'-IC',{Time:2,Decimal:1,Name:'中证股指期货'}],[MARKET_SUFFIX_NAME.CFFEX+'-IF',{Time:2,Decimal:1,Name:'沪深股指期货'}],[MARKET_SUFFIX_NAME.CFFEX+'-IM',{Time:2,Decimal:1,Name:'中证1000股指期货'}],[MARKET_SUFFIX_NAME.CFFEX+'-IO',{Time:2,Decimal:1,Name:'沪深300股指期权'}],[MARKET_SUFFIX_NAME.CFFEX+'-MO',{Time:2,Decimal:1,Name:'中证1000股指期权'}],[MARKET_SUFFIX_NAME.CFFEX+'-HO',{Time:2,Decimal:1,Name:'上证50股指期权'}],//广州期货交易所
|
|
9449
9467
|
[MARKET_SUFFIX_NAME.GZFE+'-SI',{Time:0,Decimal:2,Name:"工业硅"}],[MARKET_SUFFIX_NAME.GZFE+'-LC',{Time:0,Decimal:2,Name:"碳酸锂"}]]);this.MAP_ONEWORD=new _map2.default([//大连商品交易所
|
|
9450
9468
|
[MARKET_SUFFIX_NAME.DCE+'-C',{Time:6,Decimal:0,Name:"玉米"}],[MARKET_SUFFIX_NAME.DCE+'-L',{Time:6,Decimal:0,Name:"乙烯"}],[MARKET_SUFFIX_NAME.DCE+'-V',{Time:6,Decimal:0,Name:"PVC"}],[MARKET_SUFFIX_NAME.DCE+'-A',{Time:6,Decimal:0,Name:"豆一"}],[MARKET_SUFFIX_NAME.DCE+'-B',{Time:6,Decimal:0,Name:"豆二"}],[MARKET_SUFFIX_NAME.DCE+'-M',{Time:6,Decimal:0,Name:"豆粕"}],[MARKET_SUFFIX_NAME.DCE+'-Y',{Time:6,Decimal:0,Name:"豆油"}],[MARKET_SUFFIX_NAME.DCE+'-P',{Time:6,Decimal:0,Name:"棕榈"}],[MARKET_SUFFIX_NAME.DCE+'-J',{Time:6,Decimal:1,Name:'焦炭'}],[MARKET_SUFFIX_NAME.DCE+'-I',{Time:6,Decimal:1,Name:"铁矿"}],//中期所
|
|
@@ -13772,7 +13790,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13772
13790
|
this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
13773
13791
|
* 版本信息输出
|
|
13774
13792
|
*
|
|
13775
|
-
*/var HQCHART_VERSION="1.1.
|
|
13793
|
+
*/var HQCHART_VERSION="1.1.13792";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
13776
13794
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13777
13795
|
// BaseIndex:BaseIndex,
|
|
13778
13796
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -1789,6 +1789,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
1789
1789
|
this.JSChartContainer.ChangeIndex(windowIndex,indexName,option);
|
|
1790
1790
|
}
|
|
1791
1791
|
|
|
1792
|
+
//切换一个窗口指标,包含叠加指标,以及这个窗口的属性
|
|
1793
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
1794
|
+
{
|
|
1795
|
+
if (this.JSChartContainer && typeof(this.JSChartContainer.ChangeIndexWindow)=='function')
|
|
1796
|
+
this.JSChartContainer.ChangeIndexWindow(windowIndex, option);
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1792
1799
|
this.AddIndexWindow=function(indexName,option)
|
|
1793
1800
|
{
|
|
1794
1801
|
if (this.JSChartContainer && typeof(this.JSChartContainer.AddIndexWindow)=='function')
|
|
@@ -9796,6 +9803,101 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9796
9803
|
this.ChartDragSelectRect.SetSecondPoint(ptEnd.X, ptEnd.Y);
|
|
9797
9804
|
this.ChartDragSelectRect.Draw();
|
|
9798
9805
|
}
|
|
9806
|
+
|
|
9807
|
+
//切换窗口指标 option={ Window:{}, OverlayIndex:[], Frame:{ }}
|
|
9808
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
9809
|
+
{
|
|
9810
|
+
JSConsole.Chart.Log('[KLineChartContainer::ChangeIndexWindow] windowIndex, option', windowIndex, option);
|
|
9811
|
+
if (windowIndex<0 || windowIndex>=this.Frame.SubFrame.length) return false;
|
|
9812
|
+
if (!option) return false;
|
|
9813
|
+
|
|
9814
|
+
var frame=this.Frame.SubFrame[windowIndex];
|
|
9815
|
+
if (option.Delete)
|
|
9816
|
+
{
|
|
9817
|
+
var item=option.Delete;
|
|
9818
|
+
if (item.Window===true) this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
9819
|
+
if (item.Overlay===true) this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
9820
|
+
}
|
|
9821
|
+
|
|
9822
|
+
//清空标题栏
|
|
9823
|
+
var titleIndex=windowIndex+1;
|
|
9824
|
+
this.TitlePaint[titleIndex].Data=[];
|
|
9825
|
+
this.TitlePaint[titleIndex].Title=null;
|
|
9826
|
+
|
|
9827
|
+
if (option.Window) //主指标
|
|
9828
|
+
{
|
|
9829
|
+
this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
9830
|
+
|
|
9831
|
+
var item=option.Window;
|
|
9832
|
+
|
|
9833
|
+
if (item.Script) //自定义指标脚本
|
|
9834
|
+
{
|
|
9835
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
|
|
9836
|
+
}
|
|
9837
|
+
else if (item.API) //后台指标
|
|
9838
|
+
{
|
|
9839
|
+
var apiItem=item.API;
|
|
9840
|
+
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);
|
|
9841
|
+
}
|
|
9842
|
+
else
|
|
9843
|
+
{
|
|
9844
|
+
var indexID=item.Index;
|
|
9845
|
+
var indexItem=JSIndexMap.Get(indexID);
|
|
9846
|
+
if (indexItem)
|
|
9847
|
+
{
|
|
9848
|
+
this.WindowIndex[windowIndex]=indexItem.Create();
|
|
9849
|
+
this.CreateWindowIndex(windowIndex);
|
|
9850
|
+
}
|
|
9851
|
+
else
|
|
9852
|
+
{
|
|
9853
|
+
var systemScript = new JSIndexScript();
|
|
9854
|
+
var indexInfo = systemScript.Get(indexID);
|
|
9855
|
+
if (indexInfo)
|
|
9856
|
+
{
|
|
9857
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
9858
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
9859
|
+
}
|
|
9860
|
+
}
|
|
9861
|
+
}
|
|
9862
|
+
|
|
9863
|
+
this.SetSubFrameAttribute(frame, item, option.Frame);
|
|
9864
|
+
}
|
|
9865
|
+
|
|
9866
|
+
//叠加指标
|
|
9867
|
+
var aryOverlayIndex=[];
|
|
9868
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
|
|
9869
|
+
{
|
|
9870
|
+
this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
9871
|
+
|
|
9872
|
+
for(var i=0;i<option.OverlayIndex.length;++i)
|
|
9873
|
+
{
|
|
9874
|
+
var item=option.OverlayIndex[i];
|
|
9875
|
+
if (item.Index) item.IndexName=item.Index;
|
|
9876
|
+
item.WindowIndex=windowIndex;
|
|
9877
|
+
if (item.Windows>=0) item.WindowIndex=item.Windows;
|
|
9878
|
+
|
|
9879
|
+
var overlay=this.CreateOverlayWindowsIndex(item);
|
|
9880
|
+
if (!overlay) continue;
|
|
9881
|
+
|
|
9882
|
+
aryOverlayIndex.push({ WindowsIndex:item.WindowIndex, Overlay:overlay });
|
|
9883
|
+
}
|
|
9884
|
+
}
|
|
9885
|
+
|
|
9886
|
+
//刷新指标
|
|
9887
|
+
var bindData=this.ChartPaint[0].Data;
|
|
9888
|
+
this.BindIndexData(windowIndex,bindData); //请求主指标
|
|
9889
|
+
|
|
9890
|
+
for(var i=0;i<aryOverlayIndex.length;++i) //请求叠加指标
|
|
9891
|
+
{
|
|
9892
|
+
var item=aryOverlayIndex[i];
|
|
9893
|
+
this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);
|
|
9894
|
+
}
|
|
9895
|
+
|
|
9896
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
9897
|
+
this.ResetFrameXYSplit();
|
|
9898
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
9899
|
+
this.Draw();
|
|
9900
|
+
}
|
|
9799
9901
|
}
|
|
9800
9902
|
|
|
9801
9903
|
function GetDevicePixelRatio()
|
|
@@ -93097,6 +93199,7 @@ function FuturesTimeData()
|
|
|
93097
93199
|
[MARKET_SUFFIX_NAME.CZCE + '-SA', {Time:6,Decimal:0, Name:"纯碱"}],
|
|
93098
93200
|
[MARKET_SUFFIX_NAME.CZCE + '-PF', {Time:6,Decimal:0, Name:"短纤"}],
|
|
93099
93201
|
[MARKET_SUFFIX_NAME.CZCE + '-PK', {Time:0,Decimal:0, Name:"花生"}],
|
|
93202
|
+
[MARKET_SUFFIX_NAME.CZCE + '-PR', {Time:6,Decimal:0, Name:"瓶片"}],
|
|
93100
93203
|
|
|
93101
93204
|
|
|
93102
93205
|
//中期所
|
|
@@ -5714,6 +5714,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5714
5714
|
this.JSChartContainer.ChangeIndex(windowIndex,indexName,option);
|
|
5715
5715
|
}
|
|
5716
5716
|
|
|
5717
|
+
//切换一个窗口指标,包含叠加指标,以及这个窗口的属性
|
|
5718
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
5719
|
+
{
|
|
5720
|
+
if (this.JSChartContainer && typeof(this.JSChartContainer.ChangeIndexWindow)=='function')
|
|
5721
|
+
this.JSChartContainer.ChangeIndexWindow(windowIndex, option);
|
|
5722
|
+
}
|
|
5723
|
+
|
|
5717
5724
|
this.AddIndexWindow=function(indexName,option)
|
|
5718
5725
|
{
|
|
5719
5726
|
if (this.JSChartContainer && typeof(this.JSChartContainer.AddIndexWindow)=='function')
|
|
@@ -13721,6 +13728,101 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13721
13728
|
this.ChartDragSelectRect.SetSecondPoint(ptEnd.X, ptEnd.Y);
|
|
13722
13729
|
this.ChartDragSelectRect.Draw();
|
|
13723
13730
|
}
|
|
13731
|
+
|
|
13732
|
+
//切换窗口指标 option={ Window:{}, OverlayIndex:[], Frame:{ }}
|
|
13733
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
13734
|
+
{
|
|
13735
|
+
JSConsole.Chart.Log('[KLineChartContainer::ChangeIndexWindow] windowIndex, option', windowIndex, option);
|
|
13736
|
+
if (windowIndex<0 || windowIndex>=this.Frame.SubFrame.length) return false;
|
|
13737
|
+
if (!option) return false;
|
|
13738
|
+
|
|
13739
|
+
var frame=this.Frame.SubFrame[windowIndex];
|
|
13740
|
+
if (option.Delete)
|
|
13741
|
+
{
|
|
13742
|
+
var item=option.Delete;
|
|
13743
|
+
if (item.Window===true) this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
13744
|
+
if (item.Overlay===true) this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
13745
|
+
}
|
|
13746
|
+
|
|
13747
|
+
//清空标题栏
|
|
13748
|
+
var titleIndex=windowIndex+1;
|
|
13749
|
+
this.TitlePaint[titleIndex].Data=[];
|
|
13750
|
+
this.TitlePaint[titleIndex].Title=null;
|
|
13751
|
+
|
|
13752
|
+
if (option.Window) //主指标
|
|
13753
|
+
{
|
|
13754
|
+
this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
13755
|
+
|
|
13756
|
+
var item=option.Window;
|
|
13757
|
+
|
|
13758
|
+
if (item.Script) //自定义指标脚本
|
|
13759
|
+
{
|
|
13760
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
|
|
13761
|
+
}
|
|
13762
|
+
else if (item.API) //后台指标
|
|
13763
|
+
{
|
|
13764
|
+
var apiItem=item.API;
|
|
13765
|
+
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);
|
|
13766
|
+
}
|
|
13767
|
+
else
|
|
13768
|
+
{
|
|
13769
|
+
var indexID=item.Index;
|
|
13770
|
+
var indexItem=JSIndexMap.Get(indexID);
|
|
13771
|
+
if (indexItem)
|
|
13772
|
+
{
|
|
13773
|
+
this.WindowIndex[windowIndex]=indexItem.Create();
|
|
13774
|
+
this.CreateWindowIndex(windowIndex);
|
|
13775
|
+
}
|
|
13776
|
+
else
|
|
13777
|
+
{
|
|
13778
|
+
var systemScript = new JSIndexScript();
|
|
13779
|
+
var indexInfo = systemScript.Get(indexID);
|
|
13780
|
+
if (indexInfo)
|
|
13781
|
+
{
|
|
13782
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
13783
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
13784
|
+
}
|
|
13785
|
+
}
|
|
13786
|
+
}
|
|
13787
|
+
|
|
13788
|
+
this.SetSubFrameAttribute(frame, item, option.Frame);
|
|
13789
|
+
}
|
|
13790
|
+
|
|
13791
|
+
//叠加指标
|
|
13792
|
+
var aryOverlayIndex=[];
|
|
13793
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
|
|
13794
|
+
{
|
|
13795
|
+
this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
13796
|
+
|
|
13797
|
+
for(var i=0;i<option.OverlayIndex.length;++i)
|
|
13798
|
+
{
|
|
13799
|
+
var item=option.OverlayIndex[i];
|
|
13800
|
+
if (item.Index) item.IndexName=item.Index;
|
|
13801
|
+
item.WindowIndex=windowIndex;
|
|
13802
|
+
if (item.Windows>=0) item.WindowIndex=item.Windows;
|
|
13803
|
+
|
|
13804
|
+
var overlay=this.CreateOverlayWindowsIndex(item);
|
|
13805
|
+
if (!overlay) continue;
|
|
13806
|
+
|
|
13807
|
+
aryOverlayIndex.push({ WindowsIndex:item.WindowIndex, Overlay:overlay });
|
|
13808
|
+
}
|
|
13809
|
+
}
|
|
13810
|
+
|
|
13811
|
+
//刷新指标
|
|
13812
|
+
var bindData=this.ChartPaint[0].Data;
|
|
13813
|
+
this.BindIndexData(windowIndex,bindData); //请求主指标
|
|
13814
|
+
|
|
13815
|
+
for(var i=0;i<aryOverlayIndex.length;++i) //请求叠加指标
|
|
13816
|
+
{
|
|
13817
|
+
var item=aryOverlayIndex[i];
|
|
13818
|
+
this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);
|
|
13819
|
+
}
|
|
13820
|
+
|
|
13821
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
13822
|
+
this.ResetFrameXYSplit();
|
|
13823
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
13824
|
+
this.Draw();
|
|
13825
|
+
}
|
|
13724
13826
|
}
|
|
13725
13827
|
|
|
13726
13828
|
function GetDevicePixelRatio()
|
|
@@ -97022,6 +97124,7 @@ function FuturesTimeData()
|
|
|
97022
97124
|
[MARKET_SUFFIX_NAME.CZCE + '-SA', {Time:6,Decimal:0, Name:"纯碱"}],
|
|
97023
97125
|
[MARKET_SUFFIX_NAME.CZCE + '-PF', {Time:6,Decimal:0, Name:"短纤"}],
|
|
97024
97126
|
[MARKET_SUFFIX_NAME.CZCE + '-PK', {Time:0,Decimal:0, Name:"花生"}],
|
|
97127
|
+
[MARKET_SUFFIX_NAME.CZCE + '-PR', {Time:6,Decimal:0, Name:"瓶片"}],
|
|
97025
97128
|
|
|
97026
97129
|
|
|
97027
97130
|
//中期所
|
|
@@ -138706,7 +138809,7 @@ function ScrollBarBGChart()
|
|
|
138706
138809
|
|
|
138707
138810
|
|
|
138708
138811
|
|
|
138709
|
-
var HQCHART_VERSION="1.1.
|
|
138812
|
+
var HQCHART_VERSION="1.1.13792";
|
|
138710
138813
|
|
|
138711
138814
|
function PrintHQChartVersion()
|
|
138712
138815
|
{
|
|
@@ -5758,6 +5758,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5758
5758
|
this.JSChartContainer.ChangeIndex(windowIndex,indexName,option);
|
|
5759
5759
|
}
|
|
5760
5760
|
|
|
5761
|
+
//切换一个窗口指标,包含叠加指标,以及这个窗口的属性
|
|
5762
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
5763
|
+
{
|
|
5764
|
+
if (this.JSChartContainer && typeof(this.JSChartContainer.ChangeIndexWindow)=='function')
|
|
5765
|
+
this.JSChartContainer.ChangeIndexWindow(windowIndex, option);
|
|
5766
|
+
}
|
|
5767
|
+
|
|
5761
5768
|
this.AddIndexWindow=function(indexName,option)
|
|
5762
5769
|
{
|
|
5763
5770
|
if (this.JSChartContainer && typeof(this.JSChartContainer.AddIndexWindow)=='function')
|
|
@@ -13765,6 +13772,101 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13765
13772
|
this.ChartDragSelectRect.SetSecondPoint(ptEnd.X, ptEnd.Y);
|
|
13766
13773
|
this.ChartDragSelectRect.Draw();
|
|
13767
13774
|
}
|
|
13775
|
+
|
|
13776
|
+
//切换窗口指标 option={ Window:{}, OverlayIndex:[], Frame:{ }}
|
|
13777
|
+
this.ChangeIndexWindow=function(windowIndex, option)
|
|
13778
|
+
{
|
|
13779
|
+
JSConsole.Chart.Log('[KLineChartContainer::ChangeIndexWindow] windowIndex, option', windowIndex, option);
|
|
13780
|
+
if (windowIndex<0 || windowIndex>=this.Frame.SubFrame.length) return false;
|
|
13781
|
+
if (!option) return false;
|
|
13782
|
+
|
|
13783
|
+
var frame=this.Frame.SubFrame[windowIndex];
|
|
13784
|
+
if (option.Delete)
|
|
13785
|
+
{
|
|
13786
|
+
var item=option.Delete;
|
|
13787
|
+
if (item.Window===true) this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
13788
|
+
if (item.Overlay===true) this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
13789
|
+
}
|
|
13790
|
+
|
|
13791
|
+
//清空标题栏
|
|
13792
|
+
var titleIndex=windowIndex+1;
|
|
13793
|
+
this.TitlePaint[titleIndex].Data=[];
|
|
13794
|
+
this.TitlePaint[titleIndex].Title=null;
|
|
13795
|
+
|
|
13796
|
+
if (option.Window) //主指标
|
|
13797
|
+
{
|
|
13798
|
+
this.DeleteIndexPaint(windowIndex); //删除主指标
|
|
13799
|
+
|
|
13800
|
+
var item=option.Window;
|
|
13801
|
+
|
|
13802
|
+
if (item.Script) //自定义指标脚本
|
|
13803
|
+
{
|
|
13804
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(item.Name,item.Script,item.Args,item); //脚本执行
|
|
13805
|
+
}
|
|
13806
|
+
else if (item.API) //后台指标
|
|
13807
|
+
{
|
|
13808
|
+
var apiItem=item.API;
|
|
13809
|
+
this.WindowIndex[windowIndex]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);
|
|
13810
|
+
}
|
|
13811
|
+
else
|
|
13812
|
+
{
|
|
13813
|
+
var indexID=item.Index;
|
|
13814
|
+
var indexItem=JSIndexMap.Get(indexID);
|
|
13815
|
+
if (indexItem)
|
|
13816
|
+
{
|
|
13817
|
+
this.WindowIndex[windowIndex]=indexItem.Create();
|
|
13818
|
+
this.CreateWindowIndex(windowIndex);
|
|
13819
|
+
}
|
|
13820
|
+
else
|
|
13821
|
+
{
|
|
13822
|
+
var systemScript = new JSIndexScript();
|
|
13823
|
+
var indexInfo = systemScript.Get(indexID);
|
|
13824
|
+
if (indexInfo)
|
|
13825
|
+
{
|
|
13826
|
+
JSIndexScript.ModifyAttribute(indexInfo,item);
|
|
13827
|
+
this.WindowIndex[windowIndex]=new ScriptIndex(indexInfo.Name,indexInfo.Script,indexInfo.Args,indexInfo); //脚本执行
|
|
13828
|
+
}
|
|
13829
|
+
}
|
|
13830
|
+
}
|
|
13831
|
+
|
|
13832
|
+
this.SetSubFrameAttribute(frame, item, option.Frame);
|
|
13833
|
+
}
|
|
13834
|
+
|
|
13835
|
+
//叠加指标
|
|
13836
|
+
var aryOverlayIndex=[];
|
|
13837
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex))
|
|
13838
|
+
{
|
|
13839
|
+
this.DeleteWindowsOverlayIndex(windowIndex); //清空叠加指标
|
|
13840
|
+
|
|
13841
|
+
for(var i=0;i<option.OverlayIndex.length;++i)
|
|
13842
|
+
{
|
|
13843
|
+
var item=option.OverlayIndex[i];
|
|
13844
|
+
if (item.Index) item.IndexName=item.Index;
|
|
13845
|
+
item.WindowIndex=windowIndex;
|
|
13846
|
+
if (item.Windows>=0) item.WindowIndex=item.Windows;
|
|
13847
|
+
|
|
13848
|
+
var overlay=this.CreateOverlayWindowsIndex(item);
|
|
13849
|
+
if (!overlay) continue;
|
|
13850
|
+
|
|
13851
|
+
aryOverlayIndex.push({ WindowsIndex:item.WindowIndex, Overlay:overlay });
|
|
13852
|
+
}
|
|
13853
|
+
}
|
|
13854
|
+
|
|
13855
|
+
//刷新指标
|
|
13856
|
+
var bindData=this.ChartPaint[0].Data;
|
|
13857
|
+
this.BindIndexData(windowIndex,bindData); //请求主指标
|
|
13858
|
+
|
|
13859
|
+
for(var i=0;i<aryOverlayIndex.length;++i) //请求叠加指标
|
|
13860
|
+
{
|
|
13861
|
+
var item=aryOverlayIndex[i];
|
|
13862
|
+
this.BindOverlayIndexData(item.Overlay,item.WindowsIndex,bindData);
|
|
13863
|
+
}
|
|
13864
|
+
|
|
13865
|
+
this.UpdataDataoffset(); //更新数据偏移
|
|
13866
|
+
this.ResetFrameXYSplit();
|
|
13867
|
+
this.UpdateFrameMaxMin(); //调整坐标最大 最小值
|
|
13868
|
+
this.Draw();
|
|
13869
|
+
}
|
|
13768
13870
|
}
|
|
13769
13871
|
|
|
13770
13872
|
function GetDevicePixelRatio()
|
|
@@ -97066,6 +97168,7 @@ function FuturesTimeData()
|
|
|
97066
97168
|
[MARKET_SUFFIX_NAME.CZCE + '-SA', {Time:6,Decimal:0, Name:"纯碱"}],
|
|
97067
97169
|
[MARKET_SUFFIX_NAME.CZCE + '-PF', {Time:6,Decimal:0, Name:"短纤"}],
|
|
97068
97170
|
[MARKET_SUFFIX_NAME.CZCE + '-PK', {Time:0,Decimal:0, Name:"花生"}],
|
|
97171
|
+
[MARKET_SUFFIX_NAME.CZCE + '-PR', {Time:6,Decimal:0, Name:"瓶片"}],
|
|
97069
97172
|
|
|
97070
97173
|
|
|
97071
97174
|
//中期所
|
|
@@ -143262,7 +143365,7 @@ function HQChartScriptWorker()
|
|
|
143262
143365
|
|
|
143263
143366
|
|
|
143264
143367
|
|
|
143265
|
-
var HQCHART_VERSION="1.1.
|
|
143368
|
+
var HQCHART_VERSION="1.1.13792";
|
|
143266
143369
|
|
|
143267
143370
|
function PrintHQChartVersion()
|
|
143268
143371
|
{
|