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.
@@ -951,6 +951,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
951
951
  }
952
952
  }
953
953
 
954
+ if (option.EnableYDrag)
955
+ {
956
+ var item=option.EnableYDrag;
957
+ if (IFrameSplitOperator.IsBool(item.Left)) chart.EnableYDrag.Left=item.Left;
958
+ if (IFrameSplitOperator.IsBool(item.Right)) chart.EnableYDrag.Right=item.Right;
959
+ if (IFrameSplitOperator.IsBool(item.Wheel)) chart.EnableYDrag.Wheel=item.Wheel;
960
+ if (IFrameSplitOperator.IsNumber(item.WheelYMove)) chart.EnableYDrag.WheelYMove=item.WheelYMove;
961
+ }
962
+
954
963
  //分页
955
964
  if (option.PageInfo) chart.SetPageInfo(option.PageInfo);
956
965
 
@@ -1026,7 +1035,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1026
1035
  }
1027
1036
  if (item.Height>=0) chart.Frame.SubFrame[i].Height = item.Height;
1028
1037
  if (item.Custom) chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;
1029
- if (item.RightTextFormat>0) chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;
1030
1038
  if (IFrameSplitOperator.IsNumber(item.TitleHeight)) chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;
1031
1039
  if (IFrameSplitOperator.IsNumber(item.BorderLine)) chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;
1032
1040
  if (IFrameSplitOperator.IsBool(item.EnableRemoveZero)) chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;
@@ -1044,6 +1052,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1044
1052
 
1045
1053
  if (item.ClientBGColor) subFrame.ClientBGColor=item.ClientBGColor;
1046
1054
  if (!IFrameSplitOperator.IsUndefined(item.HorizontalReserved)) subFrame.HorizontalReserved=item.HorizontalReserved;
1055
+
1056
+ if (i==0)
1057
+ {
1058
+ if (IFrameSplitOperator.IsNumber(item.RightTextFormat))
1059
+ {
1060
+ subFrame.YSplitOperator.RightTextFormat=item.RightTextFormat;
1061
+ if (item.RightTextFormat==2) subFrame.MultiTextFormat=1;
1062
+ }
1063
+ }
1047
1064
  }
1048
1065
 
1049
1066
  chart.UpdateXShowText();
@@ -12436,7 +12453,7 @@ function AverageWidthFrame()
12436
12453
  var item=aryText[i];
12437
12454
  var message=item.Item;
12438
12455
 
12439
- this.Canvas.textBaseline=message.TextBaseline;
12456
+ this.Canvas.textBaseline=item.TextBaseline;
12440
12457
  if (message.ExtendData && message.ExtendData.Font) this.Canvas.font=message.ExtendData.Font;
12441
12458
  else if (message.Font) this.Canvas.font=message.Font;
12442
12459
 
@@ -14059,20 +14076,17 @@ function AverageWidthFrame()
14059
14076
 
14060
14077
  if (Array.isArray(item.Message[1]))
