hqchart 1.1.14394 → 1.1.14404

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.
@@ -4876,6 +4876,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4876
4876
  }
4877
4877
  }
4878
4878
 
4879
+ if (option.EnableYDrag)
4880
+ {
4881
+ var item=option.EnableYDrag;
4882
+ if (IFrameSplitOperator.IsBool(item.Left)) chart.EnableYDrag.Left=item.Left;
4883
+ if (IFrameSplitOperator.IsBool(item.Right)) chart.EnableYDrag.Right=item.Right;
4884
+ if (IFrameSplitOperator.IsBool(item.Wheel)) chart.EnableYDrag.Wheel=item.Wheel;
4885
+ if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
4886
+ }
4887
+
4879
4888
  //分页
4880
4889
  if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
4881
4890
 
@@ -4951,7 +4960,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4951
4960
  }
4952
4961
  if (item.Height>=0) chart.Frame.SubFrame[i].Height = item.Height;
4953
4962
  if (item.Custom) chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;
4954
- if (item.RightTextFormat>0) chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;
4955
4963
  if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
4956
4964
  if (IFrameSplitOperator.IsNumber(item.BorderLine)) chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;
4957
4965
  if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;
@@ -4969,6 +4977,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4969
4977
 
4970
4978
  if (item.ClientBGColor) subFrame.ClientBGColor=item.ClientBGColor;
4971
4979
  if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) subFrame.HorizontalReserved=item.HorizontalReserved;
4980
+
4981
+ if (i==0)
4982
+ {
4983
+ if (IFrameSplitOperator.IsNumber(item.RightTextFormat))
4984
+ {
4985
+ subFrame.YSplitOperator.RightTextFormat=item.RightTextFormat;
4986
+ if (item.RightTextFormat==2) subFrame.MultiTextFormat=1;
4987
+ }
4988
+ }
4972
4989
  }
4973
4990
 
4974
4991
  chart.UpdateXShowText();
@@ -16361,7 +16378,7 @@ function AverageWidthFrame()
16361
16378
  var item=aryText[i];
16362
16379
  var message=item.Item;
16363
16380
 
16364
- this.Canvas.textBaseline=message.TextBaseline;
16381
+ this.Canvas.textBaseline=item.TextBaseline;
16365
16382
  if (message.ExtendData && message.ExtendData.Font) this.Canvas.font=message.ExtendData.Font;
16366
16383
  else if (message.Font) this.Canvas.font=message.Font;
16367
16384
 
@@ -17984,20 +18001,17 @@ function AverageWidthFrame()
17984
18001
 
17985
18002
  if (Array.isArray(item.Message[1]))
