hqchart 1.1.15111 → 1.1.15121

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.
@@ -6766,6 +6766,14 @@ JSChart.RegisterChartFrameClass=function(name, option)
6766
6766
  }
6767
6767
 
6768
6768
 
6769
+ //注册DOM对话框类
6770
+ //option:{ Create:创建类方法 }
6771
+ JSChart.RegisterDOMClass=function(name, option)
6772
+ {
6773
+ return g_JSDOMFactory.Add(name, option);
6774
+ }
6775
+
6776
+
6769
6777
  //一些公共函数
6770
6778
  JSChart.ToFixedPoint=function(value)
6771
6779
  {
@@ -16699,6 +16707,36 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
16699
16707
  this.UpdateWindowIndexV2(aryUpdate);
16700
16708
  return true;
16701
16709
  }
16710
+
16711
+ this.TryClickLock=function(x,y)
16712
+ {
16713
+ if (!this.Frame || !IFrameSplitOperator.IsNonEmptyArray(this.Frame.SubFrame)) return false;
16714
+
16715
+ for(var i=0;i<this.Frame.SubFrame.length; ++i)
16716
+ {
16717
+ var item=this.Frame.SubFrame[i];
16718
+ var chartLock=item.Frame.LockPaint;
16719
+ if (!chartLock || !chartLock.LockRect) continue;
16720
+
16721
+ var tooltip=new TooltipData();
16722
+ if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
16723
+
16724
+ tooltip.HQChart=this;
16725
+
16726
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
16727
+ if (event && event.Callback)
16728
+ {
16729
+ var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
16730
+ event.Callback(event,sendData,this);
16731
+ }
16732
+
16733
+
16734
+ if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
16735
+ return true;
16736
+ }
16737
+
16738
+ return false;
16739
+ }
16702
16740
  }
16703
16741
 
16704
16742
  function GetDevicePixelRatio()
@@ -20454,7 +20492,7 @@ function AverageWidthFrame()
20454
20492
 
20455
20493
  if (this.ClassName=="MinuteFrame" || this.ClassName=="KLineFrame")
20456
20494
  {
20457
- this.DivFrameToolbar=new JSDivFrameToolbar();
20495
+ this.DivFrameToolbar=g_JSDOMFactory.Create('JSDivFrameToolbar');//new JSDivFrameToolbar();
20458
20496
  this.DivFrameToolbar.HQChart=hqchart;
20459
20497
  this.DivFrameToolbar.DivHQChart=divHQChart;
20460
20498
  this.DivFrameToolbar.FrameID=frameID;
@@ -30999,9 +31037,20 @@ function IChartPainting()
30999
31037
  var x=left+width/2;
31000
31038
  var y=top+height/2;
31001
31039
 
31040
+ var bHScreen=this.ChartFrame.IsHScreen;
31041
+ if (bHScreen)
31042
+ {
31043
+ this.Canvas.save();
31044
+ this.Canvas.translate(x, y);
31045
+ this.Canvas.rotate(90 * Math.PI / 180);
31046
+ x=0,y=0;
31047
+ }
31048
+
31002
31049
  this.Canvas.textAlign="center";
31003
31050
  this.Canvas.textBaseline="middle";
31004
31051
  this.Canvas.fillText(this.NotSupportMessage,x,y);
31052
+
31053
+ if (bHScreen) this.Canvas.restore();
31005
31054
  }
31006
31055
 
31007
31056
  this.GetTooltipData=function(x,y,tooltip)
@@ -52043,6 +52092,8 @@ function ChartLock()
52043
52092
  this.IndexName; //指标名字
52044
52093
  this.IndexID; //指标ID
52045
52094
 
52095
+ this.MinWidthText=" 付费指标 "
52096
+
52046
52097
  this.SetData=function(aryData)
52047
52098
  {
52048
52099
  this.AryData=aryData;
@@ -52170,11 +52221,27 @@ function ChartLock()
52170
52221
  }
52171
52222
  }
52172
52223
 
52224
+ this.Canvas.font=this.Font;
52225
+ var minWidth=this.Canvas.measureText(this.MinWidthText).width;
52226
+
52227
+ var aryText=null;
52228
+ if (Array.isArray(this.Title)) aryText=this.Title;
52229
+ else aryText=[{Text:this.Title}];
52230
+
52231
+ var outSize={ };
52232
+ if (!this.CalculateTextSize(aryText, this.Font, outSize)) outSize=null;
52233
+ if (outSize && outSize.Width+8>minWidth) minWidth=outSize.Width+8; //确保文字可以显示
52234
+
52173
52235
  if (bHScreen)
