hqchart 1.1.12505 → 1.1.12516

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.
@@ -5668,6 +5668,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5668
5668
 
5669
5669
  this.JSChartContainer=chart;
5670
5670
 
5671
+ if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
5671
5672
  if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
5672
5673
 
5673
5674
  //是否自动更新
@@ -6773,6 +6774,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
6773
6774
  this.IsClickShowCorssCursor=false; //手势点击显示十字光标
6774
6775
  this.ChartSplashPaint=null; //等待提示
6775
6776
  this.LoadDataSplashTitle="数据加载中"; //下载数据提示信息
6777
+ this.DefaultCursor="default"; //crosshair , default 默认手型
6776
6778
 
6777
6779
  //绘图缓存
6778
6780
  this.CacheCanvas=null;
@@ -7252,7 +7254,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7252
7254
  event.Callback(event, sendData, this);
7253
7255
  this.CustomChartDrag=sendData.ChartDrag;
7254
7256
 
7255
- if (sendData.Cusrsor) this.UIElement.style.cursor=sendData.Cusrsor;
7257
+ this.SetCursor(sendData);
7256
7258
  }
7257
7259
 
7258
7260
  this.TryDragMove_CustomChartDrag=function(sendData)
@@ -7331,7 +7333,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7331
7333
  {
7332
7334
  if (item.Type==4)
7333
7335
  {
7334
- this.UIElement.style.cursor="pointer";
7336
+ //this.UIElement.style.cursor="pointer";
7337
+ this.SetCursor({Cursor:"pointer"});
7335
7338
  var obj={ X:e.clientX };
7336
7339
  if (this.GetXDataIndex(obj))
7337
7340
  {
@@ -7341,7 +7344,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7341
7344
  }
7342
7345
  else
7343
7346
  {
7344
- this.UIElement.style.cursor="ew-resize";
7347
+ //this.UIElement.style.cursor="ew-resize";
7348
+ this.SetCursor({Cursor:"ew-resize"});
7345
7349
  this.RectSelectDrag={ Index:item.PointIndex, Type:item.Type };
7346
7350
  JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] drag rect select ",item);
7347
7351
  }
@@ -7355,7 +7359,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7355
7359
  var dragBorder=this.Frame.PtInFrameBorder(x,y);
7356
7360
  if (dragBorder && dragBorder.Index>=0)
7357
7361
  {
7358
- this.UIElement.style.cursor="n-resize";
7362
+ //this.UIElement.style.cursor="n-resize";
7363
+ this.SetCursor({Cursor:"n-resize"});
7359
7364
  this.BorderDrag={ Index:dragBorder.Index };
7360
7365
  JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] DragBorder ",dragBorder);
7361
7366
  }
@@ -7367,7 +7372,9 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7367
7372
  var dragY=this.TryYDrag(x,y);
7368
7373
  if (dragY)
7369
7374
  {
7370
- this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
7375
+ //this.UIElement.style.cursor=dragY.Position==0 ? "n-resize":"row-resize";
7376
+ var cursor=dragY.Position==0 ? "n-resize":"row-resize";
7377
+ this.SetCursor({Cursor:cursor});
7371
7378
  this.YDrag=dragY;
7372
7379
  JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragY ",dragY);
7373
7380
  }
@@ -7376,7 +7383,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7376
7383
  var dragUpDown=this.TryUpDownDrag(x,y);
7377
7384
  if (dragUpDown)
7378
7385
  {
7379
- this.UIElement.style.cursor="pointer";
7386
+ //this.UIElement.style.cursor="pointer";
7387
+ this.SetCursor({Cursor:"pointer"});
7380
7388
  this.UpDownDrag=dragUpDown;
7381
7389
  JSConsole.Chart.Log("[JSChartContainer::UIOnMouseDown] dragUpDown ",dragUpDown);
7382
7390
  }
@@ -7699,8 +7707,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7699
7707
 
7700
7708
  if (moveSetp<5 && yMoveSetp<5) return;
7701
7709
 
7702
- this.UIElement.style.cursor="default";
7703
-
7710
+ //this.UIElement.style.cursor="default";
7711
+ this.SetCursor({Cursor:"default"});
7704
7712
  var x=drag.Click.X-uielement.getBoundingClientRect().left;
