hqchart 1.1.13245 → 1.1.13251

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.
@@ -13149,19 +13149,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13149
13149
  this.Draw();
13150
13150
  break;
13151
13151
  case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13152
- var StockChip=chart.GetExtendChartByClassName('StockChip');
13152
+ var StockChip=this.GetExtendChartByClassName('StockChip');
13153
13153
  if (StockChip)
13154
13154
  {
13155
13155
  var chipWidth=StockChip.Chart.Width;
13156
- var chipIndex=parseInt(StockChip.Index);
13157
- for(var i=chipIndex+1; i<this.ExtendChartPaint.length; ++i) //在筹码后面创建的需要筹码的宽度
13158
- {
13159
- var item=this.ExtendChartPaint[i];
13160
- if (item.ClassName=='DrawToolsButton')
13161
- {
13162
- item.Left-=chipWidth;
13163
- }
13164
- }
13165
13156
  this.DeleteExtendChart(StockChip);
13166
13157
  this.Frame.ChartBorder.Right-=chipWidth;
13167
13158
  this.SetSizeChange(true);
@@ -13533,6 +13524,7 @@ function CoordinateInfo()
13533
13524
  this.ExtendData; //扩展属性
13534
13525
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
13535
13526
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
13527
+ this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
13536
13528
  }
13537
13529
 
13538
13530
 
@@ -16047,6 +16039,91 @@ function AverageWidthFrame()
16047
16039
  }
16048
16040
  }
16049
16041
 
16042
+ this.DrawCustomAreaItem=function(item) //自定义Y轴区域
16043
+ {
16044
+ if (!item.AreaData) return;
16045
+ if (this.IsHScreen) return; //暂时不支持横屏
16046
+
16047
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
16048
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
16049
+
16050
+ var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
16051
+ var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);
16052
+ if (min>=this.HorizontalMax) return;
16053
+ if (max<=this.HorizontalMin) return;
16054
+
16055
+ if (max>this.HorizontalMax) max=this.HorizontalMax;
16056
+ if (min<this.HorizontalMin) min=this.HorizontalMin;
16057
+
16058
+ var border=this.GetBorder();
16059
+ var left=border.Left;
16060
+ var right=border.Right;
16061
+ var borderRight = this.ChartBorder.Right;
16062
+ var borderLeft = this.ChartBorder.Left;
16063
+
16064
+ var yTop=this.GetYFromData(max);
16065
+ var yBottom=this.GetYFromData(min);
16066
+
16067
+ if (item.AreaData.Position.includes(0) && borderLeft>10) //左
16068
+ {
16069
+ var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
16070
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
16071
+ rtBG.Width=rtBG.Right-rtBG.Left;
16072
+ this.Canvas.fillStyle=item.AreaData.BGColor;
16073
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
16074
+ this.DrawCustomAreaText(rtBG, item, 0);
16075
+ }
16076
+
16077
+ if (item.AreaData.Position.includes(1) && borderRight>10) //右
16078
+ {
16079
+ var rtBG={ Left:right+1, Top:yTop, Bottom:yBottom };
16080
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
16081
+ if (this.YRightTextInfo && IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth)) //右侧自动调整 可以获取宽度
16082
+ {
16083
+ rtBG.Width=this.YRightTextInfo.MainTextWidth-1;
16084
+ rtBG.Right=rtBG.Left+rtBG.Width;
16085
+ }
16086
+ else
16087
+ {
16088
+ rtBG.Right=border.ChartWidth;
16089
+ rtBG.Width=rtBG.Right-rtBG.Left;
16090
+ }
16091
+
16092
+ this.Canvas.fillStyle=item.AreaData.BGColor;
16093
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
16094
+ this.DrawCustomAreaText(rtBG, item, 1);
16095
+ }
16096
+ }
16097
+
16098
+ this.DrawCustomAreaText=function(rtBG, item, position) //position 0=左 1=右
16099
+ {
16100
+ if (item.Font != null) this.Canvas.font = item.Font;
16101
+ var fontHeight=this.GetFontHeight();
16102
+ if (rtBG.Height<fontHeight) return;
16103
+
16104
+ var pixelTatio = GetDevicePixelRatio();
16105
+ var text, xText;
16106
+ if (position==0)
16107
+ {
16108
+ if (!item.Message[0]) return;
16109
+ this.Canvas.textAlign = "right";
16110
+ text=item.Message[0];
16111
+ xText=rtBG.Right-2*pixelTatio;
16112
+ }
16113
+ else if (position==1)
16114
+ {
16115
+ if (!item.Message[1]) return;
16116
+ this.Canvas.textAlign = "left";
16117
+ text=item.Message[1];
16118
+ xText=rtBG.Left+2*pixelTatio
16119
+ }
16120
+
16121
+ var yText=rtBG.Top+rtBG.Height/2;
16122
+ this.Canvas.textBaseline = "middle";
16123
+ this.Canvas.fillStyle = item.TextColor;
16124
+ this.Canvas.fillText(text, xText, yText);
16125
+ }
16126
+
16050
16127
  this.SendDrawCountDownEvent=function(sendData)
