hqchart 1.1.15184 → 1.1.15191

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.
@@ -351,7 +351,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
351
351
  }
352
352
 
353
353
  //盘中
354
- //stockItem.minute.length=50;
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;
@@ -7789,7 +7789,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7789
7789
  if (!indexScript) return;
7790
7790
 
7791
7791
  data.IndexScript=indexScript;
7792
- data.Title=`[${indexScript.Name}]参数修改 窗口[${data.WindowIndex+1}]`;
7792
+ data.Title=`[${indexScript.Name || "--"}]参数修改 窗口[${data.WindowIndex+1}]`;
7793
7793
  }
7794
7794
  else if (data.Type==2)
7795
7795
  {
@@ -7798,7 +7798,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7798
7798
  var indexScript=overlayIndex.OverlayItem.Script;
7799
7799
 
7800
7800
  data.IndexScript=indexScript;
7801
- data.Title=`[${indexScript.Name}]参数修改 叠加窗口[${data.WindowIndex+1}]`;
7801
+ data.Title=`[${indexScript.Name || "--"}]参数修改 叠加窗口[${data.WindowIndex+1}]`;
7802
7802
  }
7803
7803
 
7804
7804
  this.DialogModifyIndexParam.SetIndexData(data);
@@ -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) paint.PreventClose=false;
14912
- return paint.ClearPoint();
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
  {
@@ -81951,12 +81962,7 @@ function JSChartResource()
81951
81962
  }
81952
81963
  }
81953
81964
 
81954
- this.DivFrameToolbar=
81955
- {
81956
- Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
81957
- Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
81958
- }
81959
-
81965
+
81960
81966
  //画图工具
81961
81967
  this.DrawPicture=
81962
81968
  {
@@ -83902,28 +83908,6 @@ function JSChartResource()
83902
83908
 
83903
83909
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83904
83910
 
83905
- if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
83906
- }
83907
-
83908
- this.SetDivFrameToolbar=function(style)
83909
- {
83910
- var dest=this.DivFrameToolbar;
83911
- if (style.Icon)
83912
- {
83913
- var item=style.Icon;
83914
- var subDest=dest.Icon;
83915
- if (item.Color) subDest.Color=item.Color;
83916
- if (item.HoverColor) subDest.HoverColor=item.HoverColor;
83917
- }
83918
-
83919
- if (style.Tooltip)
83920
- {
83921
- var item=style.Tooltip;
83922
- var subDest=dest.Tooltip;
83923
- if (item.TextColor) subDest.TextColor=item.TextColor;
83924
- if (item.BorderColor) subDest.BorderColor=item.BorderColor;
83925
- if (item.BGColor) subDest.BGColor=item.BGColor;
83926
- }
83927
83911
  }
83928
83912
 
83929
83913
  this.SetSmallFloatTooltipV2=function(style)
@@ -109528,12 +109512,6 @@ function JSDivFrameToolbar()
109528
109512
  this.Left=-1;
109529
109513
  this.Top=-1;
109530
109514
 
109531
- this.IconConfig=
109532
- {
109533
- Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
109534
- HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109535
- }
109536
-
109537
109515
  this.AryButton=[]; //按钮数组
109538
109516
 
109539
109517
  //创建按钮
@@ -109675,20 +109653,10 @@ function JSDivFrameToolbar()
109675
109653
  this.UpdateStyle=function()
109676
109654
  {
109677
109655
  if (!this.DivToolbar) return;
109678
-
109679
- for(var i=0;i<this.AryButton.length; i++)
109680
- {
109681
- var item=this.AryButton[i]
109682
- if (!item.Span) continue;
109683
- item.Span.style["color"]=this.IconConfig.Color;
109684
- }
109685
109656
  }
109686
109657
 
109687
109658
  this.ReloadResource=function(option)
109688
109659
  {
109689
- this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
109690
- this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
109691
-
109692
109660
  this.UpdateStyle();
109693
109661
  }
109694
109662
 
@@ -109725,15 +109693,12 @@ function JSDivFrameToolbar()
109725
109693
  {
109726
109694
  if (!item.Span) return;
109727
109695
 
109728
- item.Span.style["color"]=this.IconConfig.HoverColor;
109729
-
109730
109696
  this.ShowTooltip(e, item);
109731
109697
  }
109732
109698
 
109733
109699
  this.OnLeaveButton=function(e, item)
109734
109700
  {
109735
109701
  if (!item.Span) return;
109736
- item.Span.style["color"]=this.IconConfig.Color;
109737
109702
 
109738
109703
  this.HideTooltip();
109739
109704
  }
@@ -109877,10 +109842,6 @@ function JSToolbarTooltip()
109877
109842
  this.Left=-1;