7705
7713
  var y=drag.Click.Y-uielement.getBoundingClientRect().top;
7706
7714
  var x2=e.clientX-uielement.getBoundingClientRect().left;
@@ -7729,7 +7737,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7729
7737
  {
7730
7738
  var yMove=e.clientY-drag.LastMove.Y;
7731
7739
  JSConsole.Chart.Log("[JSChartContainer::OnDragMode_One] UpDownDrag ",this.UpDownDrag,yMove);
7732
- this.UIElement.style.cursor="pointer";
7740
+ //this.UIElement.style.cursor="pointer";
7741
+ this.SetCursor({Cursor:"pointer"});
7733
7742
  if (this.OnUpDonwFrameY(this.UpDownDrag, yMove))
7734
7743
  {
7735
7744
  bNeedDraw=true;
@@ -7776,7 +7785,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7776
7785
  var oneStepWidth=this.GetMoveOneStepWidth();
7777
7786
  if (moveSetp<oneStepWidth)
7778
7787
  {
7779
- this.UIElement.style.cursor=cursorStatus;
7788
+ //this.UIElement.style.cursor=cursorStatus;
7789
+ this.SetCursor({Cursor:cursorStatus});
7780
7790
  if (bNeedDraw) this.Draw();
7781
7791
  return;
7782
7792
  }
@@ -7806,7 +7816,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7806
7816
  if (this.DragDownloadData) this.DragDownloadData();
7807
7817
  }
7808
7818
  }
7809
- this.UIElement.style.cursor=cursorStatus;
7819
+ //this.UIElement.style.cursor=cursorStatus;
7820
+ this.SetCursor({Cursor:cursorStatus});
7810
7821
  }
7811
7822
  drag.LastMove.X=e.clientX;
7812
7823
  }
@@ -7874,7 +7885,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7874
7885
  var chartMove=this.GetExtendChartByClassName("DragMovePaint");
7875
7886
  if (chartMove && chartMove.Chart) chartMove.Chart.Clear();
7876
7887
  if (!this.OnDragChart(this.IndexChartDrag)) this.DrawDynamicInfo();
7877
- this.UIElement.style.cursor="default";
7888
+ //this.UIElement.style.cursor="default";
7889
+ this.SetCursor({Cursor:"default"});
7878
7890
  }
7879
7891
  else if (this.CustomChartDrag)
7880
7892
  {
@@ -7964,7 +7976,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7964
7976
  //清空数据
7965
7977
  JSConsole.Chart.Log('[KLineChartContainer::document.onmouseup]',e);
7966
7978
  if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.DragInfo=null;
7967
- this.UIElement.style.cursor="default";
7979
+ //this.UIElement.style.cursor="default";
7980
+ this.SetCursor({Cursor:"default"});
7968
7981
  this.MouseDrag=null;
7969
7982
  this.ClickDownPoint=null;
7970
7983
  this.IsOnTouch=false;
@@ -9799,7 +9812,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9799
9812
  var frameID=this.Frame.PtInFrame(x,y);
9800
9813
  if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
9801
9814
  this.CursorIndex=this.Frame.GetXData(x);
9802
-
9803
9815
 
9804
9816
 
9805
9817
  if (this.EnableBorderDrag && this.Frame && !this.CurrentChartDrawPicture)
@@ -9922,13 +9934,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9922
9934
 
9923
9935
  if (drawPictrueData.PointIndex===100)
9924
9936
  {
9925
- if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor;
9926
- else this.UIElement.style.cursor="move";
9937
+ if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor;
9938
+ else this.SetCursor({Cursor:"move"}); //this.UIElement.style.cursor="move";
9927
9939
  }
9928
9940
  else
9929
9941
  {
9930
- if (drawPictrueData.Cursor) this.UIElement.style.cursor=drawPictrueData.Cursor
9931
- else this.UIElement.style.cursor="pointer";
9942
+ if (drawPictrueData.Cursor) this.SetCursor(drawPictrueData); //this.UIElement.style.cursor=drawPictrueData.Cursor
9943
+ else this.SetCursor({Cursor:"pointer"}); //this.UIElement.style.cursor="pointer";
9932
9944
  }
9933
9945
 
9934
9946
  bDrawPicture=true;
@@ -9936,7 +9948,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9936
9948
  }
