hqchart 1.1.14258 → 1.1.14274

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.
@@ -2758,6 +2758,8 @@ var JSCHART_BUTTON_ID=
2758
2758
  INDEX_NAME_BUTTON:43,
2759
2759
 
2760
2760
  ADD_INDEX_WINDOW:44, //增加指标窗口
2761
+
2762
+ CHIP_CLOSE:45, //关闭筹码图
2761
2763
  }
2762
2764
 
2763
2765
  var JSCHART_DATA_FIELD_ID=
@@ -4842,6 +4844,34 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4842
4844
 
4843
4845
  }
4844
4846
 
4847
+ this.TryPhoneClickButton=function(x,y,e)
4848
+ {
4849
+ if (this.TryClickLock || this.TryClickIndexTitle) //指标枷锁区域 , 指标标题点击
4850
+ {
4851
+ if (this.TryClickLock && this.TryClickLock(x, y)) return true;
4852
+ if (this.TryClickIndexTitle && this.TryClickIndexTitle(x,y)) return true;
4853
+ }
4854
+
4855
+ if (this.ClickFrameButton)
4856
+ {
4857
+ var button=this.Frame.PtInButtons(x,y);
4858
+ if (button)
4859
+ {
4860
+ this.ClickFrameButton(button, e);
4861
+ return true;
4862
+ }
4863
+ }
4864
+
4865
+ button=this.PtInExtendChartButtons(x,y);
4866
+ if (button && this.ClickExtendChartButton)
4867
+ {
4868
+ this.ClickExtendChartButton(button, e);
4869
+ return true;
4870
+ }
4871
+
4872
+ return false;
4873
+ }
4874
+
4845
4875
  this.OnTouchStart=function(e)
4846
4876
  {
4847
4877
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
@@ -4864,23 +4894,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
4864
4894
  var touches = this.GetToucheData(e, this.IsForceLandscape);
4865
4895
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
4866
4896
 
4867
- if (this.TryClickLock || this.TryClickIndexTitle) //指标枷锁区域 , 指标标题点击
4868
- {
4869
- var x = pt.X;
4870
- var y = pt.Y;
4871
- if (this.TryClickLock && this.TryClickLock(x, y)) return;
4872
- if (this.TryClickIndexTitle && this.TryClickIndexTitle(x,y)) return;
4873
- }
4874
-
4875
- if (this.ClickFrameButton)
4876
- {
4877
- var button=this.Frame.PtInButtons(pt.X,pt.Y);
4878
- if (button)
4879
- {
4880
- this.ClickFrameButton(button, e);
4881
- return;
4882
- }
4883
- }
4897
+ if (this.TryPhoneClickButton(pt.X, pt.Y, e)) return;
4884
4898
 
4885
4899
  if (this.EnableVerticalDrag )
4886
4900
  {
@@ -44761,8 +44775,12 @@ function StockChipPhone()
44761
44775
  //手机端没有按钮
44762
44776
  this.DrawToolbar=function(moveonPoint, mouseStatus) { }
44763
44777
 
44778
+ this.CloseButtonConfig=CloneData(g_JSChartResource.StockChip.PhoneCloseButton);
44779
+
44780
+
44764
44781
  this.Draw=function()
44765
44782
  {
44783
+ this.Buttons=[];
44766
44784
  this.IsHScreen=this.ChartFrame.IsHScreen==true;
44767
44785
  this.PixelRatio=GetDevicePixelRatio();
44768
44786
  if (this.IsHScreen)
@@ -44805,6 +44823,7 @@ function StockChipPhone()
44805
44823
  }
44806
44824
 
44807
44825
  this.DrawBorder();
44826
+ this.DrawCloseButton();
44808
44827
  this.SizeChange=false;
44809
44828
  }
44810
44829
 
@@ -45167,6 +45186,73 @@ function StockChipPhone()
45167
45186
 
45168
45187
  this.Canvas.fill();
45169
45188
  }