17986
18003
  {
17987
- if (this.MultiTextFormat==1) //显示1行 格式:价格/百分比
18004
+ if (this.MultiTextFormat==1 && IFrameSplitOperator.IsNonEmptyArray(item.Message[1])) //显示1行 格式:价格/百分比
17988
18005
  {
17989
- if (item.ExtendData)
17990
- {
17991
- if (item.ExtendData.Font) this.Canvas.font=item.ExtendData.Font;
17992
- var width1=this.Canvas.measureText(item.Message[1][0]).width;
17993
- var width2=this.Canvas.measureText(item.Message[1][1]).width;
17994
- var width3=this.Canvas.measureText('/').width;
17995
- textWidth=width1+width3;
17996
-
17997
- if (rightExtendWidth<width2) rightExtendWidth=width2;
18006
+ if (item.ExtendData && item.ExtendData.Font) this.Canvas.font=item.ExtendData.Font;
18007
+
18008
+ var width1=this.Canvas.measureText(item.Message[1][0]).width;
18009
+ var width2=this.Canvas.measureText(item.Message[1][1]).width;
18010
+ var width3=this.Canvas.measureText('/').width;
18011
+ textWidth=width1+width3;
18012
+ if (rightExtendWidth<width2) rightExtendWidth=width2;
17998
18013
 
17999
- //JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
18000
- }
18014
+ //JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
18001
18015
  }
18002
18016
  else if (this.MultiTextFormat==2) //显示2行
18003
18017
  {
@@ -41022,7 +41036,7 @@ function ChartMinutePriceLine()
41022
41036
  if (value==null) continue;
41023
41037
 
41024
41038
  var x=this.ChartFrame.GetXFromIndex(j);
41025
- var y=this.ChartFrame.GetYFromData(value);
41039
+ var y=this.ChartFrame.GetYFromData(value,false);
41026
41040
 
41027
41041
  if (bFirstPoint)
41028
41042
  {
@@ -56259,7 +56273,7 @@ function FrameSplitMinutePriceY()
56259
56273
  this.DefaultSplitType=0;
56260
56274
  this.LimitPrice; //{Max: Min:} 涨跌停价
56261
56275
  this.Custom;
56262
- this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格
56276
+ this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格 2=价格 | 百分比
56263
56277
 
56264
56278
  this.BeforeOpenData;
56265
56279
  this.IsBeforeData=false;
@@ -56275,9 +56289,12 @@ function FrameSplitMinutePriceY()
56275
56289
  this.GlobalOption;
56276
56290
  this.HQChart;
56277
56291
 
56292
+ this.FixedYMaxMin; //{ Max, Min} 固定Y轴最大最小值
56293
+ this.EnableZoomUpDown=false;
56294
+
56278
56295
  this.IsEnableDragY=function()
56279
56296
  {
56280
- return false;
56297
+ return true;
56281
56298
  }
56282
56299
 
56283
56300
  this.Operator=function()
@@ -56286,23 +56303,35 @@ function FrameSplitMinutePriceY()
56286
56303
  this.Frame.CustomHorizontalInfo=[];
56287
56304
  if (!this.Data) return;
56288
56305
 
56289
- var range=this.GetMaxMin();
56306
+ var range=null;
56307
+ var isFixedMaxMin=(this.FixedYMaxMin && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Max) && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Min));
56308
+ if (isFixedMaxMin)
56309
+ {
56310
+ range={ Max:this.FixedYMaxMin.Max, Min:this.FixedYMaxMin.Min };
56311
+ JSConsole.Chart.Log(`[FrameSplitMinutePriceY::Operator] FixedYMaxMin.Max=${this.FixedYMaxMin.Max} FixedYMaxMin.Min=${this.FixedYMaxMin.Min} `);
56312
+ }
56313
+ else
56314
+ {
56315
+ range=this.GetMaxMin();
56316
+ }
56290
56317
 
56291
56318
  if (this.Symbol && MARKET_SUFFIX_NAME.IsUSA(this.Symbol.toUpperCase()))
56292
56319
  {
56293
- this.USASplit(range);
56320
+ this.USASplit(range,isFixedMaxMin);
56294
56321
  }
56295
56322
  else if (this.SplitType==2)
56296
56323
  {
56297
- this.USASplit(range);
56324
+ this.USASplit(range,isFixedMaxMin);
56298
56325
  }
56299
56326
  else
56300
56327
  {
56301
- this.DefaultSplit(range);
56328
+ this.DefaultSplit(range,isFixedMaxMin);
56302
56329
  }
56303
56330
 
56304
56331
  this.CustomCoordinate();
56305
56332
 
56333
+ if (this.EnableZoomUpDown==true && !this.FixedYMaxMin) this.FixedYMaxMin={ Max:range.Max, Min:range.Min };
56334
+
56306
56335
  this.ReservedHeight({ Max:this.Frame.HorizontalMax, Min:this.Frame.HorizontalMin }); //预留高度
56307
56336
 
56308
56337
  if (this.GetEventCallback)
@@ -56698,10 +56727,21 @@ function FrameSplitMinutePriceY()
56698
56727
  var per=(price/this.YClose-1)*100;
56699
56728
  if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
56700
56729
  else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
56730
+ var strPer=IFrameSplitOperator.FormatValueString(per,2)+'%';
56701
56731
  if (this.IsShowRightText)
56702
56732
  {
56703
- if (this.RightTextFormat==1) coordinate.Message[1]=strPrice;
56704
- else coordinate.Message[1]=IFrameSplitOperator.FormatValueString(per,2)+'%'; //百分比
56733
+ if (this.RightTextFormat==1)
56734
+ {
56735
+ coordinate.Message[1]=strPrice;
56736
+ }
56737
+ else if (this.RightTextFormat==2) //价格/百分比
56738
+ {
56739
+ coordinate.Message[1]=[strPrice,strPer];
56740
+ }
56741
+ else
56742
+ {
56743
+ coordinate.Message[1]=strPer; //百分比
56744
+ }
56705
56745
  }
56706
56746
  }
56707
56747
 
@@ -56733,22 +56773,25 @@ function FrameSplitMinutePriceY()
56733
56773
  this.Frame.HorizontalMin=min;