109878
109843
  this.Top=-1;
109879
109844
 
109880
- this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109881
- this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109882
- this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109883
-
109884
109845
  this.Create=function()
109885
109846
  {
109886
109847
  var divDom=document.createElement("div");
@@ -109894,20 +109855,12 @@ function JSToolbarTooltip()
109894
109855
 
109895
109856
  this.ReloadResource=function(option)
109896
109857
  {
109897
- this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109898
- this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109899
- this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109900
-
109901
109858
  this.UpdateStyle();
109902
109859
  }
109903
109860
 
109904
109861
  this.UpdateStyle=function()
109905
109862
  {
109906
109863
  if (!this.DivTooltip) return;
109907
-
109908
- this.DivTooltip.style["background-color"]=this.BGColor;
109909
- this.DivTooltip.style["color"]=this.TextColor;
109910
- this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
109911
109864
  }
109912
109865
 
109913
109866
  this.Show=function(top, left, tooltipData)
@@ -137415,12 +137368,6 @@ function GetBlackStyle()
137415
137368
  }
137416
137369
  },
137417
137370
 
137418
- DivFrameToolbar:
137419
- {
137420
- Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
137421
- Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
137422
- },
137423
-
137424
137371
  DrawPicture: //画图工具
137425
137372
  {
137426
137373
  LineColor:
@@ -154164,7 +154111,7 @@ function ScrollBarBGChart()
154164
154111
 
154165
154112
 
154166
154113
 
154167
- var HQCHART_VERSION="1.1.15183";
154114
+ var HQCHART_VERSION="1.1.15190";
154168
154115
 
154169
154116
  function PrintHQChartVersion()
154170
154117
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15183";
8
+ var HQCHART_VERSION="1.1.15190";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -55883,7 +55883,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55883
55883
  }
55884
55884
 
55885
55885
  //盘中
55886
- //stockItem.minute.length=50;
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;
@@ -7833,7 +7833,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7833
7833
  if (!indexScript) return;
7834
7834
 
7835
7835
  data.IndexScript=indexScript;
7836
- data.Title=`[${indexScript.Name}]参数修改 窗口[${data.WindowIndex+1}]`;
7836
+ data.Title=`[${indexScript.Name || "--"}]参数修改 窗口[${data.WindowIndex+1}]`;
7837
7837
  }
7838
7838
  else if (data.Type==2)
7839
7839
  {
@@ -7842,7 +7842,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7842
7842
  var indexScript=overlayIndex.OverlayItem.Script;
7843
7843
 
7844
7844
  data.IndexScript=indexScript;
7845
- data.Title=`[${indexScript.Name}]参数修改 叠加窗口[${data.WindowIndex+1}]`;
7845
+ data.Title=`[${indexScript.Name || "--"}]参数修改 叠加窗口[${data.WindowIndex+1}]`;
7846
7846
  }
7847
7847
 
7848
7848
  this.DialogModifyIndexParam.SetIndexData(data);
@@ -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) paint.PreventClose=false;
14956
- return paint.ClearPoint();
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
  {
@@ -81995,12 +82006,7 @@ function JSChartResource()
81995
82006
  }
81996
82007
  }
81997
82008
 
81998
- this.DivFrameToolbar=
81999
- {
82000
- Icon:{ Color:"rgb(0,0,0)", HoverColor:"rgb(30,144,255)" },
82001
- Tooltip:{ BGColor:"rgb(255,255,255)", TextColor:"rgb(71,71,71)", BorderColor:"rgb(0,0,0)" },
82002
- }
82003
-
82009
+
82004
82010
  //画图工具
82005
82011
  this.DrawPicture=
82006
82012
  {
@@ -83946,28 +83952,6 @@ function JSChartResource()
83946
83952
 
83947
83953
  if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83948
83954
 
83949
- if (style.DivFrameToolbar) this.SetDivFrameToolbar(style.DivFrameToolbar);
83950
- }
83951
-
83952
- this.SetDivFrameToolbar=function(style)
83953
- {
83954
- var dest=this.DivFrameToolbar;
83955
- if (style.Icon)
83956
- {
83957
- var item=style.Icon;
83958
- var subDest=dest.Icon;
83959
- if (item.Color) subDest.Color=item.Color;
83960
- if (item.HoverColor) subDest.HoverColor=item.HoverColor;
83961
- }
83962
-
83963
- if (style.Tooltip)
83964
- {
83965
- var item=style.Tooltip;
83966
- var subDest=dest.Tooltip;
83967
- if (item.TextColor) subDest.TextColor=item.TextColor;
83968
- if (item.BorderColor) subDest.BorderColor=item.BorderColor;
83969
- if (item.BGColor) subDest.BGColor=item.BGColor;
83970
- }
83971
83955
  }