45189
+
45190
+ //关闭按钮
45191
+ this.DrawCloseButton=function()
45192
+ {
45193
+ var config=this.CloseButtonConfig;
45194
+ var font=`${config.Size}px ${config.Family}`;
45195
+ var rtButton=null;
45196
+ if (this.IsHScreen)
45197
+ {
45198
+ var border=this.ChartBorder.GetHScreenBorder();
45199
+ var right=border.Left-2;
45200
+ var bottom=border.ChartHeight-2;
45201
+ var left=right-config.Size;
45202
+ var top=bottom-config.Size;
45203
+
45204
+ var rtButton={ Left:left, Top:top, Bottom:bottom, Right:right };
45205
+ rtButton.Width=rtButton.Right-rtButton.Left;
45206
+ rtButton.Height=rtButton.Bottom-rtButton.Top;
45207
+ }
45208
+ else
45209
+ {
45210
+ var border=this.ChartBorder.GetBorder();
45211
+ var top=border.Bottom+2;
45212
+ var bottom=top+config.Size;
45213
+ var right=border.ChartWidth-2;
45214
+ var left=right-config.Size;
45215
+
45216
+ var rtButton={ Left:left, Top:top, Bottom:bottom, Right:right };
45217
+ rtButton.Width=rtButton.Right-rtButton.Left;
45218
+ rtButton.Height=rtButton.Bottom-rtButton.Top;
45219
+ }
45220
+
45221
+ if (!rtButton) return;
45222
+
45223
+ if (config.Border)
45224
+ {
45225
+ if (config.Border.BGColor)
45226
+ {
45227
+ this.Canvas.fillStyle=config.Border.BGColor;
45228
+ this.Canvas.fillRect(rtButton.Left,rtButton.Top,rtButton.Width,rtButton.Height);
45229
+ }
45230
+ }
45231
+
45232
+ this.Canvas.fillStyle=config.Color;
45233
+ this.Canvas.font=font;
45234
+ this.Canvas.textAlign="left";
45235
+ this.Canvas.textBaseline="bottom";
45236
+ if (this.IsHScreen)
45237
+ {
45238
+ var radius=config.Size/2;
45239
+ var x=rtButton.Left+radius, y=rtButton.Bottom-radius;
45240
+ this.Canvas.save();
45241
+ this.Canvas.translate(x,y);
45242
+ this.Canvas.rotate(90 * Math.PI / 180);
45243
+ this.Canvas.fillText(config.Text,-radius,radius);
45244
+ this.Canvas.restore();
45245
+
45246
+ }
45247
+ else
45248
+ {
45249
+ this.Canvas.fillText(config.Text, rtButton.Left, rtButton.Bottom);
45250
+ }
45251
+
45252
+ var btnItem={ ID:JSCHART_BUTTON_ID.CHIP_CLOSE, Rect:rtButton };
45253
+ this.Buttons.push(btnItem);
45254
+
45255
+ }
45170
45256
  }
45171
45257
 
45172
45258
  //窗口分割
@@ -48848,6 +48934,10 @@ IFrameSplitOperator.FormatDateString=function(value,format, languageID)
48848
48934
  {
48849
48935
  case 'MM-DD':
48850
48936
  return IFrameSplitOperator.NumberToString(month) + '-' + IFrameSplitOperator.NumberToString(day);
48937
+ case "MM-DD/W":
48938
+ var date=new Date(year,month-1,day);
48939
+ var week=g_JSChartLocalization.GetText(WEEK_NAME[date.getDay()],languageID);
48940
+ return `${IFrameSplitOperator.NumberToString(month)}-${IFrameSplitOperator.NumberToString(day)}/${week}`;
48851
48941
  case "MM/DD":
48852
48942
  return `${IFrameSplitOperator.NumberToString(month)}/${IFrameSplitOperator.NumberToString(day)}`;
48853
48943
  case "MM/DD/W":
@@ -70401,6 +70491,16 @@ function JSChartResource()
70401
70491
  Size:13*GetDevicePixelRatio(),
70402
70492
  MerginLeft:4
70403
70493
  },