56734
56774
  }
56735
56775
 
56736
- this.DefaultSplit=function(range)
56776
+ this.DefaultSplit=function(range,isFixedMaxMin)
56737
56777
  {
56738
56778
  var max=range.Max;
56739
56779
  var min=range.Min;
56740
56780
 
56741
- if (this.YClose==max && this.YClose==min)
56742
- {
56743
- max=this.YClose+this.YClose*0.1;
56744
- min=this.YClose-this.YClose*0.1
56745
- }
56746
- else
56781
+ if (!isFixedMaxMin)
56747
56782
  {
56748
- var distanceValue=Math.max(Math.abs(this.YClose-max),Math.abs(this.YClose-min));
56749
- max=this.YClose+distanceValue;
56750
- min=this.YClose-distanceValue;
56751
- if (min<0) min=range.Min;
56783
+ if (this.YClose==max && this.YClose==min)
56784
+ {
56785
+ max=this.YClose+this.YClose*0.1;
56786
+ min=this.YClose-this.YClose*0.1
56787
+ }
56788
+ else
56789
+ {
56790
+ var distanceValue=Math.max(Math.abs(this.YClose-max),Math.abs(this.YClose-min));
56791
+ max=this.YClose+distanceValue;
56792
+ min=this.YClose-distanceValue;
56793
+ if (min<0) min=range.Min;
56794
+ }
56752
56795
  }
56753
56796
 
56754
56797
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
@@ -56761,7 +56804,7 @@ function FrameSplitMinutePriceY()
56761
56804
  const minDistance=[1, 0.1, 0.01, 0.001, 0.0001];
56762
56805
  var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
56763
56806
  if (isPhoneModel && MARKET_SUFFIX_NAME.IsSHSZIndex(this.Symbol)) defaultfloatPrecision = 0; //手机端指数不显示小数位数,太长了
56764
- if (distance<minDistance[defaultfloatPrecision])
56807
+ if (distance<minDistance[defaultfloatPrecision] && !isFixedMaxMin)
56765
56808
  {
56766
56809
  distance=minDistance[defaultfloatPrecision];
56767
56810
  max=this.YClose+(distance*(showCount-1)/2);
@@ -56782,11 +56825,21 @@ function FrameSplitMinutePriceY()
56782
56825
  var per=(price/this.YClose-1)*100;
56783
56826
  if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
56784
56827
  else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
56785
-
56828
+ var strPer=`${IFrameSplitOperator.FormatValueString(per,2)}%`;
56786
56829
  if (this.IsShowRightText)
56787
56830
  {
56788
- if (this.RightTextFormat==1) coordinate.Message[1]=strPrice;
56789
- else coordinate.Message[1]=IFrameSplitOperator.FormatValueString(per,2)+'%'; //百分比
56831
+ if (this.RightTextFormat==1)
56832
+ {
56833
+ coordinate.Message[1]=strPrice;
56834
+ }
56835
+ else if (this.RightTextFormat==2) //价格/百分比
56836
+ {
56837
+ coordinate.Message[1]=[strPer,strPrice];
56838
+ }
56839
+ else
56840
+ {
56841
+ coordinate.Message[1]=strPer; //百分比
56842
+ }
56790
56843
  }
56791
56844
 
56792
56845
  if (Math.abs(price-this.YClose) <0.00000000001) //小数有精度问题 使用差值
@@ -87500,14 +87553,30 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87500
87553
  var moveSetp=moveData.X;
87501
87554
  var yMoveSetp=moveData.Y;
87502
87555
 
87503
- if (this.RectSelectDrag && this.RectSelectDrag.Index>=0) //区间选择
87556
+ var bNeedDraw=true;
87557
+ if (this.UpDownDrag && this.UpDownDrag.Index>=0)
87558
+ {
87559
+ if (yMoveSetp>=5)
87560
+ {
87561
+ var yMove=e.clientY-drag.LastMove.Y;
87562
+ JSConsole.Chart.Log("[MinuteChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
87563
+ //this.UIElement.style.cursor="pointer";
87564
+ this.SetCursor({Cursor:"pointer"});
87565
+ if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
87566
+ {
87567
+ drag.LastMove.Y=e.clientY;
87568
+ bNeedDraw=true;
87569
+ }
87570
+ }
87571
+ }
87572
+ else if (this.RectSelectDrag && this.RectSelectDrag.Index>=0) //区间选择
87504
87573
  {
87505
87574
  if (moveSetp<5) return;
87506
87575
  var obj={ X:e.clientX, Y:e.clientY, PointIndex:this.RectSelectDrag.Index, Name:"MoveRectSelectLine" };
87507
87576
  if (this.MoveRectSelectPoint(obj))
87508
87577
  {
87509
87578
  drag.LastMove.X=e.clientX;
87510
- this.Draw();
87579
+ bNeedDraw=true;
87511
87580
  }
87512
87581
  }
87513
87582
  else
@@ -87525,6 +87594,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87525
87594
  drag.LastMove.X=e.clientX;
87526
87595
  drag.LastMove.Y=e.clientY;
87527
87596
  }
87597
+
87598
+ if (bNeedDraw) this.Draw();
87528
87599
  }
87529
87600
 
87530
87601
  this.OnMinuteSelectRectMouseUp=function(e)
@@ -87542,8 +87613,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87542
87613
  selectData.YEnd=(drag.LastMove.Y-uielement.getBoundingClientRect().top)*pixelTatio;
87543
87614
  selectData.JSChartContainer=this;
87544
87615
  selectData.Stock={Symbol:this.Symbol, Name:this.Name};
87616
+
87617
+ if (this.UpDownDrag)
87618
+ {
87545
87619
 
87546
- if (this.EnableSelectRect && !this.BorderDrag && this.GetSelectRectData(selectData))
87620
+ }
87621
+ else if (this.EnableSelectRect && !this.BorderDrag && this.GetSelectRectData(selectData))
87547
87622
  {
87548
87623
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SELECT_RECT);
87549
87624
  var paint=this.GetRectSelectPaint();
@@ -87914,25 +87989,83 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
87914
87989
  }