52174
52236
  {
52175
52237
  var rtBG={ Left:border.Left, Right:border.RightEx, Top:left, Bottom:border.Bottom };
52176
52238
  rtBG.Width=rtBG.Right-rtBG.Left;
52177
52239
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52240
+ if (rtBG.Height<minWidth)
52241
+ {
52242
+ rtBG.Height=minWidth;
52243
+ rtBG.Top=rtBG.Bottom-rtBG.Height;
52244
+ }
52178
52245
  this.LockRect=rtBG; //保存上锁区域
52179
52246
 
52180
52247
  if (bDraw)
@@ -52189,6 +52256,11 @@ function ChartLock()
52189
52256
  var rtBG={ Left:left, Right:border.RightEx, Top:border.TopTitle, Bottom:border.Bottom };
52190
52257
  rtBG.Width=rtBG.Right-rtBG.Left;
52191
52258
  rtBG.Height=rtBG.Bottom-rtBG.Top;
52259
+ if (rtBG.Width<minWidth)
52260
+ {
52261
+ rtBG.Width=minWidth;
52262
+ rtBG.Left=rtBG.Right-rtBG.Width;
52263
+ }
52192
52264
  this.LockRect=rtBG; //保存上锁区域
52193
52265
 
52194
52266
  if (bDraw)
@@ -52201,13 +52273,7 @@ function ChartLock()
52201
52273
  }
52202
52274
 
52203
52275
  if (!bDraw) return;
52204
-
52205
- var aryText=null;
52206
- if (Array.isArray(this.Title)) aryText=this.Title;
52207
- else aryText=[{Text:this.Title}];
52208
-
52209
- var outSize={ };
52210
- if (!this.CalculateTextSize(aryText, this.Font, outSize)) return;
52276
+ if (!outSize) return;
52211
52277
 
52212
52278
  this.Canvas.textAlign='left';
52213
52279
  this.Canvas.textBaseline='bottom';
@@ -90862,32 +90928,6 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
90862
90928
  }
90863
90929
  }
90864
90930
 
90865
- this.TryClickLock=function(x,y)
90866
- {
90867
- for(var i=0;i<this.Frame.SubFrame.length; ++i)
90868
- {
90869
- var item=this.Frame.SubFrame[i];
90870
- var chartLock=item.Frame.LockPaint;
90871
- if (!chartLock || !chartLock.LockRect) continue;
90872
-
90873
- var tooltip=new TooltipData();
90874
- if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
90875
-
90876
- tooltip.HQChart=this;
90877
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
90878
- if (event && event.Callback)
90879
- {
90880
- var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
90881
- event.Callback(event,sendData,this);
90882
- }
90883
-
90884
- if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
90885
- return true;
90886
- }
90887
-
90888
- return false;
90889
- }
90890
-
90891
90931
  this.TryClickIndexTitle=function(x,y)
90892
90932
  {
90893
90933
  for(var i in this.TitlePaint)
@@ -100694,34 +100734,6 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
100694
100734
 
100695
100735
  return false;
100696
100736
  }
100697
-
100698
- this.TryClickLock=function(x,y)
100699
- {
100700
- for(var i=0;i<this.Frame.SubFrame.length; ++i)
100701
- {
100702
- var item=this.Frame.SubFrame[i];
100703
- var chartLock=item.Frame.LockPaint;
100704
- if (!chartLock || !chartLock.LockRect) continue;
100705
-
100706
- var tooltip=new TooltipData();
100707
- if (!chartLock.GetTooltipData(x,y,tooltip)) continue;
100708
-
100709
- tooltip.HQChart=this;
100710
-
100711
- var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_INDEX_LOCK);
100712
- if (event && event.Callback)
100713
- {
100714
- var sendData={ FrameID:item.Frame.Identify, Data:tooltip };
100715
- event.Callback(event,sendData,this);
100716
- }
100717
-
100718
-
100719
- if (tooltip.Data.Callback) tooltip.Data.Callback(tooltip);
100720
- return true;
100721
- }
100722
-
100723
- return false;
100724
- }
100725
100737
  }
100726
100738
 
100727
100739
  //盘前数据
@@ -102673,6 +102685,7 @@ function KLineChartHScreenContainer(uielement)
102673
102685
  frame.RightSpaceCount=this.RightSpaceCount; //右边