83972
83956
 
83973
83957
  this.SetSmallFloatTooltipV2=function(style)
@@ -109572,12 +109556,6 @@ function JSDivFrameToolbar()
109572
109556
  this.Left=-1;
109573
109557
  this.Top=-1;
109574
109558
 
109575
- this.IconConfig=
109576
- {
109577
- Color:g_JSChartResource.DivFrameToolbar.Icon.Color,
109578
- HoverColor:g_JSChartResource.DivFrameToolbar.Icon.HoverColor
109579
- }
109580
-
109581
109559
  this.AryButton=[]; //按钮数组
109582
109560
 
109583
109561
  //创建按钮
@@ -109719,20 +109697,10 @@ function JSDivFrameToolbar()
109719
109697
  this.UpdateStyle=function()
109720
109698
  {
109721
109699
  if (!this.DivToolbar) return;
109722
-
109723
- for(var i=0;i<this.AryButton.length; i++)
109724
- {
109725
- var item=this.AryButton[i]
109726
- if (!item.Span) continue;
109727
- item.Span.style["color"]=this.IconConfig.Color;
109728
- }
109729
109700
  }
109730
109701
 
109731
109702
  this.ReloadResource=function(option)
109732
109703
  {
109733
- this.IconConfig.Color=g_JSChartResource.DivFrameToolbar.Icon.Color,
109734
- this.IconConfig.HoverColor=g_JSChartResource.DivFrameToolbar.Icon.HoverColor;
109735
-
109736
109704
  this.UpdateStyle();
109737
109705
  }
109738
109706
 
@@ -109769,15 +109737,12 @@ function JSDivFrameToolbar()
109769
109737
  {
109770
109738
  if (!item.Span) return;
109771
109739
 
109772
- item.Span.style["color"]=this.IconConfig.HoverColor;
109773
-
109774
109740
  this.ShowTooltip(e, item);
109775
109741
  }
109776
109742
 
109777
109743
  this.OnLeaveButton=function(e, item)
109778
109744
  {
109779
109745
  if (!item.Span) return;
109780
- item.Span.style["color"]=this.IconConfig.Color;
109781
109746
 
109782
109747
  this.HideTooltip();
109783
109748
  }
@@ -109921,10 +109886,6 @@ function JSToolbarTooltip()
109921
109886
  this.Left=-1;
109922
109887
  this.Top=-1;
109923
109888
 
109924
- this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109925
- this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109926
- this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109927
-
109928
109889
  this.Create=function()
109929
109890
  {
109930
109891
  var divDom=document.createElement("div");
@@ -109938,20 +109899,12 @@ function JSToolbarTooltip()
109938
109899
 
109939
109900
  this.ReloadResource=function(option)
109940
109901
  {
109941
- this.BGColor=g_JSChartResource.DivFrameToolbar.Tooltip.BGColor;
109942
- this.TextColor=g_JSChartResource.DivFrameToolbar.Tooltip.TextColor;
109943
- this.BorderColor=g_JSChartResource.DivFrameToolbar.Tooltip.BorderColor;
109944
-
109945
109902
  this.UpdateStyle();
109946
109903
  }
109947
109904
 
109948
109905
  this.UpdateStyle=function()
109949
109906
  {
109950
109907
  if (!this.DivTooltip) return;
109951
-
109952
- this.DivTooltip.style["background-color"]=this.BGColor;
109953
- this.DivTooltip.style["color"]=this.TextColor;
109954
- this.DivTooltip.style["border"]="1px solid " + this.BorderColor;
109955
109908
  }
109956
109909
 
109957
109910
  this.Show=function(top, left, tooltipData)
@@ -137459,12 +137412,6 @@ function GetBlackStyle()
137459
137412
  }
137460
137413
  },
137461
137414
 
137462
- DivFrameToolbar:
137463
- {
137464
- Icon:{ Color:"rgb(156,156,156)", HoverColor:"rgb(255,255,255)" },
137465
- Tooltip:{ BGColor:"rgb(32,32,32)", TextColor:"rgb(204,204,204)", BorderColor:"rgb(69,69,69)" },
137466
- },
137467
-
137468
137415
  DrawPicture: //画图工具
137469
137416
  {
137470
137417
  LineColor:
@@ -166177,7 +166124,7 @@ function HQChartScriptWorker()
166177
166124
 
166178
166125
 
166179
166126
 
166180
- var HQCHART_VERSION="1.1.15183";
166127
+ var HQCHART_VERSION="1.1.15190";
166181
166128
 
166182
166129
  function PrintHQChartVersion()
166183
166130
  {