14061
14078
  {
14062
- if (this.MultiTextFormat==1) //显示1行 格式:价格/百分比
14079
+ if (this.MultiTextFormat==1 && IFrameSplitOperator.IsNonEmptyArray(item.Message[1])) //显示1行 格式:价格/百分比
14063
14080
  {
14064
- if (item.ExtendData)
14065
- {
14066
- if (item.ExtendData.Font) this.Canvas.font=item.ExtendData.Font;
14067
- var width1=this.Canvas.measureText(item.Message[1][0]).width;
14068
- var width2=this.Canvas.measureText(item.Message[1][1]).width;
14069
- var width3=this.Canvas.measureText('/').width;
14070
- textWidth=width1+width3;
14071
-
14072
- if (rightExtendWidth<width2) rightExtendWidth=width2;
14081
+ if (item.ExtendData && item.ExtendData.Font) this.Canvas.font=item.ExtendData.Font;
14082
+
14083
+ var width1=this.Canvas.measureText(item.Message[1][0]).width;
14084
+ var width2=this.Canvas.measureText(item.Message[1][1]).width;
14085
+ var width3=this.Canvas.measureText('/').width;
14086
+ textWidth=width1+width3;
14087
+ if (rightExtendWidth<width2) rightExtendWidth=width2;
14073
14088
 
14074
- //JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
14075
- }
14089
+ //JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
14076
14090
  }
14077
14091
  else if (this.MultiTextFormat==2) //显示2行
14078
14092
  {
@@ -37097,7 +37111,7 @@ function ChartMinutePriceLine()
37097
37111
  if (value==null) continue;
37098
37112
 
37099
37113
  var x=this.ChartFrame.GetXFromIndex(j);
37100
- var y=this.ChartFrame.GetYFromData(value);
37114
+ var y=this.ChartFrame.GetYFromData(value,false);
37101
37115
 
37102
37116
  if (bFirstPoint)
37103
37117
  {
@@ -52334,7 +52348,7 @@ function FrameSplitMinutePriceY()
52334
52348
  this.DefaultSplitType=0;
52335
52349
  this.LimitPrice; //{Max: Min:} 涨跌停价
52336
52350
  this.Custom;
52337
- this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格
52351
+ this.RightTextFormat=0; //右边刻度显示模式 0=百分比 1=价格 2=价格 | 百分比
52338
52352
 
52339
52353
  this.BeforeOpenData;
52340
52354
  this.IsBeforeData=false;
@@ -52350,9 +52364,12 @@ function FrameSplitMinutePriceY()
52350
52364
  this.GlobalOption;
52351
52365
  this.HQChart;
52352
52366
 
52367
+ this.FixedYMaxMin; //{ Max, Min} 固定Y轴最大最小值
52368
+ this.EnableZoomUpDown=false;
52369
+
52353
52370
  this.IsEnableDragY=function()
52354
52371
  {
52355
- return false;
52372
+ return true;
52356
52373
  }
52357
52374
 
52358
52375
  this.Operator=function()
@@ -52361,23 +52378,35 @@ function FrameSplitMinutePriceY()
52361
52378
  this.Frame.CustomHorizontalInfo=[];
52362
52379
  if (!this.Data) return;
52363
52380
 
52364
- var range=this.GetMaxMin();
52381
+ var range=null;
52382
+ var isFixedMaxMin=(this.FixedYMaxMin && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Max) && IFrameSplitOperator.IsNumber(this.FixedYMaxMin.Min));
52383
+ if (isFixedMaxMin)
52384
+ {
52385
+ range={ Max:this.FixedYMaxMin.Max, Min:this.FixedYMaxMin.Min };
52386
+ JSConsole.Chart.Log(`[FrameSplitMinutePriceY::Operator] FixedYMaxMin.Max=${this.FixedYMaxMin.Max} FixedYMaxMin.Min=${this.FixedYMaxMin.Min} `);
52387
+ }
52388
+ else
52389
+ {
52390
+ range=this.GetMaxMin();
52391
+ }
52365
52392
 
52366
52393
  if (this.Symbol && MARKET_SUFFIX_NAME.IsUSA(this.Symbol.toUpperCase()))
52367
52394
  {
52368
- this.USASplit(range);
52395
+ this.USASplit(range,isFixedMaxMin);
52369
52396
  }
52370
52397
  else if (this.SplitType==2)
52371
52398
  {
52372
- this.USASplit(range);
52399
+ this.USASplit(range,isFixedMaxMin);
52373
52400
  }
52374
52401
  else
52375
52402
  {
52376
- this.DefaultSplit(range);
52403
+ this.DefaultSplit(range,isFixedMaxMin);
52377
52404
  }
52378
52405
 
52379
52406
  this.CustomCoordinate();
52380
52407
 
52408
+ if (this.EnableZoomUpDown==true && !this.FixedYMaxMin) this.FixedYMaxMin={ Max:range.Max, Min:range.Min };
52409
+
52381
52410
  this.ReservedHeight({ Max:this.Frame.HorizontalMax, Min:this.Frame.HorizontalMin }); //预留高度
52382
52411
 
52383
52412
  if (this.GetEventCallback)
@@ -52773,10 +52802,21 @@ function FrameSplitMinutePriceY()
52773
52802
  var per=(price/this.YClose-1)*100;
52774
52803
  if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
52775
52804
  else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
52805
+ var strPer=IFrameSplitOperator.FormatValueString(per,2)+'%';
52776
52806
  if (this.IsShowRightText)
52777
52807
  {
52778
- if (this.RightTextFormat==1) coordinate.Message[1]=strPrice;
52779
- else coordinate.Message[1]=IFrameSplitOperator.FormatValueString(per,2)+'%'; //百分比
52808
+ if (this.RightTextFormat==1)
52809
+ {
52810
+ coordinate.Message[1]=strPrice;
52811
+ }
52812
+ else if (this.RightTextFormat==2) //价格/百分比
52813
+ {
52814
+ coordinate.Message[1]=[strPrice,strPer];
52815
+ }
52816
+ else
52817
+ {
52818
+ coordinate.Message[1]=strPer; //百分比
52819
+ }
52780
52820
  }
52781
52821
  }
52782
52822
 
@@ -52808,22 +52848,25 @@ function FrameSplitMinutePriceY()
52808
52848
  this.Frame.HorizontalMin=min;
52809
52849
  }