9937
9949
  else
9938
9950
  {
9939
- if (!this.MouseDrag) this.UIElement.style.cursor="default";
9951
+ if (!this.MouseDrag) this.SetCursor({Cursor:"default"}); //this.UIElement.style.cursor="default";
9940
9952
  }
9941
9953
  }
9942
9954
 
@@ -9959,7 +9971,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9959
9971
  this.DrawDynamicInfo(option);
9960
9972
  }
9961
9973
 
9962
- if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
9974
+ this.SetCursor(mouseStatus);
9963
9975
 
9964
9976
  if (this.IsShowTooltip && bDrawPicture==false)
9965
9977
  {
@@ -9987,6 +9999,17 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
9987
9999
  }
9988
10000
  }
9989
10001
 
10002
+ //设置鼠标形状 {Cursor:鼠标形状 }
10003
+ this.SetCursor=function(obj)
10004
+ {
10005
+ if (!obj || !obj.Cursor) return;
10006
+
10007
+ if (obj.Cursor=="default")
10008
+ this.UIElement.style.cursor=this.DefaultCursor;
10009
+ else
10010
+ this.UIElement.style.cursor=obj.Cursor;
10011
+ }
10012
+
9990
10013
  this.OnKeyDown=function(e)
9991
10014
  {
9992
10015
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash == true) return;
@@ -10370,6 +10393,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10370
10393
  return false;
10371
10394
  }
10372
10395
 
10396
+ this.IsMinuteContainer=function()
10397
+ {
10398
+ if (this.ClassName=="MinuteChartContainer" || this.ClassName=="MinuteChartHScreenContainer") return true;
10399
+
10400
+ return false;
10401
+ }
10402
+
10373
10403
  this.UpdatePointByCursorIndex=function(type) //type 1=根据十字光标更新 2=强制取消十字光标
10374
10404
  {
10375
10405
  var pt={X:null, Y:null};
@@ -12733,6 +12763,7 @@ function CoordinateInfo()
12733
12763
  this.Value; //坐标数据
12734
12764
  this.Message=[]; //坐标输出文字信息 0=左 1=右 2=内左 3=内右
12735
12765
  this.TextColor=g_JSChartResource.FrameSplitTextColor //文字颜色
12766
+ this.TextBGColor; //文字背景色
12736
12767
  this.TextColor2; //右侧文字颜色,空使用TextColor
12737
12768
  this.Font=g_JSChartResource.FrameSplitTextFont; //字体
12738
12769
  this.LineColor=g_JSChartResource.FrameSplitPen; //线段颜色
@@ -14245,9 +14276,10 @@ function AverageWidthFrame()
14245
14276
  this.Canvas.font=this.VerticalInfo[i].Font;
14246
14277
 
14247
14278
  var textLeft=0;
14248
- this.Canvas.fillStyle=item.TextColor;
14279
+
14249
14280
  this.Canvas.strokeStyle=item.TextColor;
14250
14281
  var testWidth=this.Canvas.measureText(this.VerticalInfo[i].Message[0]).width;
14282
+ var textHeight=this.Canvas.measureText("擎").width;
14251
14283
  if (x<testWidth/2)
14252
14284
  {
14253
14285
  this.Canvas.textAlign="left";
@@ -14281,6 +14313,15 @@ function AverageWidthFrame()
14281
14313
  yText+=lineLength+2*pixelRatio;
14282
14314
  }
14283
14315
 
14316
+ //item.TextBGColor="rgb(0,255,0)";
14317
+ if (item.TextBGColor) //文字背景色
14318
+ {
14319
+ var rtText={ Left:textLeft, Top:yText+this.XBottomOffset, Width:testWidth, Height:textHeight };
14320
+ this.Canvas.fillStyle=item.TextBGColor;
14321
+ this.Canvas.fillRect(rtText.Left-1, rtText.Top, rtText.Width+2, rtText.Height);
14322
+ }
14323
+
14324
+ this.Canvas.fillStyle=item.TextColor;
14284
14325
  this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);