87915
87990
  }
87916
87991
 
87992
+
87993
+ this.GetDataIndexByDatTime=function(date, time)
87994
+ {
87995
+ var result={ DayIndex:-1, DataIndex:-1, Index:-1 };
87996
+ var frame=this.Frame.SubFrame[0].Frame;
87997
+ var minCount=frame.MinuteCount; //每天的分钟个数
87998
+ var kData=this.GetKData();
87999
+ for(var i=0;i<kData.Data.length;++i)
88000
+ {
88001
+ var minItem=kData.Data[i];
88002
+ if (!minItem) continue;
88003
+
88004
+ if (minItem.Date==date && minItem.Time==time)
88005
+ {
88006
+ result.Index=i;
88007
+ result.DayIndex=parseInt(i/minCount);
88008
+ result.DataIndex=i%minCount;
88009
+ break;
88010
+ }
88011
+ }
88012
+
88013
+ return result;
88014
+ }
88015
+
88016
+ //获取十字光标位置 通过日期和时间 目前只支持连续交易时间段
88017
+ this.GetCorssCursorIndexByDateTime=function(date, time)
88018
+ {
88019
+ var border=this.Frame.ChartBorder.GetBorder();
88020
+
88021
+ if (border.DayBorder) //多日分时主图+多日集合竞价
88022
+ {
88023
+ var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
88024
+ corssCursorIndex.Type=10;
88025
+ }
88026
+ else //单日,多日
88027
+ {
88028
+ var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
88029
+ corssCursorIndex.Type=1;
88030
+ corssCursorIndex.DayIndex=0;
88031
+ corssCursorIndex.DataIndex=corssCursorIndex.Index;
88032
+ }
88033
+
88034
+ return corssCursorIndex;
88035
+ }
88036
+
87917
88037
  this.LockCorssCursor=function(option)