52810
52850
 
52811
- this.DefaultSplit=function(range)
52851
+ this.DefaultSplit=function(range,isFixedMaxMin)
52812
52852
  {
52813
52853
  var max=range.Max;
52814
52854
  var min=range.Min;
52815
52855
 
52816
- if (this.YClose==max && this.YClose==min)
52817
- {
52818
- max=this.YClose+this.YClose*0.1;
52819
- min=this.YClose-this.YClose*0.1
52820
- }
52821
- else
52856
+ if (!isFixedMaxMin)
52822
52857
  {
52823
- var distanceValue=Math.max(Math.abs(this.YClose-max),Math.abs(this.YClose-min));
52824
- max=this.YClose+distanceValue;
52825
- min=this.YClose-distanceValue;
52826
- if (min<0) min=range.Min;
52858
+ if (this.YClose==max && this.YClose==min)
52859
+ {
52860
+ max=this.YClose+this.YClose*0.1;
52861
+ min=this.YClose-this.YClose*0.1
52862
+ }
52863
+ else
52864
+ {
52865
+ var distanceValue=Math.max(Math.abs(this.YClose-max),Math.abs(this.YClose-min));
52866
+ max=this.YClose+distanceValue;
52867
+ min=this.YClose-distanceValue;
52868
+ if (min<0) min=range.Min;
52869
+ }
52827
52870
  }
52828
52871
 
52829
52872
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
@@ -52836,7 +52879,7 @@ function FrameSplitMinutePriceY()
52836
52879
  const minDistance=[1, 0.1, 0.01, 0.001, 0.0001];
52837
52880
  var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
52838
52881
  if (isPhoneModel && MARKET_SUFFIX_NAME.IsSHSZIndex(this.Symbol)) defaultfloatPrecision = 0; //手机端指数不显示小数位数,太长了
52839
- if (distance<minDistance[defaultfloatPrecision])
52882
+ if (distance<minDistance[defaultfloatPrecision] && !isFixedMaxMin)
52840
52883
  {
52841
52884
  distance=minDistance[defaultfloatPrecision];
52842
52885
  max=this.YClose+(distance*(showCount-1)/2);
@@ -52857,11 +52900,21 @@ function FrameSplitMinutePriceY()
52857
52900
  var per=(price/this.YClose-1)*100;
52858
52901
  if (per>0) coordinate.TextColor=g_JSChartResource.UpTextColor;
52859
52902
  else if (per<0) coordinate.TextColor=g_JSChartResource.DownTextColor;
52860
-
52903
+ var strPer=`${IFrameSplitOperator.FormatValueString(per,2)}%`;
52861
52904
  if (this.IsShowRightText)
52862
52905
  {
52863
- if (this.RightTextFormat==1) coordinate.Message[1]=strPrice;
52864
- else coordinate.Message[1]=IFrameSplitOperator.FormatValueString(per,2)+'%'; //百分比
52906
+ if (this.RightTextFormat==1)
52907
+ {
52908
+ coordinate.Message[1]=strPrice;
52909
+ }
52910
+ else if (this.RightTextFormat==2) //价格/百分比
52911
+ {
52912
+ coordinate.Message[1]=[strPer,strPrice];
52913
+ }
52914
+ else
52915
+ {
52916
+ coordinate.Message[1]=strPer; //百分比
52917
+ }
52865
52918
  }
52866
52919
 
52867
52920
  if (Math.abs(price-this.YClose) <0.00000000001) //小数有精度问题 使用差值
@@ -83575,14 +83628,30 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83575
83628
  var moveSetp=moveData.X;
83576
83629
  var yMoveSetp=moveData.Y;
83577
83630
 
83578
- if (this.RectSelectDrag && this.RectSelectDrag.Index>=0) //区间选择
83631
+ var bNeedDraw=true;
83632
+ if (this.UpDownDrag && this.UpDownDrag.Index>=0)
83633
+ {
83634
+ if (yMoveSetp>=5)
83635
+ {
83636
+ var yMove=e.clientY-drag.LastMove.Y;
83637
+ JSConsole.Chart.Log("[MinuteChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
83638
+ //this.UIElement.style.cursor="pointer";
83639
+ this.SetCursor({Cursor:"pointer"});
83640
+ if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
83641
+ {
83642
+ drag.LastMove.Y=e.clientY;
83643
+ bNeedDraw=true;
83644
+ }
83645
+ }
83646
+ }
83647
+ else if (this.RectSelectDrag && this.RectSelectDrag.Index>=0) //区间选择
83579
83648
  {
83580
83649
  if (moveSetp<5) return;
83581
83650
  var obj={ X:e.clientX, Y:e.clientY, PointIndex:this.RectSelectDrag.Index, Name:"MoveRectSelectLine" };
83582
83651
  if (this.MoveRectSelectPoint(obj))
83583
83652
  {
83584
83653
  drag.LastMove.X=e.clientX;
83585
- this.Draw();
83654
+ bNeedDraw=true;
83586
83655
  }
83587
83656
  }
83588
83657
  else
@@ -83600,6 +83669,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83600
83669
  drag.LastMove.X=e.clientX;
83601
83670
  drag.LastMove.Y=e.clientY;
83602
83671
  }
83672
+
83673
+ if (bNeedDraw) this.Draw();
83603
83674
  }
83604
83675
 
83605
83676
  this.OnMinuteSelectRectMouseUp=function(e)
@@ -83617,8 +83688,12 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83617
83688
  selectData.YEnd=(drag.LastMove.Y-uielement.getBoundingClientRect().top)*pixelTatio;
83618
83689
  selectData.JSChartContainer=this;
83619
83690
  selectData.Stock={Symbol:this.Symbol, Name:this.Name};
83691
+
83692
+ if (this.UpDownDrag)
83693
+ {
83620
83694
 
83621
- if (this.EnableSelectRect && !this.BorderDrag && this.GetSelectRectData(selectData))
83695
+ }
83696
+ else if (this.EnableSelectRect && !this.BorderDrag && this.GetSelectRectData(selectData))
83622
83697
  {
83623
83698
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SELECT_RECT);
83624
83699
  var paint=this.GetRectSelectPaint();
@@ -83989,25 +84064,83 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83989
84064
  }