14285
14326
  textRightPrev=textLeft+testWidth;
14286
14327
  }
@@ -24945,9 +24986,12 @@ function IChartPainting()
24945
24986
  }
24946
24987
  else if (valueType==3)
24947
24988
  {
24948
- var price=this.Data.Data[i].Close;
24949
- if (price==null) continue;
24950
- value=price/this.YClose*this.MainYClose;
24989
+ var minItem=this.Data.Data[i];
24990
+ var mainItem=this.MainData.Data[i];
24991
+ if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
24992
+ if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
24993
+ var price=minItem.Close;
24994
+ var value=price/minItem.YClose*mainItem.YClose;
24951
24995
  }
24952
24996
  else if (valueType==4)
24953
24997
  {
@@ -25067,9 +25111,12 @@ function IChartPainting()
25067
25111
  }
25068
25112
  else if (valueType==3)
25069
25113
  {
25070
- var price=this.Data.Data[i].Close;
25071
- if (price==null) continue;
25072
- var value=price/this.YClose*this.MainYClose;
25114
+ var minItem=this.Data.Data[i];
25115
+ var mainItem=this.MainData.Data[i];
25116
+ if (!minItem || !IFrameSplitOperator.IsNumber(minItem.Close) || !IFrameSplitOperator.IsNumber(minItem.YClose)) continue;
25117
+ if (!mainItem || !IFrameSplitOperator.IsNumber(mainItem.Close) || !IFrameSplitOperator.IsNumber(mainItem.YClose)) continue;
25118
+ var price=minItem.Close;
25119
+ var value=price/minItem.YClose*mainItem.YClose;
25073
25120
  }
25074
25121
  else