87918
88038
  {
87919
88039
  var xItem=this.GlobalOption.LockCorssCursor.X;
88040
+
88041
+ var corssCursorIndex={ DayIndex:-1, DataIndex:-1, Type:-1, Index:this.CursorIndex };
88042
+ if (this.EnableNewIndex)
88043
+ {
88044
+ corssCursorIndex.Type=this.CorssCursorIndex.Type;
88045
+ corssCursorIndex.DayIndex=this.CorssCursorIndex.DayIndex;
88046
+ corssCursorIndex.DataIndex=this.CorssCursorIndex.DataIndex;
88047
+ }
88048
+
88049
+ if (option && option.KItem) //指定日期时间
88050
+ {
88051
+ corssCursorIndex=this.GetCorssCursorIndexByDateTime(option.KItem.Date, option.KItem.Time);
88052
+ }
87920
88053
 
87921
88054
  if (this.EnableNewIndex)
87922
88055
  {
87923
- if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
88056
+ if (corssCursorIndex.Type!=1 && corssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
87924
88057
 
87925
88058
  xItem.Minute=
87926
88059
  {
87927
- DayIndex:this.CorssCursorIndex.DayIndex,
87928
- DataIndex:this.CorssCursorIndex.DataIndex,
87929
- Type:this.CorssCursorIndex.Type,
87930
- CursorIndex:this.CursorIndex,
88060
+ DayIndex:corssCursorIndex.DayIndex,
88061
+ DataIndex:corssCursorIndex.DataIndex,
88062
+ Type:corssCursorIndex.Type,
88063
+ CursorIndex:corssCursorIndex.Index,
87931
88064
  };
87932
88065
  }
87933
88066
  else
87934
88067
  {
87935
- xItem.Minute={ CursorIndex:this.CursorIndex };
88068
+ xItem.Minute={ CursorIndex:corssCursorIndex.Index };
87936
88069
  }
87937
88070
 
87938
88071
  xItem.Enable=true;
@@ -88008,12 +88141,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88008
88141
  var x=null;
88009
88142
  var dayIndex=corssCursorIndex.DayIndex;
88010
88143
  var dataIndex=corssCursorIndex.DataIndex;
88011
- switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
88144
+ var frame=this.Frame.SubFrame[0].Frame;
88145
+ switch(corssCursorIndex.Type) //单日,多日 1=主图 2=盘前 3=盘后 //多日+多日集合竞价 10=主图 20=盘前 30=盘后
88012
88146
  {
88013
- case 1: //单日 1=主图
88014
- case 10: //多日 10=主图
88147
+ case 1: //单日,多日 1=主图
88015
88148
  x=this.Frame.GetXFromIndex(dataIndex)
88016
88149
  break;
88150
+ case 10: //多日+多日集合竞价 10=主图
88151
+ var cursorIndex=frame.MinuteCount*dayIndex+dataIndex;
88152
+ x=this.Frame.GetXFromIndex(cursorIndex);
88153
+ break;
88017
88154
  /*
88018
88155
  case 2: //单日 2=盘前
88019
88156
  x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
@@ -88811,6 +88948,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88811
88948
  var bShowCorss=false; //十字光标十字线
88812
88949
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
88813
88950
 
88951
+ var minItem=null;
88952
+ if (frameID>=0 && option && IFrameSplitOperator.IsNumber(option.CursorIndex))
88953
+ {
88954
+ var kData=this.GetKData();
88955
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
88956
+ {
88957
+ var dataIndex=kData.DataOffset+parseInt(option.CursorIndex.toFixed(0));
88958
+ if (dataIndex>=0 && dataIndex<kData.Data.length) minItem=kData.Data[dataIndex];
88959
+ }
88960
+ }
88961
+
88814
88962
  var aryMenu=
88815
88963
  [
88816
88964
  {
@@ -88942,7 +89090,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88942
89090
  }
88943
89091
  else if (item.Name=="其他设置")
88944
89092
  {
88945
-
89093
+ if (minItem)
89094
+ {
89095
+ var bLocked=this.IsLockCorssCursor();
89096
+ if (bLocked)
89097
+ item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_UNLOCK_CROSSCURSOR }, Checked:bLocked });
89098
+ else
89099
+ item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_LOCK_CROSSCURSOR, Args:[{ KItem:{Date:minItem.Date, Time:minItem.Time}, Draw:true }] }, Checked:bLocked });
89100
+ }
88946
89101
  }
88947
89102
  }
88948
89103
 
@@ -88958,6 +89113,18 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
88958
89113
  {
88959
89114
  JSConsole.Chart.Log("[MinuteChartContainer::OnDoubleClick]", e);
88960
89115
 
89116
+ if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
89117
+ {
89118
+ var pixelTatio = GetDevicePixelRatio();
89119
+ var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
89120
+ var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
89121
+ var dragY=this.Frame.PtInFrameY(x,y);
89122
+ if (dragY && dragY.Index>=0)
89123
+ {
89124
+ this.CancelZoomUpDownFrameY(dragY);
89125
+ }
89126
+ }
89127
+
88961
89128
  if (this.ClickChartTimer!=null)
88962
89129
  {
88963
89130
  clearTimeout(this.ClickChartTimer);
@@ -143191,7 +143358,7 @@ function ScrollBarBGChart()
143191
143358
 
143192
143359
 
143193
143360
 
143194
- var HQCHART_VERSION="1.1.14393";
143361
+ var HQCHART_VERSION="1.1.14403";
143195
143362
 
143196
143363
  function PrintHQChartVersion()
143197
143364
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14393";
8
+ var HQCHART_VERSION="1.1.14403";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -6648,7 +6648,7 @@ var SH_600000_1DAY_MINUTE={
6648
6648
  "low": 8.51,
6649
6649
  "high": 8.51,
6650
6650
  "vol": 0,
6651
- "amount": 47285797,
6651
+ "amount": 4728579,
6652
6652
  "time": 1500
6653
6653
  }
6654
6654
  ],
@@ -55825,6 +55825,36 @@ HQData.Minute_RequestPopMinuteData=function(data, callback)
55825
55825
  }
55826
55826
 
55827
55827
 
55828
+ HQData.KLine_RequestMulitDayMinuteData=function(data, callback)
55829
+ {
55830
+ data.PreventDefault=true;
55831
+ var symbol=data.Request.Data.symbol; //请求的股票代码
55832
+
55833
+ console.log(`[HQData::KLine_RequestMulitDayMinuteData] Symbol=${symbol}`);
55834
+
55835
+ var fullData=HQData.GetMulitDayMinuteDataBySymbol(symbol);
55836
+
55837
+ var aryKLine=[];
55838
+ var aryBreakPoint=[];
55839
+ for(var i=fullData.length-1;i>=0;--i)
55840
+ {
55841
+ var dayItem=fullData[i];
55842
+ var yClose=dayItem.yclose
55843
+ for(var j=0;j<dayItem.minute.length;++j)
55844
+ {
55845
+ var minItem=dayItem.minute[j];
55846
+ var kItem=[dayItem.date, yClose, minItem[1], minItem[2], minItem[3], minItem[4],minItem[5],minItem[6], minItem[0] ];
55847
+ aryKLine.push(kItem);
55848
+ }
55849
+
55850
+ aryBreakPoint.push({ Date:dayItem.date, Time:1500 })
55851
+ }
55852
+
55853
+ var hqchartData={ name:symbol, symbol:symbol, data:aryKLine, ver:2.0, AryBreakPoint:aryBreakPoint };
55854
+ callback(hqchartData);
55855
+ }
55856
+
55857
+
55828
55858
  HQData.Minute_RequestHistoryMinuteData=function(data, callback)
55829
55859
  {
55830
55860
  data.PreventDefault=true;
@@ -57286,6 +57316,19 @@ HQData.GetDayMinuteDataBySymbol=function(symbol)
57286
57316
 
57287
57317
  if (!data) return null;
57288
57318
 
57319
+ //生成测试均价
57320
+ var total=0, count=0;
57321
+ for(var i=0;i<data.stock[0].minute.length;++i)
57322
+ {
57323
+ var item=data.stock[0].minute[i];
57324
+ if (IFrameSplitOperator.IsPlusNumber(item.price))
57325
+ {
57326
+ total+=item.price;
57327
+ ++count;
57328
+ item.avprice=total/count;
57329
+ }
57330
+ }
57331
+
57289
57332
  /*
57290
57333
  var aryMinute=[];
57291
57334
  for(var i=0;i<data.stock[0].minute.length;++i)
@@ -57332,26 +57375,23 @@ HQData.GetMulitDayMinuteDataBySymbol=function(symbol)
57332
57375
 
57333
57376
  if (!data) return null;
57334
57377
 
57335
- /*
57336
- var aryDay=[];
57378
+ //生成测试均价
57337
57379
  for(var i=0;i<data.data.length;++i)
57338
57380
  {
57339
57381
  var dayItem=data.data[i];
57340
-
57341
- var newDayItem={ minute:[], date:dayItem.date, close:dayItem.close, yclose:dayItem.yclose };
57382
+ var total=0, count=0;
57342
57383
  for(var j=0;j<dayItem.minute.length;++j)
57343
57384
  {
57344
57385
  var item=dayItem.minute[j];
57345
- newDayItem.minute[j]=item.slice(0,7);
57386
+ if (IFrameSplitOperator.IsPlusNumber(item[2]))
57387
+ {
57388
+ total+=item[2];
57389
+ ++count;
57390
+ item[7]=total/count;
57391
+ }
57346
57392
  }
57347
-
57348
-
57349
- aryDay.push(newDayItem);
57350
57393
  }
57351
- data.data=aryDay;
57352
- */
57353
-
57354
-
57394
+
57355
57395
  return data.data;
57356
57396
  }
57357
57397
 
@@ -57402,6 +57442,8 @@ HQData.Report_APIIndex=function(data, callback)
57402
57442
  HQData.APIIndex_MULTI_BAR(data, callback);
57403
57443
  else if (request.Data.indexname=="API_MULTI_TEXT")
57404
57444
  HQData.APIIndex_MULTI_TEXT(data, callback);
57445
+ else if (request.Data.indexname=="API_PARTLINE")
57446
+ HQData.APIIndex_PARTLINE(data, callback);
57405
57447
 
57406
57448
  }
57407
57449
 
@@ -57643,11 +57685,51 @@ HQData.APIIndex_MULTI_LINE=function(data, callback)
57643
57685
  }