83990
84065
  }
83991
84066
 
84067
+
84068
+ this.GetDataIndexByDatTime=function(date, time)
84069
+ {
84070
+ var result={ DayIndex:-1, DataIndex:-1, Index:-1 };
84071
+ var frame=this.Frame.SubFrame[0].Frame;
84072
+ var minCount=frame.MinuteCount; //每天的分钟个数
84073
+ var kData=this.GetKData();
84074
+ for(var i=0;i<kData.Data.length;++i)
84075
+ {
84076
+ var minItem=kData.Data[i];
84077
+ if (!minItem) continue;
84078
+
84079
+ if (minItem.Date==date && minItem.Time==time)
84080
+ {
84081
+ result.Index=i;
84082
+ result.DayIndex=parseInt(i/minCount);
84083
+ result.DataIndex=i%minCount;
84084
+ break;
84085
+ }
84086
+ }
84087
+
84088
+ return result;
84089
+ }
84090
+
84091
+ //获取十字光标位置 通过日期和时间 目前只支持连续交易时间段
84092
+ this.GetCorssCursorIndexByDateTime=function(date, time)
84093
+ {
84094
+ var border=this.Frame.ChartBorder.GetBorder();
84095
+
84096
+ if (border.DayBorder) //多日分时主图+多日集合竞价
84097
+ {
84098
+ var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
84099
+ corssCursorIndex.Type=10;
84100
+ }
84101
+ else //单日,多日
84102
+ {
84103
+ var corssCursorIndex=this.GetDataIndexByDatTime(date, time);
84104
+ corssCursorIndex.Type=1;
84105
+ corssCursorIndex.DayIndex=0;
84106
+ corssCursorIndex.DataIndex=corssCursorIndex.Index;
84107
+ }
84108
+
84109
+ return corssCursorIndex;
84110
+ }
84111
+
83992
84112
  this.LockCorssCursor=function(option)