25075
25122
  {
@@ -35719,19 +35766,16 @@ function ChartOverlayMinutePriceLine()
35719
35766
 
35720
35767
  this.Color="rgb(65,105,225)";
35721
35768
  this.MainData; //主图数据
35722
- this.MainYClose; //主图股票的前收盘价
35723
35769
  this.SourceData; //原始数据
35724
35770
 
35725
35771
  this.ClassName="ChartOverlayMinutePriceLine";
35726
35772
  this.Title;
35727
35773
  this.Symbol; //叠加的股票代码
35728
- this.YClose; //叠加的股票前收盘
35729
35774
  this.Status=OVERLAY_STATUS_ID.STATUS_NONE_ID;
35730
35775
 
35731
35776
  this.OverlayType=0; //叠加方式 0=百分比叠加 1=绝对叠加
35732
35777
  this.IsCalcuateMaxMin=true; //是否参与计算Y轴的最大最小值
35733
35778
 
35734
-
35735
35779
  this.SetOption=function(option)
35736
35780
  {
35737
35781
  if (option)
@@ -35743,19 +35787,21 @@ function ChartOverlayMinutePriceLine()
35743
35787
 
35744
35788
  this.PtInChart=function(x,y)
35745
35789
  {
35746
- var option={ MinuteOverlayPrice:true, YClose:this.YClose, MainYClose:this.MainYClose, OverlayType:this.OverlayType };
35790
+ var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
35747
35791
  return this.PtInLine(x, y, option);
35748
35792
  }
35749
35793
 
35750
35794
  this.DrawSelectedStatus=function()
35751
35795
  {
35752
- var option={ MinuteOverlayPrice:true, YClose:this.YClose, MainYClose:this.MainYClose, OverlayType:this.OverlayType };
35796
+ var option={ MinuteOverlayPrice:true, OverlayType:this.OverlayType };
35753
35797
  this.DrawLinePoint(option);
35754
35798
  }
35755
35799
 
35756
35800
  this.Draw=function()
35757
35801
  {
35758
35802
  if (!this.Data) return;
35803
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
35804
+
35759
35805
  if (this.NotSupportMessage)
35760
35806
  {
35761
35807
  this.DrawNotSupportmessage();
@@ -35776,37 +35822,53 @@ function ChartOverlayMinutePriceLine()
35776
35822
  var bFirstPoint=true;
35777
35823
  var drawCount=0;
35778
35824
  var xOffset=0, showValue=0;
35825
+ var yClose=null, mainYClose=null;
35826
+ var pointCount=0;
35779
35827
  for(var i=this.Data.DataOffset+xOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
35780
35828
  {
35781
- var value=this.Data.Data[i].Close;
35782
- if (value==null) continue;
35829
+ var item=this.Data.Data[i];
35830
+ if (item && IFrameSplitOperator.IsNumber(item.Close))
35831
+ {
35832
+ if (bFirstPoint) //百分比使用每天的昨收计算
35833
+ {
35834
+ yClose=item.YClose;
35835
+ var minItem=this.MainData.Data[i];
35836
+ mainYClose=minItem.YClose;
35837
+ }
35783
35838
 
35784
- showValue=value; //绝对叠加
35785
- if (this.OverlayType==0) showValue=value/this.YClose*this.MainYClose; //百分比
35839
+ var value=item.Close;
35840
+ showValue=value; //绝对叠加
35786
35841
 
35787
- var x=this.ChartFrame.GetXFromIndex(j);
35788
- var y=this.ChartFrame.GetYFromData(showValue, false);
35842
+ if (this.OverlayType==0)
35843
+ showValue=value/yClose*mainYClose; //百分比
35789
35844
 
35790
- if (bFirstPoint)
35791
- {
35792
- this.Canvas.strokeStyle=this.Color;
35793
- this.Canvas.beginPath();
35794
- if (isHScreen) this.Canvas.moveTo(y,x);
35795
- else this.Canvas.moveTo(x,y);
35796
- bFirstPoint=false;
35797
- }
35798
- else
35799
- {
35800
- if (isHScreen) this.Canvas.lineTo(y,x);
35801
- else this.Canvas.lineTo(x,y);
35845
+ var x=this.ChartFrame.GetXFromIndex(j);
35846
+ var y=this.ChartFrame.GetYFromData(showValue, false);
35847
+
35848
+ if (bFirstPoint)
35849
+ {
35850
+ this.Canvas.strokeStyle=this.Color;
35851
+ this.Canvas.beginPath();
35852
+ if (isHScreen) this.Canvas.moveTo(y,x);
35853
+ else this.Canvas.moveTo(x,y);
35854
+ bFirstPoint=false;
35855
+ }
35856
+ else
35857
+ {
35858
+ if (isHScreen) this.Canvas.lineTo(y,x);
35859
+ else this.Canvas.lineTo(x,y);
35860
+ }
35861
+
35862
+ ++drawCount;
35802
35863
  }
35803
35864
 
35804
- ++drawCount;
35865
+ ++pointCount;
35805
35866
 
35806
- if (drawCount>=minuteCount) //上一天的数据和这天地数据线段要断开
35867
+ if (pointCount>=minuteCount) //上一天的数据和这天地数据线段要断开
35807
35868
  {
35808
35869
  bFirstPoint=true;
35809
- this.Canvas.stroke();
35870
+ pointCount=0;
35871
+ if (drawCount>0) this.Canvas.stroke();
35810
35872
  drawCount=0;
35811
35873
  }
35812
35874
  }
@@ -35819,24 +35881,46 @@ function ChartOverlayMinutePriceLine()
35819
35881
  this.GetMaxMin=function()
35820
35882
  {
35821
35883
  var xPointCount=this.ChartFrame.XPointCount;
35822
- var range={};
35884
+ var range={ Min:null, Max:null };
35823
35885
  if (!this.IsCalcuateMaxMin) return range;
35824
- if (this.YClose==null) return range;
35825
35886
 
35826
- range.Min=this.MainYClose;
35827
- range.Max=this.MainYClose;
35887
+ var minuteCount=this.ChartFrame.MinuteCount;
35888
+ var yClose=null, mainYClose=null;
35889
+ var bFirstPoint=true;
35890
+ var pointCount=0;
35828
35891
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j)
35829
35892
  {
35830
- var value=this.Data.Data[i].Close;
35831
- if (value==null) continue;
35893
+ var item=this.Data.Data[i];
35894
+ if (!item || !IFrameSplitOperator.IsNumber(item.Close))
35895
+ {
35896
+ ++pointCount;
35897
+ continue;
35898
+ }
35832
35899
 
35833
- if (this.OverlayType==0) value=value/this.YClose*this.MainYClose;
35900
+ if (bFirstPoint)
35901
+ {
35902
+ yClose=item.YClose;
35903
+ var minItem=this.MainData.Data[i];
35904
+ mainYClose=minItem.YClose;
35905
+ bFirstPoint=false;
35906
+ }
35907
+
35908
+ var value=item.Close;
35909
+ if (this.OverlayType==0) value=value/yClose*mainYClose;
35834
35910
 
35835
35911
  if (range.Max==null) range.Max=value;
35836
35912
  if (range.Min==null) range.Min=value;
35837
35913
 
35838
35914
  if (range.Max<value) range.Max=value;
35839
35915
  if (range.Min>value) range.Min=value;
35916
+
35917
+ ++pointCount;
35918
+
35919
+ if (pointCount>=minuteCount)
35920
+ {
35921
+ bFirstPoint=true;
35922
+ pointCount=0;
35923
+ }
35840
35924
  }
35841
35925
 
35842
35926
  //JSConsole.Chart.Log(`[ChartOverlayMinutePriceLine::GetMaxMin] max=${range.Max} min=${range.Min}`);
@@ -48752,6 +48836,7 @@ function FrameSplitMinuteX()
48752
48836
  info.Value=item[0];
48753
48837
  if (this.ShowText) info.Message[0]=item[3];
48754
48838
  if (item[4]) info.LineColor=item[4]; //线段颜色
48839
+ if (item[5]) info.TextBGColor=item[5]; //文字背景色
48755
48840
  this.Frame.VerticalInfo[i]=info;
48756
48841
  }
48757
48842
  }
@@ -74828,7 +74913,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
74828
74913
  if (moveSetp<5 && yMoveSetp<5) return;
74829
74914
  if (!this.EnableSelectRect) return;
74830
74915
 
74831
- this.UIElement.style.cursor="default";
74916
+ //this.UIElement.style.cursor="default";
74917
+ this.SetCursor({Cursor:"default"});
74832
74918
  var x=drag.Click.X-uielement.getBoundingClientRect().left;
74833
74919
  var y=drag.Click.Y-uielement.getBoundingClientRect().top;
74834
74920
  var x2=e.clientX-uielement.getBoundingClientRect().left;
@@ -76964,7 +77050,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
76964
77050
  //叠加股票
76965
77051
  this.OverlaySymbol=function(symbol,option)
76966
77052
  {
76967
- for(var i in this.OverlayChartPaint)
77053
+ for(var i=0; i<this.OverlayChartPaint.length; ++i)
76968
77054
  {
76969
77055
  var item=this.OverlayChartPaint[i];
76970
77056
  if (item.Symbol==symbol)
@@ -76984,11 +77070,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
76984
77070
  if (option && option.Color) paint.Color=option.Color; //外部设置颜色
76985
77071
  else paint.Color=g_JSChartResource.OverlaySymbol.Color[g_JSChartResource.OverlaySymbol.Random%g_JSChartResource.OverlaySymbol.Color.length];
76986
77072
  ++g_JSChartResource.OverlaySymbol.Random;
76987
- if (this.ChartPaint[0].YClose>0 && this.ChartPaint[0].Data) //绑定主图数据
76988
- {
76989
- paint.MainData=this.ChartPaint[0].Data;
76990
- paint.MainYClose=this.ChartPaint[0].YClose;
76991
- }
77073
+ paint.MainData=this.SourceData; //绑定主图数据
76992
77074
 
76993
77075
  if (paint.SetOption) paint.SetOption(option);
76994
77076
 
@@ -77956,7 +78038,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77956
78038
  for(var i=0; i<this.OverlayChartPaint.length; ++i)
77957
78039
  {
77958
78040
  let item=this.OverlayChartPaint[i];
77959
- if (!item.MainData || !(item.MainYClose>0) ) continue;
78041
+ if (!item.MainData) continue;
77960
78042
  if (item.Status!=OVERLAY_STATUS_ID.STATUS_NONE_ID) continue;
77961
78043
  var symbol=item.Symbol;
77962
78044
  if (!symbol) continue;
@@ -78017,7 +78099,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78017
78099
  for(var j=0; j<this.OverlayChartPaint.length; ++j)
78018
78100
  {
78019
78101
  var item=this.OverlayChartPaint[j];
78020
- if (!item.MainData || !(item.MainYClose>0) ) continue;
78102
+ if (!item.MainData) continue;
78021
78103
  if (overlayData.symbol==item.Symbol)
78022
78104
  {
78023
78105
  this.RecvOverlayMinuteData(overlayData, item, { Redraw:false });
@@ -78178,6 +78260,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78178
78260
  {
78179
78261
  var empytData=new ChartData();
78180
78262
  empytData.Date=item.Date;
78263
+ empytData.Data.length=item.Data.length;
78181
78264
  overlayDayData.push(empytData);
78182
78265
  }
78183
78266
  }
@@ -78411,11 +78494,10 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
78411
78494
  this.ExtendChartPaint[0].Name=this.Name;
78412
78495
  }
78413
78496
 
78414
- for(var i in this.OverlayChartPaint)
78497
+ for(var i=0; i<this.OverlayChartPaint.length; ++i)
78415
78498
  {
78416
78499
  var item=this.OverlayChartPaint[i];
78417
- item.MainData=this.ChartPaint[0].Data; //叠加股票
78418
- item.MainYClose=yClose;
78500
+ item.MainData=minuteData; //绑定主图数据
78419
78501
  }
78420
78502
  }
78421
78503
 
@@ -89774,7 +89856,7 @@ function MinuteCoordinateData()
89774
89856
  {
89775
89857
  Full: //完整模式
89776
89858
  [
89777
- [0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色
89859
+ [0, 0, "rgb(200,200,200)", "09:30"], //[0]=索引 [1]=线段类型 [2]=文字颜色(弃用) [3]=刻度文字 [4]=线段颜色 [5]=背景色
89778
89860
  [31, 0, "RGB(200,200,200)", "10:00"],
89779
89861
  [61, 0, "RGB(200,200,200)", "10:30"],
89780
89862
  [91, 0, "RGB(200,200,200)", "11:00"],
@@ -102201,6 +102283,36 @@ function JSDraw(errorHandler,symbolData)
102201
102283
  return result;
102202
102284
  }
102203
102285
 
102286
+ //叠加一个K线
102287
+ this.DRAWOVERLAYKLINE=function(open, high, low, close)
102288
+ {
102289
+ var drawData=[];
102290
+ var result={DrawData:drawData, DrawType:'DRAWOVERLAYKLINE'};
102291
+ var count=Math.max(high.length, open.length,low.length,close.length);
102292
+
102293
+ var kData=this.SymbolData.Data.Data;
102294
+ for(var i=0;i<count;++i)
102295
+ {
102296
+ var item={Open:null,High:null, Low:null, Close:null};
102297
+ var kItem=kData[i];
102298
+ if (i<high.length && i<open.length && i<low.length && i<close.length &&
102299
+ IFrameSplitOperator.IsNumber(open[i]) && IFrameSplitOperator.IsNumber(high[i]) && IFrameSplitOperator.IsNumber(low[i]) && IFrameSplitOperator.IsNumber(low[i]))
102300
+ {
102301
+
102302
+ item.Open=open[i];
102303
+ item.High=high[i];
102304
+ item.Low=low[i];
102305
+ item.Close=close[i];
102306
+ item.Date=kItem.Date;
102307
+ if (IFrameSplitOperator.IsNumber(kItem.Time)) item.Time=kItem.Time;
102308
+ }
102309
+
102310
+ drawData[i]=item;
102311
+ }
102312
+
102313
+ return result;
102314
+ }
102315
+
102204
102316
  /*
102205
102317
  DRAWCOLORKLINE 绘制K线
102206
102318
  用法:
@@ -103708,7 +103820,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
103708
103820
  {
103709
103821
  let setFunctionName=new Set(
103710
103822
  [
103711
- "STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',
103823
+ "STICKLINE","DRAWTEXT",'SUPERDRAWTEXT','DRAWLINE','DRAWBAND','DRAWKLINE',"DRAWKLINE1",'DRAWKLINE_IF',"DRAWCOLORKLINE",'PLOYLINE',"DRAWOVERLAYKLINE",
103712
103824
  'POLYLINE','DRAWNUMBER',"DRAWNUMBER_FIX",'DRAWICON','DRAWCHANNEL','PARTLINE','DRAWTEXT_FIX','DRAWGBK','DRAWTEXT_LINE','DRAWRECTREL',"DRAWTEXTABS","DRAWTEXTREL",
103713
103825
  'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
103714
103826
  "VERTLINE","HORLINE","TIPICON"
@@ -109992,6 +110104,10 @@ function JSExecute(ast,option)
109992
110104
  node.Draw=this.Draw.DRAWKLINE_IF(args[0],args[1],args[2],args[3],args[4]);
109993
110105
  node.Out=[];
109994
110106
  break;
110107
+ case "DRAWOVERLAYKLINE":
110108
+ node.Draw=this.Draw.DRAWOVERLAYKLINE(args[0],args[1],args[2],args[3]);
110109
+ node.Out=[];
110110
+ break;
109995
110111
  case "DRAWCOLORKLINE":
109996
110112
  node.Draw=this.Draw.DRAWCOLORKLINE(args[0],args[1],args[2]);
109997
110113
  node.Out=[];
@@ -112613,6 +112729,28 @@ function ScriptIndex(name,script,args,option)
112613
112729
  hqChart.ChartPaint.push(chart);
112614
112730
  }
112615
112731
 
112732
+ this.CreateOverlayKLine=function(hqChart,windowIndex,varItem,id)
112733
+ {
112734
+ var chart=null;
112735
+ if (hqChart.IsKLineContainer()) chart=new ChartOverlayKLine();
112736
+ else if (hqChart.IsMinuteContainer()) chart=new ChartOverlayMinutePriceLine();
112737
+ else return;
112738
+
112739
+ chart.Canvas=hqChart.Canvas;
112740
+ chart.Name=varItem.Name;
112741
+ chart.Identify=this.Guid;
112742
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
112743
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
112744
+
112745
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color); //如果设置了颜色,使用外面设置的颜色
112746
+ else chart.Color=this.GetDefaultColor(id);
112747
+
112748
+ chart.Data.Data=varItem.Draw.DrawData;
112749
+ chart.MainData=hqChart.ChartPaint[0].Data;//绑定K线
112750
+
112751
+ hqChart.ChartPaint.push(chart);
112752
+ }
112753
+
112616
112754
  this.CreateDrawColorKLine=function(hqChart,windowIndex,varItem,i)
112617
112755
  {
112618
112756
  let chart=new ChartColorKline();
@@ -113453,6 +113591,9 @@ function ScriptIndex(name,script,args,option)
113453
113591
  case "DRAWKLINE1":
113454
113592
  this.CreateKLine(hqChart,windowIndex,item,i);
113455
113593
  break;
113594
+ case "DRAWOVERLAYKLINE":
113595
+ this.CreateOverlayKLine(hqChart,windowIndex,item,i);
113596
+ break;
113456
113597
  case "DRAWCOLORKLINE":
113457
113598
  this.CreateDrawColorKLine(hqChart,windowIndex,item,i);
113458
113599
  break;
@@ -128322,7 +128463,7 @@ function ScrollBarBGChart()
128322
128463
 
128323
128464
 
128324
128465
 
128325
- var HQCHART_VERSION="1.1.12504";
128466
+ var HQCHART_VERSION="1.1.12515";
128326
128467
 
128327
128468
  function PrintHQChartVersion()
128328
128469
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12504";
8
+ var HQCHART_VERSION="1.1.12515";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -17,8 +17,8 @@
17
17
 
18
18
  function JSStockResource()
19
19
  {
20
- this.Domain = "https://opensource.zealink.com"; //API域名
21
- this.CacheDomain = "https://opensourcecache.zealink.com"; //缓存域名
20
+ this.Domain = "http://127.0.0.1:8886"; //API域名
21
+ this.CacheDomain = "http://127.0.0.1:8886"; //缓存域名
22
22
  }
23
23
 
24
24
  var g_JSStockResource = new JSStockResource();