57644
57686
  line3.Draw.DrawData.push(point3);
57645
57687
 
57688
+
57689
+ var point1={ Color:'rgb(0,0,255)', Point:[] };
57690
+ var point2={ Color:'rgb(255,140,0)', Point:[] };
57691
+ var point3={ Color:'rgb(255, 255, 0)', Point:[] };
57692
+ var colorLine=
57693
+ {
57694
+ name:'MULTI_LINE', type:1,
57695
+
57696
+ Draw:
57697
+ {
57698
+ DrawType:'MULTI_LINE', DrawData:[point1,point2,point3],
57699
+ LineWidth:2,
57700
+ }, //绘制线段数组
57701
+
57702
+ IsShowTitle:false
57703
+ };
57704
+
57705
+
57706
+ var index=kData.Data.length-50;
57707
+ if (index<0) index=0;
57708
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
57709
+ {
57710
+ var item=kData.Data[index];
57711
+ point1.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
57712
+ }
57713
+
57714
+ --index;
57715
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
57716
+ {
57717
+ var item=kData.Data[index];
57718
+ point2.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
57719
+ }
57720
+
57721
+ --index;
57722
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
57723
+ {
57724
+ var item=kData.Data[index];
57725
+ point3.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
57726
+ }
57727
+
57646
57728
  var apiData=
