hqchart 1.1.15184 → 1.1.15187
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 +5 -3
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +34 -1
- package/src/jscommon/umychart.js +13 -2
- package/src/jscommon/umychart.testdata.js +34 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +14 -3
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +34 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +14 -3
package/lib/umychart.vue.js
CHANGED
|
@@ -2506,7 +2506,9 @@ paint.PreventClose=false;paint.ClearPoint();paint.PreventClose=oldPreventClose;/
|
|
|
2506
2506
|
}return paint.SetPoint(kItem,{DataIndex:index});};this.MoveRectSelectPoint=function(obj){var paint=this.GetRectSelectPaint();if(!paint)return false;if(!this.ChartPaint[0]||!this.ChartPaint[0].Data)return false;var kData=this.ChartPaint[0].Data;if(!this.Frame.SubFrame[0])return false;var subFrame=this.Frame.SubFrame[0].Frame;if(!subFrame)false;var pixelTatio=GetDevicePixelRatio();var x=(obj.X-uielement.getBoundingClientRect().left)*pixelTatio;var index=subFrame.GetXData(x);index=parseInt(index.toFixed(0));var dataIndex=index+kData.DataOffset;if(dataIndex>=kData.Data.length)dataIndex=kData.Data.length-1;var item=kData.Data[dataIndex];JSConsole.Chart.Log("[KLineChartContainer::MoveRectSelectPoint] point, item",obj.PointIndex,item);if(!paint.SetPoint(item,{Index:obj.PointIndex,DataIndex:dataIndex}))return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAG_SELECT_RECT);if(event){var selectData=paint.GetSelectRectData();var data={X:obj.X,Y:obj.Y,SelectData:selectData,RectSelectPaint:paint};event.Callback(event,data,this);}if(this.IsShowSelectRectDialog())//区间统计
|
|
2507
2507
|
{var selectData=paint.GetSelectRectData();var data={Chart:this,X:obj.X,Y:obj.Y,SelectData:selectData,//区间选择的数据
|
|
2508
2508
|
RectSelectPaint:paint//区间选择背景
|
|
2509
|
-
};var e={data:data};this.DrawSelectRectDialog(e);}return true;};this.MoveSubRectSelect=function(obj){var paint=this.GetRectSelectPaint();if(!paint)return false;if(!paint.MoveSubRect(obj.Step,obj.IsLeft))return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAG_SUB_SELECT_RECT);if(event){var subRectData={Start:paint.SubClient.FirstPoint,End:paint.SubClient.SecondPoint};var data={X:obj.X,Y:obj.Y,SubRectSelectData:subRectData,RectSelectPaint:paint};event.Callback(event,data,this);}return true;};this.ClearRectSelect=function(bEnforce){var paint=this.GetRectSelectPaint();if(!paint)return false;if(bEnforce)paint.PreventClose
|
|
2509
|
+
};var e={data:data};this.DrawSelectRectDialog(e);}return true;};this.MoveSubRectSelect=function(obj){var paint=this.GetRectSelectPaint();if(!paint)return false;if(!paint.MoveSubRect(obj.Step,obj.IsLeft))return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAG_SUB_SELECT_RECT);if(event){var subRectData={Start:paint.SubClient.FirstPoint,End:paint.SubClient.SecondPoint};var data={X:obj.X,Y:obj.Y,SubRectSelectData:subRectData,RectSelectPaint:paint};event.Callback(event,data,this);}return true;};this.ClearRectSelect=function(bEnforce){var paint=this.GetRectSelectPaint();if(!paint)return false;if(bEnforce){var oldPreventClose=paint.PreventClose;//备份下
|
|
2510
|
+
paint.PreventClose=false;var result=paint.ClearPoint();paint.PreventClose=oldPreventClose;//还原
|
|
2511
|
+
return result;}else{return paint.ClearPoint();}};//删除指定窗口的所有叠加指标
|
|
2510
2512
|
this.DeleteWindowsOverlayIndex=function(windowIndex){if(!IFrameSplitOperator.IsNumber(windowIndex))return;if(windowIndex<0||windowIndex>=this.Frame.SubFrame.length)return;var subFrame=this.Frame.SubFrame[windowIndex];if(!IFrameSplitOperator.IsNonEmptyArray(subFrame.OverlayIndex))return;var aryIndexID=[];for(var i=0;i<subFrame.OverlayIndex.length;++i){var overlayItem=subFrame.OverlayIndex[i];aryIndexID.push(overlayItem.Identify);for(var j=0;j<overlayItem.ChartPaint.length;++j)//图形销毁事件
|
|
2511
2513
|
{var overlayChart=overlayItem.ChartPaint[j];if(overlayChart&&overlayChart.OnDestroy)overlayChart.OnDestroy();}overlayItem.ChartPaint=[];}subFrame.OverlayIndex=[];var titlePaint=this.TitlePaint[windowIndex+1];for(var i=0;i<aryIndexID.length;++i){var identify=aryIndexID[i];if(titlePaint.OverlayIndex.has(identify))titlePaint.OverlayIndex.delete(identify);if(titlePaint.OverlayDynamicTitle.has(identify))titlePaint.OverlayDynamicTitle.delete(identify);}};//删除叠加指标, 没有重绘
|
|
2512
2514
|
this.DeleteOverlayIndex=function(identify,windowIndex){var findIndex=null;if(IFrameSplitOperator.IsNumber(windowIndex)){if(windowIndex>=0&&windowIndex<this.Frame.SubFrame.length){var item=this.Frame.SubFrame[windowIndex];for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(overlayItem.Identify===identify){for(var k=0;k<overlayItem.ChartPaint.length;++k)//图形销毁事件
|
|
@@ -5411,7 +5413,7 @@ this.ShowRangeText={Enable:false,Position:0,//0顶部 1=中间 2=底部
|
|
|
5411
5413
|
Font:g_JSChartResource.RectSelect.RangeTextFont,Color:g_JSChartResource.RectSelect.RangeTextColor,BGColor:g_JSChartResource.RectSelect.RangeTextBGColor,SubPosition:0,SubFont:g_JSChartResource.RectSelect.RangeTextSubFont,SubColor:g_JSChartResource.RectSelect.RangeTextSubColor,SubBGColor:g_JSChartResource.RectSelect.RangeTextSubBGColor};this.BorderCache;this.IsOnlyOnePoint=false;//空格选中区间,单点模式
|
|
5412
5414
|
this.IsFullFrame=false;//区间选择包含子窗口
|
|
5413
5415
|
//设置参数接口
|
|
5414
|
-
this.SetOption=function(option){if(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.AreaColor)this.AreaColor=option.AreaColor;if(IFrameSplitOperator.IsBool(option.SpaceReselected))this.SpaceReselected=option.SpaceReselected;if(option.ShowRangeText){var item=option.ShowRangeText;if(IFrameSplitOperator.IsBool(item.Enable))this.ShowRangeText.Enable=item.Enable;if(IFrameSplitOperator.IsNumber(item.Position))this.ShowRangeText.Position=item.Position;if(IFrameSplitOperator.IsNumber(item.SubPosition))this.ShowRangeText.SubPosition=item.SubPosition;}if(option.Mark){var item=option.Mark;if(IFrameSplitOperator.IsBool(item.IsShow))this.MarkConfig.IsShow=item.IsShow;if(item.Position){if(IFrameSplitOperator.IsNumber(item.Position.Index))this.MarkConfig.Position.Index=item.Position.Index;if(item.Position.Top)this.MarkConfig.Position.Top=item.Position.Top;}}}};this.ReloadResource=function(resource){this.LineColor=g_JSChartResource.RectSelect.LineColor;//竖线
|
|
5416
|
+
this.SetOption=function(option){if(option){if(option.LineColor)this.LineColor=option.LineColor;if(option.AreaColor)this.AreaColor=option.AreaColor;if(IFrameSplitOperator.IsBool(option.SpaceReselected))this.SpaceReselected=option.SpaceReselected;if(IFrameSplitOperator.IsBool(option.PreventClose))this.PreventClose=option.PreventClose;if(option.ShowRangeText){var item=option.ShowRangeText;if(IFrameSplitOperator.IsBool(item.Enable))this.ShowRangeText.Enable=item.Enable;if(IFrameSplitOperator.IsNumber(item.Position))this.ShowRangeText.Position=item.Position;if(IFrameSplitOperator.IsNumber(item.SubPosition))this.ShowRangeText.SubPosition=item.SubPosition;}if(option.Mark){var item=option.Mark;if(IFrameSplitOperator.IsBool(item.IsShow))this.MarkConfig.IsShow=item.IsShow;if(item.Position){if(IFrameSplitOperator.IsNumber(item.Position.Index))this.MarkConfig.Position.Index=item.Position.Index;if(item.Position.Top)this.MarkConfig.Position.Top=item.Position.Top;}}}};this.ReloadResource=function(resource){this.LineColor=g_JSChartResource.RectSelect.LineColor;//竖线
|
|
5415
5417
|
this.LineWidth=g_JSChartResource.RectSelect.LineWidth;this.LineDotted=g_JSChartResource.RectSelect.LineDotted;this.AreaColor=g_JSChartResource.RectSelect.AreaColor;//面积
|
|
5416
5418
|
this.ShowRangeText.Font=g_JSChartResource.RectSelect.RangeTextFont;this.ShowRangeText.Color=g_JSChartResource.RectSelect.RangeTextColor;this.ShowRangeText.BGColor=g_JSChartResource.RectSelect.RangeTextBGColor;};this.IsMinuteChart=function(){var className=this.HQChart.ClassName;var isMinuteChart=className=="MinuteChartContainer"||className=="MinuteChartHScreenContainer"?true:false;return isMinuteChart;};this.GetKData=function(){if(!this.HQChart)return null;var isMinuteChart=this.IsMinuteChart();var data=null;if(isMinuteChart){if(!this.HQChart.SourceData)return null;data=this.HQChart.SourceData;}else{if(!this.HQChart.ChartPaint[0])return null;data=this.HQChart.ChartPaint[0].Data;if(!data)return null;}return data;};this.GetPointCount=function(){var count=0;if(this.FirstPoint)++count;if(this.SecondPoint)++count;return count;};this.DateToNumber=function(value,isMinuteChart){if(isMinuteChart){if(IFrameSplitOperator.IsNumber(value.Date))return value.Date*10000+value.Time;else return value.Time;}else{var period=this.HQChart.Period;if(ChartData.IsDayPeriod(period,true))return value.Date;//YYYYMMDD
|
|
5417
5419
|
else if(ChartData.IsMinutePeriod(period,true))return value.Date*10000+value.Time;//YYYYMMDDHHMM
|
|
@@ -15637,7 +15639,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15637
15639
|
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);};}/********************************************************************************
|
|
15638
15640
|
* 版本信息输出
|
|
15639
15641
|
*
|
|
15640
|
-
*/var HQCHART_VERSION="1.1.
|
|
15642
|
+
*/var HQCHART_VERSION="1.1.15186";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();//把给外界调用的方法暴露出来
|
|
15641
15643
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15642
15644
|
// BaseIndex:BaseIndex,
|
|
15643
15645
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -55865,7 +55865,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
55865
55865
|
}
|
|
55866
55866
|
|
|
55867
55867
|
//盘中
|
|
55868
|
-
|
|
55868
|
+
stockItem.minute.length=50;
|
|
55869
55869
|
//测试用 这里可以修改数据
|
|
55870
55870
|
//var lastItem=srcStock.minute[srcStock.minute.length-1];
|
|
55871
55871
|
//lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
|
|
@@ -56477,6 +56477,7 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
|
|
|
56477
56477
|
dayItem.BuySellData={ AryBuy:aryBuy, ArySell:arySell };
|
|
56478
56478
|
}
|
|
56479
56479
|
|
|
56480
|
+
aryDay[0].minute.length=20;
|
|
56480
56481
|
var hqchartData={code:0, data:aryDay, name:symbol, symbol: symbol};
|
|
56481
56482
|
|
|
56482
56483
|
//hqchartData.data[0].minute.length=45;
|
|
@@ -56836,6 +56837,23 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
56836
56837
|
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:kItem.Vol/3 });
|
|
56837
56838
|
}
|
|
56838
56839
|
}
|
|
56840
|
+
else if (funcName=="FUNC_ALPHA")
|
|
56841
|
+
{
|
|
56842
|
+
//模拟下载alpha系数序列
|
|
56843
|
+
setTimeout(()=>
|
|
56844
|
+
{
|
|
56845
|
+
var kData=data.Self.Data;
|
|
56846
|
+
var hqchartData={ DataType:2, Data:[] };
|
|
56847
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
56848
|
+
{
|
|
56849
|
+
var kItem=kData.Data[i];
|
|
56850
|
+
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:HQData.GetRandomTestData(0,100)/100 });
|
|
56851
|
+
}
|
|
56852
|
+
callback(hqchartData);
|
|
56853
|
+
},300);
|
|
56854
|
+
|
|
56855
|
+
return;
|
|
56856
|
+
}
|
|
56839
56857
|
else
|
|
56840
56858
|
{
|
|
56841
56859
|
var error= `函数'${funcName}' 没有对接数据. [HQData.CustomFunction_RequestData]`;
|
|
@@ -56845,6 +56863,21 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
56845
56863
|
callback(hqchartData);
|
|
56846
56864
|
}
|
|
56847
56865
|
|
|
56866
|
+
//ALPHA:FUNC_ALPHA(L);
|
|
56867
|
+
HQData.FUNC_ALPHA=function(obj)
|
|
56868
|
+
{
|
|
56869
|
+
console.log("[HQData::FuncAlpha] obj=", obj);
|
|
56870
|
+
var aryValue=obj.Args[0]; //参数
|
|
56871
|
+
var aryAlpha=obj.DownloadData; //下载数据
|
|
56872
|
+
var aryData=[];
|
|
56873
|
+
for(var i=0; i<aryValue.length; ++i)
|
|
56874
|
+
{
|
|
56875
|
+
aryData.push(aryValue[i]*aryAlpha[i]);
|
|
56876
|
+
}
|
|
56877
|
+
|
|
56878
|
+
return { Out:aryData };
|
|
56879
|
+
}
|
|
56880
|
+
|
|
56848
56881
|
HQData.CustomVarData_RequestData=function(data, callback)
|
|
56849
56882
|
{
|
|
56850
56883
|
data.PreventDefault=true;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -10812,8 +10812,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
10812
10812
|
{
|
|
10813
10813
|
var paint=this.GetRectSelectPaint();
|
|
10814
10814
|
if (!paint) return false;
|
|
10815
|
-
if (bEnforce)
|
|
10816
|
-
|
|
10815
|
+
if (bEnforce)
|
|
10816
|
+
{
|
|
10817
|
+
var oldPreventClose=paint.PreventClose; //备份下
|
|
10818
|
+
paint.PreventClose=false;
|
|
10819
|
+
var result=paint.ClearPoint();
|
|
10820
|
+
paint.PreventClose=oldPreventClose; //还原
|
|
10821
|
+
return result;
|
|
10822
|
+
}
|
|
10823
|
+
else
|
|
10824
|
+
{
|
|
10825
|
+
return paint.ClearPoint();
|
|
10826
|
+
}
|
|
10817
10827
|
}
|
|
10818
10828
|
|
|
10819
10829
|
//删除指定窗口的所有叠加指标
|
|
@@ -51261,6 +51271,7 @@ function RectSelectPaint()
|
|
|
51261
51271
|
if (option.LineColor) this.LineColor=option.LineColor;
|
|
51262
51272
|
if (option.AreaColor) this.AreaColor=option.AreaColor;
|
|
51263
51273
|
if (IFrameSplitOperator.IsBool(option.SpaceReselected)) this.SpaceReselected=option.SpaceReselected;
|
|
51274
|
+
if (IFrameSplitOperator.IsBool(option.PreventClose)) this.PreventClose=option.PreventClose;
|
|
51264
51275
|
|
|
51265
51276
|
if (option.ShowRangeText)
|
|
51266
51277
|
{
|
|
@@ -351,7 +351,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
//盘中
|
|
354
|
-
|
|
354
|
+
stockItem.minute.length=50;
|
|
355
355
|
//测试用 这里可以修改数据
|
|
356
356
|
//var lastItem=srcStock.minute[srcStock.minute.length-1];
|
|
357
357
|
//lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
|
|
@@ -963,6 +963,7 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
|
|
|
963
963
|
dayItem.BuySellData={ AryBuy:aryBuy, ArySell:arySell };
|
|
964
964
|
}
|
|
965
965
|
|
|
966
|
+
aryDay[0].minute.length=20;
|
|
966
967
|
var hqchartData={code:0, data:aryDay, name:symbol, symbol: symbol};
|
|
967
968
|
|
|
968
969
|
//hqchartData.data[0].minute.length=45;
|
|
@@ -1322,6 +1323,23 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
1322
1323
|
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:kItem.Vol/3 });
|
|
1323
1324
|
}
|
|
1324
1325
|
}
|
|
1326
|
+
else if (funcName=="FUNC_ALPHA")
|
|
1327
|
+
{
|
|
1328
|
+
//模拟下载alpha系数序列
|
|
1329
|
+
setTimeout(()=>
|
|
1330
|
+
{
|
|
1331
|
+
var kData=data.Self.Data;
|
|
1332
|
+
var hqchartData={ DataType:2, Data:[] };
|
|
1333
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
1334
|
+
{
|
|
1335
|
+
var kItem=kData.Data[i];
|
|
1336
|
+
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:HQData.GetRandomTestData(0,100)/100 });
|
|
1337
|
+
}
|
|
1338
|
+
callback(hqchartData);
|
|
1339
|
+
},300);
|
|
1340
|
+
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1325
1343
|
else
|
|
1326
1344
|
{
|
|
1327
1345
|
var error= `函数'${funcName}' 没有对接数据. [HQData.CustomFunction_RequestData]`;
|
|
@@ -1331,6 +1349,21 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
1331
1349
|
callback(hqchartData);
|
|
1332
1350
|
}
|
|
1333
1351
|
|
|
1352
|
+
//ALPHA:FUNC_ALPHA(L);
|
|
1353
|
+
HQData.FUNC_ALPHA=function(obj)
|
|
1354
|
+
{
|
|
1355
|
+
console.log("[HQData::FuncAlpha] obj=", obj);
|
|
1356
|
+
var aryValue=obj.Args[0]; //参数
|
|
1357
|
+
var aryAlpha=obj.DownloadData; //下载数据
|
|
1358
|
+
var aryData=[];
|
|
1359
|
+
for(var i=0; i<aryValue.length; ++i)
|
|
1360
|
+
{
|
|
1361
|
+
aryData.push(aryValue[i]*aryAlpha[i]);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
return { Out:aryData };
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1334
1367
|
HQData.CustomVarData_RequestData=function(data, callback)
|
|
1335
1368
|
{
|
|
1336
1369
|
data.PreventDefault=true;
|
|
@@ -14908,8 +14908,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14908
14908
|
{
|
|
14909
14909
|
var paint=this.GetRectSelectPaint();
|
|
14910
14910
|
if (!paint) return false;
|
|
14911
|
-
if (bEnforce)
|
|
14912
|
-
|
|
14911
|
+
if (bEnforce)
|
|
14912
|
+
{
|
|
14913
|
+
var oldPreventClose=paint.PreventClose; //备份下
|
|
14914
|
+
paint.PreventClose=false;
|
|
14915
|
+
var result=paint.ClearPoint();
|
|
14916
|
+
paint.PreventClose=oldPreventClose; //还原
|
|
14917
|
+
return result;
|
|
14918
|
+
}
|
|
14919
|
+
else
|
|
14920
|
+
{
|
|
14921
|
+
return paint.ClearPoint();
|
|
14922
|
+
}
|
|
14913
14923
|
}
|
|
14914
14924
|
|
|
14915
14925
|
//删除指定窗口的所有叠加指标
|
|
@@ -55357,6 +55367,7 @@ function RectSelectPaint()
|
|
|
55357
55367
|
if (option.LineColor) this.LineColor=option.LineColor;
|
|
55358
55368
|
if (option.AreaColor) this.AreaColor=option.AreaColor;
|
|
55359
55369
|
if (IFrameSplitOperator.IsBool(option.SpaceReselected)) this.SpaceReselected=option.SpaceReselected;
|
|
55370
|
+
if (IFrameSplitOperator.IsBool(option.PreventClose)) this.PreventClose=option.PreventClose;
|
|
55360
55371
|
|
|
55361
55372
|
if (option.ShowRangeText)
|
|
55362
55373
|
{
|
|
@@ -154164,7 +154175,7 @@ function ScrollBarBGChart()
|
|
|
154164
154175
|
|
|
154165
154176
|
|
|
154166
154177
|
|
|
154167
|
-
var HQCHART_VERSION="1.1.
|
|
154178
|
+
var HQCHART_VERSION="1.1.15186";
|
|
154168
154179
|
|
|
154169
154180
|
function PrintHQChartVersion()
|
|
154170
154181
|
{
|
|
@@ -55883,7 +55883,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
55883
55883
|
}
|
|
55884
55884
|
|
|
55885
55885
|
//盘中
|
|
55886
|
-
|
|
55886
|
+
stockItem.minute.length=50;
|
|
55887
55887
|
//测试用 这里可以修改数据
|
|
55888
55888
|
//var lastItem=srcStock.minute[srcStock.minute.length-1];
|
|
55889
55889
|
//lastItem.price+=Math.ceil(Math.random()*10)/1000*lastItem.price;
|
|
@@ -56495,6 +56495,7 @@ HQData.Minute_RequestHistoryMinuteData=function(data, callback)
|
|
|
56495
56495
|
dayItem.BuySellData={ AryBuy:aryBuy, ArySell:arySell };
|
|
56496
56496
|
}
|
|
56497
56497
|
|
|
56498
|
+
aryDay[0].minute.length=20;
|
|
56498
56499
|
var hqchartData={code:0, data:aryDay, name:symbol, symbol: symbol};
|
|
56499
56500
|
|
|
56500
56501
|
//hqchartData.data[0].minute.length=45;
|
|
@@ -56854,6 +56855,23 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
56854
56855
|
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:kItem.Vol/3 });
|
|
56855
56856
|
}
|
|
56856
56857
|
}
|
|
56858
|
+
else if (funcName=="FUNC_ALPHA")
|
|
56859
|
+
{
|
|
56860
|
+
//模拟下载alpha系数序列
|
|
56861
|
+
setTimeout(()=>
|
|
56862
|
+
{
|
|
56863
|
+
var kData=data.Self.Data;
|
|
56864
|
+
var hqchartData={ DataType:2, Data:[] };
|
|
56865
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
56866
|
+
{
|
|
56867
|
+
var kItem=kData.Data[i];
|
|
56868
|
+
hqchartData.Data.push({ Date:kItem.Date, Time:kItem.Time, Value:HQData.GetRandomTestData(0,100)/100 });
|
|
56869
|
+
}
|
|
56870
|
+
callback(hqchartData);
|
|
56871
|
+
},300);
|
|
56872
|
+
|
|
56873
|
+
return;
|
|
56874
|
+
}
|
|
56857
56875
|
else
|
|
56858
56876
|
{
|
|
56859
56877
|
var error= `函数'${funcName}' 没有对接数据. [HQData.CustomFunction_RequestData]`;
|
|
@@ -56863,6 +56881,21 @@ HQData.CustomFunction_RequestData=function(data, callback)
|
|
|
56863
56881
|
callback(hqchartData);
|
|
56864
56882
|
}
|
|
56865
56883
|
|
|
56884
|
+
//ALPHA:FUNC_ALPHA(L);
|
|
56885
|
+
HQData.FUNC_ALPHA=function(obj)
|
|
56886
|
+
{
|
|
56887
|
+
console.log("[HQData::FuncAlpha] obj=", obj);
|
|
56888
|
+
var aryValue=obj.Args[0]; //参数
|
|
56889
|
+
var aryAlpha=obj.DownloadData; //下载数据
|
|
56890
|
+
var aryData=[];
|
|
56891
|
+
for(var i=0; i<aryValue.length; ++i)
|
|
56892
|
+
{
|
|
56893
|
+
aryData.push(aryValue[i]*aryAlpha[i]);
|
|
56894
|
+
}
|
|
56895
|
+
|
|
56896
|
+
return { Out:aryData };
|
|
56897
|
+
}
|
|
56898
|
+
|
|
56866
56899
|
HQData.CustomVarData_RequestData=function(data, callback)
|
|
56867
56900
|
{
|
|
56868
56901
|
data.PreventDefault=true;
|
|
@@ -14952,8 +14952,18 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
14952
14952
|
{
|
|
14953
14953
|
var paint=this.GetRectSelectPaint();
|
|
14954
14954
|
if (!paint) return false;
|
|
14955
|
-
if (bEnforce)
|
|
14956
|
-
|
|
14955
|
+
if (bEnforce)
|
|
14956
|
+
{
|
|
14957
|
+
var oldPreventClose=paint.PreventClose; //备份下
|
|
14958
|
+
paint.PreventClose=false;
|
|
14959
|
+
var result=paint.ClearPoint();
|
|
14960
|
+
paint.PreventClose=oldPreventClose; //还原
|
|
14961
|
+
return result;
|
|
14962
|
+
}
|
|
14963
|
+
else
|
|
14964
|
+
{
|
|
14965
|
+
return paint.ClearPoint();
|
|
14966
|
+
}
|
|
14957
14967
|
}
|
|
14958
14968
|
|
|
14959
14969
|
//删除指定窗口的所有叠加指标
|
|
@@ -55401,6 +55411,7 @@ function RectSelectPaint()
|
|
|
55401
55411
|
if (option.LineColor) this.LineColor=option.LineColor;
|
|
55402
55412
|
if (option.AreaColor) this.AreaColor=option.AreaColor;
|
|
55403
55413
|
if (IFrameSplitOperator.IsBool(option.SpaceReselected)) this.SpaceReselected=option.SpaceReselected;
|
|
55414
|
+
if (IFrameSplitOperator.IsBool(option.PreventClose)) this.PreventClose=option.PreventClose;
|
|
55404
55415
|
|
|
55405
55416
|
if (option.ShowRangeText)
|
|
55406
55417
|
{
|
|
@@ -166177,7 +166188,7 @@ function HQChartScriptWorker()
|
|
|
166177
166188
|
|
|
166178
166189
|
|
|
166179
166190
|
|
|
166180
|
-
var HQCHART_VERSION="1.1.
|
|
166191
|
+
var HQCHART_VERSION="1.1.15186";
|
|
166181
166192
|
|
|
166182
166193
|
function PrintHQChartVersion()
|
|
166183
166194
|
{
|