70494
+
70495
+ //手机端
70496
+ PhoneCloseButton:
70497
+ {
70498
+ Family:"iconfont",
70499
+ Size:16*GetDevicePixelRatio(),
70500
+ Text:"\ue60c",
70501
+ Color:"rgb(255,255,255)",
70502
+ Border:{ BGColor:"rgb(169,169,169)" }
70503
+ }
70404
70504
  }
70405
70505
 
70406
70506
  //深度图
@@ -70535,7 +70635,7 @@ function JSChartResource()
70535
70635
  Size:12, Family:"iconfont",
70536
70636
  Arrow:[null, "\ue6b2", "\ue6b1"], //[0]=默认排序的图标背景色
70537
70637
  Color:[null, "rgb(255,0,0)", "rgb(255,0,0)"],
70538
- Margin:{ Left:0, Bottom:6 }
70638
+ Margin:{ Left:0, Bottom:2, Right:0,}
70539
70639
  },
70540
70640
 
70541
70641
  Item:
@@ -71319,6 +71419,20 @@ function JSChartResource()
71319
71419
  if (item.DefaultButton) T_SetButtonStyle(item.DefaultButton, this.StockChip.DefaultButton);
71320
71420
  if (item.LongButton) T_SetButtonStyle(item.LongButton, this.StockChip.LongButton);
71321
71421
  if (item.RecentButton) T_SetButtonStyle(item.RecentButton, this.StockChip.RecentButton);
71422
+ if (item.CloseButton) T_SetButtonStyle(item.CloseButton, this.StockChip.CloseButton);
71423
+
71424
+ if (item.PhoneCloseButton)
71425
+ {
71426
+ var subItem=item.PhoneCloseButton;
71427
+ if (subItem.Family) this.StockChip.PhoneCloseButton.Family=subItem.Family;
71428
+ if (subItem.Text) this.StockChip.PhoneCloseButton.Text=subItem.Text;
71429
+ if (subItem.Color) this.StockChip.PhoneCloseButton.Color=subItem.Color;
71430
+ if (IFrameSplitOperator.IsNumber(subItem.Size)) this.StockChip.PhoneCloseButton.Size=subItem.Size;
71431
+ if (subItem.Border)
71432
+ {
71433
+ if (subItem.Border.BGColor) this.StockChip.PhoneCloseButton.Border.BGColor=subItem.Border.BGColor;
71434
+ }
71435
+ }
71322
71436
  }
71323
71437
 
71324
71438
  if (style.DepthChart)
@@ -80565,6 +80679,10 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
80565
80679
  button.Chart.ShowType=2;
80566
80680
  this.Draw();
80567
80681
  }
80682
+ else if (button.ID==JSCHART_BUTTON_ID.CHIP_CLOSE)
80683
+ {
80684
+ if (this.DeleteStockChipChart) this.DeleteStockChipChart();
80685
+ }
80568
80686
  }
80569
80687
 
80570
80688
  //成交量分布图数据请求
@@ -88165,6 +88283,9 @@ function KLineChartHScreenContainer(uielement)
88165
88283
  var touches = this.GetToucheData(e, false);
88166
88284
  var pt=this.PointAbsoluteToRelative(touches[0].clientX, touches[0].clientY, true);
88167
88285
 
88286
+ if (this.TryPhoneClickButton(pt.X,pt.Y,e)) return;
88287
+
88288
+ /*
88168
88289
  if (this.TryClickLock || this.TryClickIndexTitle) //指标枷锁区域, 指标标题点击
88169
88290
  {
88170
88291
  var x = pt.X;
@@ -88182,6 +88303,7 @@ function KLineChartHScreenContainer(uielement)
88182
88303
  return;
88183
88304
  }
88184
88305
  }
88306
+ */
88185
88307
 
88186
88308
  if (this.EnableVerticalDrag )
88187
88309
  {