16051
16128
  {
16052
16129
  if (!this.GetEventCallback) return false;
@@ -19598,6 +19675,9 @@ function KLineFrame()
19598
19675
  case 4: //叠加K线涨幅刻度
19599
19676
  this.DrawCustomItem(item, mapTextRect);
19600
19677
  break;
19678
+ case 5:
19679
+ this.DrawCustomAreaItem(item);
19680
+ break;
19601
19681
  }
19602
19682
  }
19603
19683
  }
@@ -76706,7 +76786,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76706
76786
 
76707
76787
  { Name:"背景分割", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID, Args:[!bBGSpit]}, Checked:bBGSpit},
76708
76788
 
76709
- { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
76789
+ { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
76710
76790
 
76711
76791
  { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
76712
76792
  ]
@@ -131875,7 +131955,7 @@ function ScrollBarBGChart()
131875
131955
 
131876
131956
 
131877
131957
 
131878
- var HQCHART_VERSION="1.1.13244";
131958
+ var HQCHART_VERSION="1.1.13250";
131879
131959
 
131880
131960
  function PrintHQChartVersion()
131881
131961
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13244";
8
+ var HQCHART_VERSION="1.1.13250";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -13193,19 +13193,10 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13193
13193
  this.Draw();
13194
13194
  break;
13195
13195
  case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13196
- var StockChip=chart.GetExtendChartByClassName('StockChip');
13196
+ var StockChip=this.GetExtendChartByClassName('StockChip');
13197
13197
  if (StockChip)
13198
13198
  {
13199
13199
  var chipWidth=StockChip.Chart.Width;
13200
- var chipIndex=parseInt(StockChip.Index);
13201
- for(var i=chipIndex+1; i<this.ExtendChartPaint.length; ++i) //在筹码后面创建的需要筹码的宽度
13202
- {
13203
- var item=this.ExtendChartPaint[i];
13204
- if (item.ClassName=='DrawToolsButton')
13205
- {
13206
- item.Left-=chipWidth;
13207
- }
13208
- }
13209
13200
  this.DeleteExtendChart(StockChip);
13210
13201
  this.Frame.ChartBorder.Right-=chipWidth;
13211
13202
  this.SetSizeChange(true);
@@ -13577,6 +13568,7 @@ function CoordinateInfo()
13577
13568
  this.ExtendData; //扩展属性
13578
13569
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
13579
13570
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
13571
+ this.AreaData; //区域: { Start:, End:, BGColor:, Position:[0=左, 1=右] }
13580
13572
  }
13581
13573
 
13582
13574
 
@@ -16091,6 +16083,91 @@ function AverageWidthFrame()
16091
16083
  }
16092
16084
  }
16093
16085
 
16086
+ this.DrawCustomAreaItem=function(item) //自定义Y轴区域
16087
+ {
16088
+ if (!item.AreaData) return;
16089
+ if (this.IsHScreen) return; //暂时不支持横屏
16090
+
16091
+ //item.AreaData; //区域: { Value[], BGColor:, Position:[0=左, 1=右] }
16092
+ if (!IFrameSplitOperator.IsNonEmptyArray(item.AreaData.Value) || item.AreaData.Value.length!=2) return;
16093
+
16094
+ var max=Math.max(item.AreaData.Value[0],item.AreaData.Value[1]);
16095
+ var min=Math.min(item.AreaData.Value[0],item.AreaData.Value[1]);
16096
+ if (min>=this.HorizontalMax) return;
16097
+ if (max<=this.HorizontalMin) return;
16098
+
16099
+ if (max>this.HorizontalMax) max=this.HorizontalMax;
16100
+ if (min<this.HorizontalMin) min=this.HorizontalMin;
16101
+
16102
+ var border=this.GetBorder();
16103
+ var left=border.Left;
16104
+ var right=border.Right;
16105
+ var borderRight = this.ChartBorder.Right;
16106
+ var borderLeft = this.ChartBorder.Left;
16107
+
16108
+ var yTop=this.GetYFromData(max);
16109
+ var yBottom=this.GetYFromData(min);
16110
+
16111
+ if (item.AreaData.Position.includes(0) && borderLeft>10) //左
16112
+ {
16113
+ var rtBG={ Left:0, Right:left-1, Top:yTop, Bottom:yBottom };
16114
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
16115
+ rtBG.Width=rtBG.Right-rtBG.Left;
16116
+ this.Canvas.fillStyle=item.AreaData.BGColor;
16117
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
16118
+ this.DrawCustomAreaText(rtBG, item, 0);
16119
+ }
16120
+
16121
+ if (item.AreaData.Position.includes(1) && borderRight>10) //右
16122
+ {
16123
+ var rtBG={ Left:right+1, Top:yTop, Bottom:yBottom };
16124
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
16125
+ if (this.YRightTextInfo && IFrameSplitOperator.IsNumber(this.YRightTextInfo.MainTextWidth)) //右侧自动调整 可以获取宽度
16126
+ {
16127
+ rtBG.Width=this.YRightTextInfo.MainTextWidth-1;
16128
+ rtBG.Right=rtBG.Left+rtBG.Width;
16129
+ }
16130
+ else
16131
+ {
16132
+ rtBG.Right=border.ChartWidth;
16133
+ rtBG.Width=rtBG.Right-rtBG.Left;
16134
+ }
16135
+
16136
+ this.Canvas.fillStyle=item.AreaData.BGColor;
16137
+ this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
16138
+ this.DrawCustomAreaText(rtBG, item, 1);
16139
+ }
16140
+ }
16141
+
16142
+ this.DrawCustomAreaText=function(rtBG, item, position) //position 0=左 1=右
16143
+ {
16144
+ if (item.Font != null) this.Canvas.font = item.Font;
16145
+ var fontHeight=this.GetFontHeight();
16146
+ if (rtBG.Height<fontHeight) return;
16147
+
16148
+ var pixelTatio = GetDevicePixelRatio();
16149
+ var text, xText;
16150
+ if (position==0)
16151
+ {
16152
+ if (!item.Message[0]) return;
16153
+ this.Canvas.textAlign = "right";
16154
+ text=item.Message[0];
16155
+ xText=rtBG.Right-2*pixelTatio;
16156
+ }
16157
+ else if (position==1)
16158
+ {
16159
+ if (!item.Message[1]) return;
16160
+ this.Canvas.textAlign = "left";
16161
+ text=item.Message[1];
16162
+ xText=rtBG.Left+2*pixelTatio
16163
+ }
16164
+
16165
+ var yText=rtBG.Top+rtBG.Height/2;
16166
+ this.Canvas.textBaseline = "middle";
16167
+ this.Canvas.fillStyle = item.TextColor;
16168
+ this.Canvas.fillText(text, xText, yText);
16169
+ }
16170
+
16094
16171
  this.SendDrawCountDownEvent=function(sendData)