57647
57729
  {
57648
57730
  code:0,
57649
57731
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
57650
- outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[line3] }
57732
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[line3,colorLine] }
57651
57733
  };
57652
57734
 
57653
57735
  console.log('[HQData.APIIndex_MULTI_LINE] apiData ', apiData);
@@ -58164,6 +58246,52 @@ HQData.APIIndex_MULTI_TEXT=function(data, callback)
58164
58246
  }
58165
58247
 
58166
58248
 
58249
+ HQData.APIIndex_PARTLINE=function(data, callback)
58250
+ {
58251
+ data.PreventDefault=true;
58252
+ var hqchart=data.HQChart;
58253
+ var kData=hqchart.GetKData();
58254
+
58255
+
58256
+ var lineData=
58257
+ {
58258
+ name:'PARTLINE', type:1,
58259
+ Draw:
58260
+ {
58261
+ DrawType:'PARTLINE',
58262
+ DrawData: [],
58263
+ LineWidth:"LINETHICK2",
58264
+ IsDotLine:true,
58265
+ LineDash:[10,5]
58266
+ }
58267
+ };
58268
+
58269
+ var colorIndex=0;
58270
+ var ARRAY_COLOR=["rgb(0, 0 ,255)", "rgb(255,0,255)", "rgb(255,165,0)"];
58271
+ for(var i=0;i<kData.Data.length;++i)
58272
+ {
58273
+ var kItem=kData.Data[i];
58274
+
58275
+ var color=ARRAY_COLOR[colorIndex%ARRAY_COLOR.length];
58276
+
58277
+ lineData.Draw.DrawData.push({ Value:kItem.Close, RGB:color});
58278
+
58279
+ if (i%10==3) ++colorIndex;
58280
+ }
58281
+
58282
+
58283
+ var apiData=
58284
+ {
58285
+ code:0,
58286
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
58287
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[lineData] }
58288
+ };
58289
+
58290
+ console.log('[HQData.APIIndex_PARTLINE] apiData ', apiData);
58291
+ callback(apiData);
58292
+ }
58293
+
58294
+
58167
58295
 
58168
58296
 
58169
58297
  /*暴露外部用的方法*/