83993
84113
  {
83994
84114
  var xItem=this.GlobalOption.LockCorssCursor.X;
84115
+
84116
+ var corssCursorIndex={ DayIndex:-1, DataIndex:-1, Type:-1, Index:this.CursorIndex };
84117
+ if (this.EnableNewIndex)
84118
+ {
84119
+ corssCursorIndex.Type=this.CorssCursorIndex.Type;
84120
+ corssCursorIndex.DayIndex=this.CorssCursorIndex.DayIndex;
84121
+ corssCursorIndex.DataIndex=this.CorssCursorIndex.DataIndex;
84122
+ }
84123
+
84124
+ if (option && option.KItem) //指定日期时间
84125
+ {
84126
+ corssCursorIndex=this.GetCorssCursorIndexByDateTime(option.KItem.Date, option.KItem.Time);
84127
+ }
83995
84128
 
83996
84129
  if (this.EnableNewIndex)
83997
84130
  {
83998
- if (this.CorssCursorIndex.Type!=1 && this.CorssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
84131
+ if (corssCursorIndex.Type!=1 && corssCursorIndex.Type!=10) return false; //目前只支持连续交易时间段
83999
84132
 
84000
84133
  xItem.Minute=
84001
84134
  {
84002
- DayIndex:this.CorssCursorIndex.DayIndex,
84003
- DataIndex:this.CorssCursorIndex.DataIndex,
84004
- Type:this.CorssCursorIndex.Type,
84005
- CursorIndex:this.CursorIndex,
84135
+ DayIndex:corssCursorIndex.DayIndex,
84136
+ DataIndex:corssCursorIndex.DataIndex,
84137
+ Type:corssCursorIndex.Type,
84138
+ CursorIndex:corssCursorIndex.Index,
84006
84139
  };
84007
84140
  }
84008
84141
  else
84009
84142
  {
84010
- xItem.Minute={ CursorIndex:this.CursorIndex };
84143
+ xItem.Minute={ CursorIndex:corssCursorIndex.Index };
84011
84144
  }
84012
84145
 
84013
84146
  xItem.Enable=true;
@@ -84083,12 +84216,16 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84083
84216
  var x=null;
84084
84217
  var dayIndex=corssCursorIndex.DayIndex;
84085
84218
  var dataIndex=corssCursorIndex.DataIndex;
84086
- switch(corssCursorIndex.Type) //单日 1=主图 2=盘前 3=盘后 //多日 10=主图 20=盘前 30=盘后
84219
+ var frame=this.Frame.SubFrame[0].Frame;
84220
+ switch(corssCursorIndex.Type) //单日,多日 1=主图 2=盘前 3=盘后 //多日+多日集合竞价 10=主图 20=盘前 30=盘后
84087
84221
  {
84088
- case 1: //单日 1=主图
84089
- case 10: //多日 10=主图
84222
+ case 1: //单日,多日 1=主图
84090
84223
  x=this.Frame.GetXFromIndex(dataIndex)
84091
84224
  break;
84225
+ case 10: //多日+多日集合竞价 10=主图
84226
+ var cursorIndex=frame.MinuteCount*dayIndex+dataIndex;
84227
+ x=this.Frame.GetXFromIndex(cursorIndex);
84228
+ break;
84092
84229
  /*
84093
84230
  case 2: //单日 2=盘前
84094
84231
  x=this.Frame.SubFrame[0].Frame.GetLeftExtendXFromIndex(dataIndex,this.GetBeforeOpenData());
@@ -84886,6 +85023,17 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
84886
85023
  var bShowCorss=false; //十字光标十字线
84887
85024
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
84888
85025
 
85026
+ var minItem=null;
85027
+ if (frameID>=0 && option && IFrameSplitOperator.IsNumber(option.CursorIndex))
85028
+ {
85029
+ var kData=this.GetKData();
85030
+ if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
85031
+ {
85032
+ var dataIndex=kData.DataOffset+parseInt(option.CursorIndex.toFixed(0));
85033
+ if (dataIndex>=0 && dataIndex<kData.Data.length) minItem=kData.Data[dataIndex];
85034
+ }
85035
+ }
85036
+
84889
85037
  var aryMenu=
84890
85038
  [
84891
85039
  {
@@ -85017,7 +85165,14 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85017
85165
  }
85018
85166
  else if (item.Name=="其他设置")
85019
85167
  {
85020
-
85168
+ if (minItem)
85169
+ {
85170
+ var bLocked=this.IsLockCorssCursor();
85171
+ if (bLocked)
85172
+ item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_UNLOCK_CROSSCURSOR }, Checked:bLocked });
85173
+ else
85174
+ item.SubMenu.push({ Name:"锁十字光标", Data:{ ID: JSCHART_MENU_ID.CMD_LOCK_CROSSCURSOR, Args:[{ KItem:{Date:minItem.Date, Time:minItem.Time}, Draw:true }] }, Checked:bLocked });
85175
+ }
85021
85176
  }
85022
85177
  }
85023
85178
 
@@ -85033,6 +85188,18 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
85033
85188
  {
85034
85189
  JSConsole.Chart.Log("[MinuteChartContainer::OnDoubleClick]", e);
85035
85190
 
85191
+ if (this.EnableYDrag && (this.EnableYDrag.Left || this.EnableYDrag.Right) && this.Frame && this.Frame.PtInFrameY)
85192
+ {
85193
+ var pixelTatio = GetDevicePixelRatio();
85194
+ var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
85195
+ var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
85196
+ var dragY=this.Frame.PtInFrameY(x,y);
85197
+ if (dragY && dragY.Index>=0)
85198
+ {
85199
+ this.CancelZoomUpDownFrameY(dragY);
85200
+ }
85201
+ }
85202
+
85036
85203
  if (this.ClickChartTimer!=null)
85037
85204
  {
85038
85205
  clearTimeout(this.ClickChartTimer);
@@ -2191,7 +2191,7 @@ var SH_600000_1DAY_MINUTE={
2191
2191
  "low": 8.51,
2192
2192
  "high": 8.51,
2193
2193
  "vol": 0,
2194
- "amount": 47285797,
2194
+ "amount": 4728579,
2195
2195
  "time": 1500
2196
2196
  }
2197
2197
  ],
@@ -293,6 +293,36 @@ HQData.Minute_RequestPopMinuteData=function(data, callback)
293
293
  }
294
294
 
295
295
 
296
+ HQData.KLine_RequestMulitDayMinuteData=function(data, callback)
297
+ {
298
+ data.PreventDefault=true;
299
+ var symbol=data.Request.Data.symbol; //请求的股票代码
300
+
301
+ console.log(`[HQData::KLine_RequestMulitDayMinuteData] Symbol=${symbol}`);
302
+
303
+ var fullData=HQData.GetMulitDayMinuteDataBySymbol(symbol);
304
+
305
+ var aryKLine=[];
306
+ var aryBreakPoint=[];
307
+ for(var i=fullData.length-1;i>=0;--i)
308
+ {
309
+ var dayItem=fullData[i];
310
+ var yClose=dayItem.yclose
311
+ for(var j=0;j<dayItem.minute.length;++j)
312
+ {
313
+ var minItem=dayItem.minute[j];
314
+ var kItem=[dayItem.date, yClose, minItem[1], minItem[2], minItem[3], minItem[4],minItem[5],minItem[6], minItem[0] ];
315
+ aryKLine.push(kItem);
316
+ }
317
+
318
+ aryBreakPoint.push({ Date:dayItem.date, Time:1500 })
319
+ }
320
+
321
+ var hqchartData={ name:symbol, symbol:symbol, data:aryKLine, ver:2.0, AryBreakPoint:aryBreakPoint };
322
+ callback(hqchartData);
323
+ }
324
+
325
+
296
326
  HQData.Minute_RequestHistoryMinuteData=function(data, callback)
297
327
  {
298
328
  data.PreventDefault=true;
@@ -1754,6 +1784,19 @@ HQData.GetDayMinuteDataBySymbol=function(symbol)
1754
1784
 
1755
1785
  if (!data) return null;
1756
1786
 
1787
+ //生成测试均价
1788
+ var total=0, count=0;
1789
+ for(var i=0;i<data.stock[0].minute.length;++i)
1790
+ {
1791
+ var item=data.stock[0].minute[i];
1792
+ if (IFrameSplitOperator.IsPlusNumber(item.price))
1793
+ {
1794
+ total+=item.price;
1795
+ ++count;
1796
+ item.avprice=total/count;
1797
+ }
1798
+ }
1799
+
1757
1800
  /*
1758
1801
  var aryMinute=[];
1759
1802
  for(var i=0;i<data.stock[0].minute.length;++i)
@@ -1800,26 +1843,23 @@ HQData.GetMulitDayMinuteDataBySymbol=function(symbol)
1800
1843
 
1801
1844
  if (!data) return null;
1802
1845
 
1803
- /*
1804
- var aryDay=[];
1846
+ //生成测试均价
1805
1847
  for(var i=0;i<data.data.length;++i)
1806
1848
  {
1807
1849
  var dayItem=data.data[i];
1808
-
1809
- var newDayItem={ minute:[], date:dayItem.date, close:dayItem.close, yclose:dayItem.yclose };
1850
+ var total=0, count=0;
1810
1851
  for(var j=0;j<dayItem.minute.length;++j)
1811
1852
  {
1812
1853
  var item=dayItem.minute[j];
1813
- newDayItem.minute[j]=item.slice(0,7);
1854
+ if (IFrameSplitOperator.IsPlusNumber(item[2]))
1855
+ {
1856
+ total+=item[2];
1857
+ ++count;
1858
+ item[7]=total/count;
1859
+ }
1814
1860
  }
1815
-
1816
-
1817
- aryDay.push(newDayItem);
1818
1861
  }
1819
- data.data=aryDay;
1820
- */
1821
-
1822
-
1862
+
1823
1863
  return data.data;
1824
1864
  }
1825
1865
 
@@ -1870,6 +1910,8 @@ HQData.Report_APIIndex=function(data, callback)
1870
1910
  HQData.APIIndex_MULTI_BAR(data, callback);
1871
1911
  else if (request.Data.indexname=="API_MULTI_TEXT")
1872
1912
  HQData.APIIndex_MULTI_TEXT(data, callback);
1913
+ else if (request.Data.indexname=="API_PARTLINE")
1914
+ HQData.APIIndex_PARTLINE(data, callback);
1873
1915
 
1874
1916
  }
1875
1917
 
@@ -2111,11 +2153,51 @@ HQData.APIIndex_MULTI_LINE=function(data, callback)
2111
2153
  }