16095
16172
  {
16096
16173
  if (!this.GetEventCallback) return false;
@@ -19642,6 +19719,9 @@ function KLineFrame()
19642
19719
  case 4: //叠加K线涨幅刻度
19643
19720
  this.DrawCustomItem(item, mapTextRect);
19644
19721
  break;
19722
+ case 5:
19723
+ this.DrawCustomAreaItem(item);
19724
+ break;
19645
19725
  }
19646
19726
  }
19647
19727
  }
@@ -76750,7 +76830,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
76750
76830
 
76751
76831
  { Name:"背景分割", Data:{ ID:JSCHART_MENU_ID.CMD_CHANGE_BG_SPLIT_ID, Args:[!bBGSpit]}, Checked:bBGSpit},
76752
76832
 
76753
- { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog()},
76833
+ { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
76754
76834
 
76755
76835
  { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
76756
76836
  ]
@@ -134423,6 +134503,8 @@ function JSPopMenu()
134423
134503
  {
134424
134504
  var trDom=document.createElement("tr");
134425
134505
  trDom.className='UMyChart_MenuItem_Tr';
134506
+
134507
+ if (item.Disable===true) trDom.classList.add('UMyChart_DrawTool_Disable_Tr');
134426
134508
 
134427
134509
  var prtTdDom=null;
134428
134510
  for(var i=0;i<this.AryTDClassName.length;++i)
@@ -134498,8 +134580,15 @@ function JSPopMenu()
134498
134580
  }
134499
134581
  else
134500
134582
  {
134501
- trDom.onmousedown=(e)=> { this.OnClickMenu(e, item, false); }; //菜单点击
134502
- trDom.onmouseover=(e)=>{ this.OnMouseOver(e, parentItem); }
134583
+ if (item.Disable===true)
134584
+ {
134585
+
134586
+ }
134587
+ else
134588
+ {
134589
+ trDom.onmousedown=(e)=> { this.OnClickMenu(e, item, false); }; //菜单点击
134590
+ trDom.onmouseover=(e)=>{ this.OnMouseOver(e, parentItem); }
134591
+ }
134503
134592
  }
134504
134593
 
134505
134594
  return trDom;
@@ -134633,6 +134722,8 @@ function JSPopMenu()
134633
134722
  subMenu.style.left=`${x}px`;
134634
134723
  subMenu.style.top=`${y}px`;
134635
134724
 
134725
+
134726
+
134636
134727
  trDom.classList.add(this.SelectedClassName);
134637
134728
 
134638
134729
  /*
@@ -135223,7 +135314,7 @@ function HQChartScriptWorker()
135223
135314
 
135224
135315
 
135225
135316
 
135226
- var HQCHART_VERSION="1.1.13244";
135317
+ var HQCHART_VERSION="1.1.13250";
135227
135318
 
135228
135319
  function PrintHQChartVersion()
135229
135320
  {