102674
102686
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
102675
102687
  frame.GlobalOption=this.GlobalOption;
102688
+ frame.CreateLockPaint();
102676
102689
 
102677
102690
  frame.HorizontalMax=20;
102678
102691
  frame.HorizontalMin=10;
@@ -102861,6 +102874,7 @@ function MinuteChartHScreenContainer(uielement)
102861
102874
  frame.XPointCount=243;
102862
102875
  frame.HQChart=this;
102863
102876
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
102877
+ frame.CreateLockPaint();
102864
102878
 
102865
102879
  var DEFAULT_HORIZONTAL=[9,8,7,6,5,4,3,2,1];
102866
102880
  frame.HorizontalMax=DEFAULT_HORIZONTAL[0];
@@ -109636,8 +109650,6 @@ function JSDivFrameToolbar()
109636
109650
  this.SetToolbar(aryButton); //重新设置按钮
109637
109651
  }
109638
109652
 
109639
-
109640
-
109641
109653
  this.Destroy=function()
109642
109654
  {
109643
109655
  if (this.DivToolbar)
@@ -109819,6 +109831,37 @@ JSDivFrameToolbar.GetDfaultButtons=function()
109819
109831
  }
109820
109832
 
109821
109833
 
109834
+
109835
+ //DOM工厂类
109836
+ function JSDOMFactory()
109837
+ {
109838
+ //[key:name, { Create:function(divElement) { return new class(divElement); }} ]
109839
+ this.DataMap=new Map(
109840
+ [
109841
+ ["JSDivFrameToolbar", { Create:function(option) { return new JSDivFrameToolbar(option); } }],
109842
+ ]);
109843
+
109844
+ this.Create=function(name, option)
109845
+ {
109846
+ if (!this.DataMap.has(name))
109847
+ {
109848
+ JSConsole.Chart.Warn(`[JSDOMFactory::Create] can't find class=${name}.`);
109849
+ return null;
109850
+ }
109851
+
109852
+ var item=this.DataMap.get(name);
109853
+ return item.Create(option);
109854
+ }
109855
+
109856
+ this.Add=function(name, option)
109857
+ {
109858
+ this.DataMap.set(name, { Create:option.Create } );
109859
+ }
109860
+ }
109861
+
109862
+ var g_JSDOMFactory=new JSDOMFactory();
109863
+
109864
+
109822
109865
  function JSToolbarTooltip()
109823
109866
  {
109824
109867
  this.DivTooltip=null;
@@ -165100,11 +165143,7 @@ JSDialogSearchIndex.GetDefaultIndexData=function()
165100
165143
  [
165101
165144
  { Name:"收盘线(后台指标)", ID:"API-DRAWTEXTREL", Type:2, Args:null },
165102
165145
  { Name:"高低均价(自定义脚本)", ID:"HIGH_LOW_AV", Type:1, Script:"均价:(H+L)/2;高:H;低:L;", Args:[ { Name:'N', Value:20}, { Name:'M', Value:6}]},
165103
- {
165104
- Name:"波段量能跟庄-波段量能", ID:"TEST_INDEX_4AE0_1", Type:1, Args:null,
165105
- Script:TEST_INDEX_4AE0_1,
165106
- Lock:{ IsLocked:true }
165107
- }
165146
+ { Name:"指标异常(后台指标)", ID:"API_ERRORMESSAGE", Type:2, Args:null,}
165108
165147
  ]
165109
165148
  },
165110
165149
  {
@@ -165758,7 +165797,7 @@ function HQChartScriptWorker()
165758
165797
 
165759
165798
 
165760
165799
 
165761
- var HQCHART_VERSION="1.1.15110";
165800
+ var HQCHART_VERSION="1.1.15120";
165762
165801
 
165763
165802
  function PrintHQChartVersion()
165764
165803
  {
@@ -165925,6 +165964,7 @@ export default {
165925
165964
  JSCHART_MENU_ID:JSCHART_MENU_ID,
165926
165965
  JSCHART_TRADE_STATUS_ID:JSCHART_TRADE_STATUS_ID, //交易状态
165927
165966
  JSCHART_CORSSCURSOR_STATUS_ID:JSCHART_CORSSCURSOR_STATUS_ID, //十字光标状态
165967
+ CONDITION_PERIOD:CONDITION_PERIOD, //指标周期条件枚举
165928
165968
  },
165929
165969
 
165930
165970