2112
2154
  line3.Draw.DrawData.push(point3);
2113
2155
 
2156
+
2157
+ var point1={ Color:'rgb(0,0,255)', Point:[] };
2158
+ var point2={ Color:'rgb(255,140,0)', Point:[] };
2159
+ var point3={ Color:'rgb(255, 255, 0)', Point:[] };
2160
+ var colorLine=
2161
+ {
2162
+ name:'MULTI_LINE', type:1,
2163
+
2164
+ Draw:
2165
+ {
2166
+ DrawType:'MULTI_LINE', DrawData:[point1,point2,point3],
2167
+ LineWidth:2,
2168
+ }, //绘制线段数组
2169
+
2170
+ IsShowTitle:false
2171
+ };
2172
+
2173
+
2174
+ var index=kData.Data.length-50;
2175
+ if (index<0) index=0;
2176
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
2177
+ {
2178
+ var item=kData.Data[index];
2179
+ point1.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
2180
+ }
2181
+
2182
+ --index;
2183
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
2184
+ {
2185
+ var item=kData.Data[index];
2186
+ point2.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
2187
+ }
2188
+
2189
+ --index;
2190
+ for(var j=0; index<kData.Data.length && j<10; ++index, ++j)
2191
+ {
2192
+ var item=kData.Data[index];
2193
+ point3.Point.push({Date:item.Date, Time:item.Time, Value:item.Close});
2194
+ }
2195
+
2114
2196
  var apiData=
2115
2197
  {
2116
2198
  code:0,
2117
2199
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2118
- outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[line3] }
2200
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[line3,colorLine] }
2119
2201
  };
2120
2202
 
2121
2203
  console.log('[HQData.APIIndex_MULTI_LINE] apiData ', apiData);
@@ -2632,3 +2714,49 @@ HQData.APIIndex_MULTI_TEXT=function(data, callback)
2632
2714
  }
2633
2715
 
2634
2716
 
2717
+ HQData.APIIndex_PARTLINE=function(data, callback)
2718
+ {
2719
+ data.PreventDefault=true;
2720
+ var hqchart=data.HQChart;
2721
+ var kData=hqchart.GetKData();
2722
+
2723
+
2724
+ var lineData=
2725
+ {
2726
+ name:'PARTLINE', type:1,
2727
+ Draw:
2728
+ {
2729
+ DrawType:'PARTLINE',
2730
+ DrawData: [],
2731
+ LineWidth:"LINETHICK2",
2732
+ IsDotLine:true,
2733
+ LineDash:[10,5]
2734
+ }
2735
+ };
2736
+
2737
+ var colorIndex=0;
2738
+ var ARRAY_COLOR=["rgb(0, 0 ,255)", "rgb(255,0,255)", "rgb(255,165,0)"];
2739
+ for(var i=0;i<kData.Data.length;++i)
2740
+ {
2741
+ var kItem=kData.Data[i];
2742
+
2743
+ var color=ARRAY_COLOR[colorIndex%ARRAY_COLOR.length];
2744
+
2745
+ lineData.Draw.DrawData.push({ Value:kItem.Close, RGB:color});
2746
+
2747
+ if (i%10==3) ++colorIndex;
2748
+ }
2749
+
2750
+
2751
+ var apiData=
2752
+ {
2753
+ code:0,
2754
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2755
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[lineData] }
2756
+ };
2757
+
2758
+ console.log('[HQData.APIIndex_PARTLINE] apiData ', apiData);
2759
+ callback(apiData);
2760
+ }
2761
+
2762
+