hqchart 1.1.14172 → 1.1.14179

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.
@@ -5999,16 +5999,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5999
5999
  }
6000
6000
  }
6001
6001
 
6002
- //历史分钟数据 更改日期
6003
- this.ChangeTradeDate=function(tradeDate)
6004
- {
6005
- if(this.JSChartContainer && typeof(this.JSChartContainer.ChangeTradeDate)=='function')
6006
- {
6007
- JSConsole.Chart.Log('[JSChart:ChangeTradeDate] date', tradeDate);
6008
- this.JSChartContainer.ChangeTradeDate(tradeDate);
6009
- }
6010
- }
6011
-
6012
6002
  //多日走势图
6013
6003
  this.ChangeDayCount=function(count, option)
6014
6004
  {
@@ -6211,6 +6201,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
6211
6201
  return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
6212
6202
  }
6213
6203
  }
6204
+
6205
+ this.ExecuteMenuCommand=function(cmdID, aryArgs)
6206
+ {
6207
+ if(this.JSChartContainer && typeof(this.JSChartContainer.ExecuteMenuCommand)=='function')
6208
+ {
6209
+ JSConsole.Chart.Log('[JSChart:ExecuteMenuCommand] ');
6210
+ return this.JSChartContainer.ExecuteMenuCommand(cmdID, aryArgs);
6211
+ }
6212
+ }
6214
6213
  }
6215
6214
 
6216
6215
  JSChart.LastVersion=null; //最新的版本号
@@ -13885,22 +13884,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13885
13884
  this.ShowDrawToolDialog();
13886
13885
  break;
13887
13886
  case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:
13888
- var option={Name:'筹码分布', ShowType:1, Width:230 };
13889
- var extendChart=this.CreateExtendChart(option.Name, option); //创建扩展图形
13890
- this.SetSizeChange(true);
13891
- this.Draw();
13892
- break;
13893
- case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13894
- var StockChip=this.GetExtendChartByClassName('StockChip');
13895
- if (StockChip)
13887
+ //var option={Name:'筹码分布', ShowType:1, Width:230 };
13888
+ var stockChip=this.GetStockChipChart();
13889
+ if (stockChip) return;
13890
+ if (srcParam)
13896
13891
  {
13897
- var chipWidth=StockChip.Chart.Width;
13898
- this.DeleteExtendChart(StockChip);
13899
- this.Frame.ChartBorder.Right-=chipWidth;
13892
+ var extendChart=this.CreateExtendChart(srcParam, aryArgs[1]); //创建扩展图形
13900
13893
  this.SetSizeChange(true);
13901
13894
  this.Draw();
13902
13895
  }
13903
13896
  break;
13897
+ case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13898
+ if (this.DeleteStockChipChart) this.DeleteStockChipChart();
13899
+ break;
13904
13900
  case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:
13905
13901
  if (IFrameSplitOperator.IsBool(srcParam))
13906
13902
  this.EnableSelectRect=srcParam;
@@ -17831,7 +17827,8 @@ function AverageWidthFrame()
17831
17827
  var borderTop=this.ChartBorder.Top;
17832
17828
  var borderBottom=this.ChartBorder.Bottom;
17833
17829
  var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17834
- var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17830
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17831
+ var isDrawRight=this.IsShowRightHorizontal();
17835
17832
  }
17836
17833
  else
17837
17834
  {
@@ -17839,7 +17836,7 @@ function AverageWidthFrame()
17839
17836
  var borderLeft=this.ChartBorder.Left;
17840
17837
  var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17841
17838
  //var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17842
- isDrawRight=this.IsShowRightHorizontal();
17839
+ var isDrawRight=this.IsShowRightHorizontal();
17843
17840
  }
17844
17841
 
17845
17842
  if (!isDrawRight && !isDrawLeft) return null;
@@ -22529,6 +22526,25 @@ function KLineHScreenFrame()
22529
22526
  }
22530
22527
  }
22531
22528
 
22529
+ this.IsShowRightHorizontal=function()
22530
+ {
22531
+ var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22532
+ var borderBottom=this.ChartBorder.Bottom;
22533
+ if (borderBottom<=10*pixelTatio) return false;
22534
+
22535
+ if (this.YTextPosition[1]==2) return false;
22536
+ if (this.IsShowYText[1]===false) return false;
22537
+
22538
+ if (this.GlobalOption && this.GlobalOption.RightHorizontal)
22539
+ {
22540
+ var item=this.GlobalOption.RightHorizontal;
22541
+ if (item.Show===false) return false;
22542
+ }
22543
+
22544
+ return true;
22545
+ }
22546
+
22547
+
22532
22548
  //画Y轴
22533
22549
  this.DrawHorizontal=function()
22534
22550
  {
@@ -22544,7 +22560,8 @@ function KLineHScreenFrame()
22544
22560
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22545
22561
 
22546
22562
  var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
22547
- var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
22563
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
22564
+ var isDrawRight=this.IsShowRightHorizontal();
22548
22565
 
22549
22566
  for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从左往右画分割线
22550
22567
  {
@@ -48529,18 +48546,35 @@ function StockChipPhone()
48529
48546
  this.ClassName='StockChipPhone';
48530
48547
  this.ShowType=0; //0=所有筹码 手机版只支持0
48531
48548
 
48549
+ //手机端没有按钮
48550
+ this.DrawToolbar=function(moveonPoint, mouseStatus) { }
48551
+
48532
48552
  this.Draw=function()
48533
48553
  {
48534
- this.ShowType=0;
48554
+ this.IsHScreen=this.ChartFrame.IsHScreen==true;
48535
48555
  this.PixelRatio=GetDevicePixelRatio();
48536
- var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
48537
- var top=ToFixedPoint(this.ChartBorder.GetTop());
48538
- var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
48539
- var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
48540
- var width=right-left;
48541
- var height=bottom-top;
48542
- this.ClientRect={Left:left,Top:top,Width:width,Height:height};
48543
-
48556
+ if (this.IsHScreen)
48557
+ {
48558
+ var border=this.ChartBorder.GetHScreenBorder();
48559
+ var left=ToFixedPoint(border.Left);
48560
+ var right=ToFixedPoint(border.Right);
48561
+ var top=ToFixedPoint(border.Bottom+this.Left);
48562
+ var bottom=ToFixedPoint(border.ChartHeight-2*this.PixelRatio);
48563
+ this.ClientRect={Left:left,Top:top, Right:right, Bottom:bottom};
48564
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48565
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48566
+ }
48567
+ else
48568
+ {
48569
+ var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
48570
+ var top=ToFixedPoint(this.ChartBorder.GetTop());
48571
+ var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
48572
+ var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
48573
+ this.ClientRect={Left:left,Top:top,Right:right, Bottom:bottom};
48574
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48575
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48576
+ }
48577
+
48544
48578
  if (ChartData.IsTickPeriod(this.HQChart.Period))
48545
48579
  {
48546
48580
 
@@ -48549,11 +48583,12 @@ function StockChipPhone()
48549
48583
  {
48550
48584
  if (this.CalculateChip())
48551
48585
  {
48552
- this.DrawFrame();
48553
48586
  this.DrawAllChip();
48554
-
48555
- this.CalculateCast(); //计算成本
48556
- this.DrawChipInfo();
48587
+ if (this.ShowType==1|| this.ShowType==2) this.DrawDayChip();
48588
+
48589
+ this.CalculateCast(); //计算成本
48590
+ if (this.IsHScreen) this.DrawHScreenChipInfo();
48591
+ else this.DrawChipInfo();
48557
48592
  }
48558
48593
  }
48559
48594
 
@@ -48561,17 +48596,170 @@ function StockChipPhone()
48561
48596
  this.SizeChange=false;
48562
48597
  }
48563
48598
 
48564
- this.DrawToolbar=function(moveonPoint, mouseStatus)
48599
+ this.DrawAllChip=function()
48565
48600
  {
48601
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48602
+ var selectPrice=this.Data.SelectData.Close;
48603
+ var aryProfitPoint=[];
48604
+ var aryNoProfitPoint=[];
48605
+ var totalVol=0,totalAmount=0,totalProfitVol=0, totalYProfitVol=0; //总的成交量, 总的成交金额, 总的盈利的成交量
48606
+ var yPrice=this.Data.YPrice;
48607
+
48608
+ var maxPrice=KLineFrame.HorizontalMax;
48609
+ var minPrice=KLineFrame.HorizontalMin;
48610
+
48611
+ var MaxVol=1;
48612
+ for(var i=0;i<this.Data.AllChip.length;++i)
48613
+ {
48614
+ var vol=this.Data.AllChip[i];
48615
+ if(!vol) continue;
48616
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48617
+ totalVol+=vol;
48618
+ totalAmount+=price*vol;
48619
+
48620
+ if (price<yPrice) totalYProfitVol+=vol; //获利的成交量
48621
+ if (price<selectPrice) totalProfitVol+=vol; //鼠标当前位置 获利的成交量
48566
48622
 
48623
+ if (price<=maxPrice && price>=minPrice)
48624
+ {
48625
+ if (MaxVol<vol) MaxVol=vol;
48626
+ }
48627
+ }
48628
+ this.Data.MaxVol=MaxVol; //把成交量最大值替换成 当前屏成交量最大值
48629
+
48630
+ for(var i=0;i<this.Data.AllChip.length;++i)
48631
+ {
48632
+ var vol=this.Data.AllChip[i];
48633
+ if(!vol) continue;
48634
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48635
+ if (price>maxPrice || price<minPrice) continue;
48636
+
48637
+ if (this.IsHScreen)
48638
+ {
48639
+ var y=KLineFrame.GetYFromData(price,false);
48640
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48641
+ }
48642
+ else
48643
+ {
48644
+ var y=KLineFrame.GetYFromData(price,false);
48645
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48646
+ }
48647
+
48648
+ if (price<selectPrice) aryProfitPoint.push({X:x,Y:y});
48649
+ else aryNoProfitPoint.push({X:x,Y:y});
48650
+ }
48651
+
48652
+ this.Data.ChipInfo=
48653
+ {
48654
+ Vol:totalVol, AveragePrice:totalAmount/totalVol, ProfitVol:totalProfitVol,
48655
+ ProfitRate:totalVol>0?totalProfitVol/totalVol*100:0,
48656
+ YProfitRate:totalVol>0?totalYProfitVol/totalVol*100:0
48657
+ };
48658
+
48659
+ if (this.ShowType==0)
48660
+ {
48661
+ this.DrawLines(aryProfitPoint,this.ColorProfit);
48662
+ this.DrawLines(aryNoProfitPoint,this.ColorNoProfit);
48663
+ var averagePrice=this.Data.ChipInfo.AveragePrice;
48664
+ if (averagePrice>0 && averagePrice<=maxPrice && averagePrice>=minPrice)
48665
+ {
48666
+ averagePrice=averagePrice.toFixed(2);
48667
+ this.DrawAveragePriceLine(aryProfitPoint,aryNoProfitPoint,KLineFrame.GetYFromData(averagePrice),this.ColorAveragePrice);
48668
+ }
48669
+ }
48670
+ else //在火焰山模式下, 筹码用一个颜色
48671
+ {
48672
+ this.DrawLines(aryProfitPoint,this.ColorBG);
48673
+ this.DrawLines(aryNoProfitPoint,this.ColorBG);
48674
+ }
48675
+ }
48676
+
48677
+ this.DrawLines=function(aryPoint,color)
48678
+ {
48679
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48680
+
48681
+ this.Canvas.strokeStyle=color;
48682
+ this.Canvas.beginPath();
48683
+ for(var i =0; i<aryPoint.length; ++i)
48684
+ {
48685
+ var item=aryPoint[i];
48686
+ if (this.IsHScreen)
48687
+ {
48688
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48689
+ this.Canvas.lineTo(item.Y,item.X);
48690
+ }
48691
+ else
48692
+ {
48693
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48694
+ this.Canvas.lineTo(item.X,item.Y);
48695
+ }
48696
+
48697
+ }
48698
+ this.Canvas.stroke();
48699
+ }
48700
+
48701
+ this.DrawAveragePriceLine=function(aryProfitPoint,aryNoProfitPoint,y,color)
48702
+ {
48703
+ for(var i=0; i<aryProfitPoint.length; ++i)
48704
+ {
48705
+ var item=aryProfitPoint[i];
48706
+ if (item.Y==y)
48707
+ {
48708
+ this.Canvas.strokeStyle=color;
48709
+ this.Canvas.beginPath();
48710
+ if (this.IsHScreen)
48711
+ {
48712
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48713
+ this.Canvas.lineTo(item.Y,item.X);
48714
+ }
48715
+ else
48716
+ {
48717
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48718
+ this.Canvas.lineTo(item.X,item.Y);
48719
+ }
48720
+
48721
+ this.Canvas.stroke();
48722
+ return;
48723
+ }
48724
+ }
48725
+
48726
+ for(var i=0; i<aryNoProfitPoint.length; ++i)
48727
+ {
48728
+ var item=aryNoProfitPoint[i];
48729
+ if (item.Y==y)
48730
+ {
48731
+ this.Canvas.strokeStyle=color;
48732
+ this.Canvas.beginPath();
48733
+ if (this.IsHScreen)
48734
+ {
48735
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48736
+ this.Canvas.lineTo(item.Y,item.X);
48737
+ }
48738
+ else
48739
+ {
48740
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48741
+ this.Canvas.lineTo(item.X,item.Y);
48742
+ }
48743
+ this.Canvas.stroke();
48744
+ return;
48745
+ }
48746
+ }
48567
48747
  }
48568
48748
 
48569
48749
  this.GetChipInfoTitle=function()
48570
48750
  {
48571
48751
  var aryText=[]; //从底部往上
48572
48752
 
48573
- var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48574
- aryText.push(item);
48753
+ if (ChartData.IsDayPeriod(this.HQChart.Period, true))
48754
+ {
48755
+ var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48756
+ aryText.push(item);
48757
+ }
48758
+ else if (ChartData.IsMinutePeriod(this.HQChart.Period, true))
48759
+ {
48760
+ var item={ Title:`${IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date)} ${IFrameSplitOperator.FormatTimeString(this.Data.SelectData.Time, "HH:MM")}` };
48761
+ aryText.push(item);
48762
+ }
48575
48763
 
48576
48764
  var item={ Title:"集中度:", Text:"--.--%", };
48577
48765
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
@@ -48591,9 +48779,66 @@ function StockChipPhone()
48591
48779
  aryText.push(item);
48592
48780
  }
48593
48781
 
48782
+ if (this.IsHScreen) //横屏直接就显示数值 画进度条太麻烦了
48783
+ {
48784
+ var item={ Title:"获利比例:", Text: `${this.Data.ChipInfo.ProfitRate.toFixed(2)}%`};
48785
+ aryText.push(item);
48786
+ }
48787
+ else
48788
+ {
48789
+ var item={ Title:"获利比例:", Type:1 };
48790
+ aryText.push(item);
48791
+ }
48792
+
48594
48793
  return aryText;
48595
48794
  }
48596
48795
 
48796
+ this.DrawHScreenChipInfo=function()
48797
+ {
48798
+ var aryText=this.GetChipInfoTitle();
48799
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
48800
+
48801
+ this.Canvas.font=this.Font;
48802
+ this.Canvas.fillStyle=this.InfoColor;
48803
+ this.Canvas.textBaseline='bottom';
48804
+ this.Canvas.textAlign='left';
48805
+
48806
+ var top=this.ClientRect.Top+2*this.PixelRatio;
48807
+ var left=this.ClientRect.Left+2*this.PixelRatio;
48808
+ var bottom=this.ClientRect.Bottom;
48809
+ var lineHeight=this.LineHeight*GetDevicePixelRatio();
48810
+
48811
+ this.Canvas.save();
48812
+ this.Canvas.translate(left, top);
48813
+ this.Canvas.rotate(90 * Math.PI / 180);
48814
+
48815
+ var yText=0, xText=0;
48816
+ for(var i=0;i<aryText.length;++i)
48817
+ {
48818
+ var item=aryText[i];
48819
+ yText=0;
48820
+ var textColor=item.TitleColor;
48821
+ if (item.TitleColor) textColor=item.TitleColor;
48822
+ this.Canvas.fillStyle=textColor;
48823
+ this.Canvas.fillText(item.Title,yText,xText);
48824
+ var textWidth=this.Canvas.measureText(item.Title).width+4*this.PixelRatio;
48825
+ var yText=textWidth;
48826
+
48827
+ if (item.Text)
48828
+ {
48829
+ var textColor=item.TitleColor;
48830
+ if (item.TextColor) textColor=item.TextColor;
48831
+ this.Canvas.fillStyle=textColor;
48832
+ this.Canvas.fillText(item.Text,yText,xText);
48833
+ }
48834
+
48835
+ xText-=lineHeight;
48836
+ }
48837
+
48838
+
48839
+ this.Canvas.restore();
48840
+ }
48841
+
48597
48842
  this.DrawChipInfo=function()
48598
48843
  {
48599
48844
  var aryText=this.GetChipInfoTitle();
@@ -48621,27 +48866,94 @@ function StockChipPhone()
48621
48866
  var textWidth=this.Canvas.measureText(item.Title).width+4;
48622
48867
  var xText=left+textWidth;
48623
48868
 
48624
- var textColor=item.TitleColor;
48625
- if (item.TextColor) textColor=item.TextColor;
48626
- this.Canvas.fillStyle=textColor;
48627
- this.Canvas.fillText(item.Text,xText,yText);
48869
+ if (item.Text)
48870
+ {
48871
+ var textColor=item.TitleColor;
48872
+ if (item.TextColor) textColor=item.TextColor;
48873
+ this.Canvas.fillStyle=textColor;
48874
+ this.Canvas.fillText(item.Text,xText,yText);
48875
+ }
48876
+
48877
+ if (item.Type==1)
48878
+ {
48879
+ var barLeft=left+textWidth+2;
48880
+ var barWidth=(right-5-barLeft);
48881
+ this.Canvas.strokeStyle=this.ColorNoProfit;
48882
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
48883
+ this.Canvas.strokeStyle=this.ColorProfit;
48884
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
48885
+ var text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
48886
+ this.Canvas.textAlign='center';
48887
+ this.Canvas.fillText(text,barLeft+barWidth/2,yText);
48888
+ }
48628
48889
 
48629
48890
  yText-=lineHeight;
48630
48891
  }
48892
+ }
48893
+
48894
+ this.DrawDayChip=function()
48895
+ {
48896
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.DayChip)) return;
48897
+
48898
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48899
+ for(var i=0;i<this.Data.DayChip.length;++i)
48900
+ {
48901
+ var aryPoint=[];
48902
+ var chipData=this.Data.DayChip[i].Chip;
48903
+ if (!chipData) continue;
48904
+ var totalVol=0;
48905
+ for(var j=0;j<chipData.length;++j)
48906
+ {
48907
+ var vol=chipData[j];
48908
+ if(!vol) continue;
48909
+ totalVol+=vol;
48910
+ var price=(j+this.Data.MinPrice)/100;
48911
+ if (this.IsHScreen)
48912
+ {
48913
+ var y=KLineFrame.GetYFromData(price);
48914
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48915
+ }
48916
+ else
48917
+ {
48918
+ var y=KLineFrame.GetYFromData(price);
48919
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48920
+ }
48921
+
48922
+ aryPoint.push({X:x,Y:y});
48923
+ }
48924
+ this.Data.DayChip[i].Vol=totalVol;
48925
+ this.DrawArea(aryPoint,this.Data.DayChip[i].Color);
48926
+ }
48927
+ }
48928
+
48929
+ this.DrawArea=function(aryPoint,color)
48930
+ {
48931
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48932
+
48933
+ this.Canvas.fillStyle=color;
48934
+ this.Canvas.beginPath();
48935
+ if (this.IsHScreen)
48936
+ {
48937
+ this.Canvas.moveTo(aryPoint[0].Y,this.ClientRect.Top);
48938
+ for(var i=0; i<aryPoint.length; ++i)
48939
+ {
48940
+ var item=aryPoint[i];
48941
+ this.Canvas.lineTo(item.Y,item.X);
48942
+ }
48943
+ this.Canvas.lineTo(aryPoint[aryPoint.length-1].Y,this.ClientRect.Top);
48944
+ }
48945
+ else
48946
+ {
48947
+ this.Canvas.moveTo(this.ClientRect.Left,aryPoint[0].Y);
48948
+ for(var i=0; i<aryPoint.length; ++i)
48949
+ {
48950
+ var item=aryPoint[i];
48951
+ this.Canvas.lineTo(item.X,item.Y);
48952
+ }
48953
+ this.Canvas.lineTo(this.ClientRect.Left,aryPoint[aryPoint.length-1].Y);
48954
+ }
48631
48955
 
48632
- var text='获利比例:';
48633
- this.Canvas.fillText(text,left,yText);
48634
- var textWidth=this.Canvas.measureText(text).width+2;
48635
- var barLeft=left+textWidth;
48636
- var barWidth=(right-5-barLeft);
48637
- this.Canvas.strokeStyle=this.ColorNoProfit;
48638
- this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
48639
- this.Canvas.strokeStyle=this.ColorProfit;
48640
- this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
48641
- text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
48642
- this.Canvas.textAlign='center';
48643
- this.Canvas.fillText(text,barLeft+barWidth/2,yText);
48644
- yText-=lineHeight;
48956
+ this.Canvas.fill();
48645
48957
  }
48646
48958
  }
48647
48959
 
@@ -81175,6 +81487,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81175
81487
  this.Draw();
81176
81488
  }
81177
81489
 
81490
+ //获取筹码图 className=指定筹码类名 否则就查询所有
81491
+ this.GetStockChipChart=function(className)
81492
+ {
81493
+ if (className)
81494
+ return this.GetExtendChartByClassName(className);
81495
+
81496
+ var chart=this.GetExtendChartByClassName('StockChip');
81497
+ if (chart) return chart;
81498
+
81499
+ chart=this.GetExtendChartByClassName("StockChipPhone");
81500
+ return chart;
81501
+ }
81502
+
81503
+ this.DeleteStockChipChart=function()
81504
+ {
81505
+ var stockChip=this.GetStockChipChart();
81506
+ if (!stockChip) return;
81507
+
81508
+ var chipWidth=stockChip.Chart.Width;
81509
+ this.DeleteExtendChart(stockChip);
81510
+ this.Frame.ChartBorder.Right-=chipWidth;
81511
+ if (stockChip.Chart.ClassName=="StockChipPhone")
81512
+ {
81513
+ this.GlobalOption.RightHorizontal.Show=true;
81514
+ this.Frame.ResetXYSplit();
81515
+ }
81516
+ this.SetSizeChange(true);
81517
+ this.Draw();
81518
+ }
81519
+
81520
+ this.CreateStockChipPhone=function(option)
81521
+ {
81522
+ var chart=new StockChipPhone();
81523
+ chart.Canvas=this.Canvas;
81524
+ chart.ChartBorder=this.Frame.ChartBorder;
81525
+ chart.ChartFrame=this.Frame;
81526
+ chart.HQChart=this;
81527
+ chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
81528
+ chart.SetOption(option);
81529
+ this.ExtendChartPaint.push(chart);
81530
+ this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81531
+ this.GlobalOption.RightHorizontal.Show=false;
81532
+
81533
+ return chart;
81534
+ }
81535
+
81178
81536
  this.CreateExtendChart=function(name, option) //创建扩展图形
81179
81537
  {
81180
81538
  var chart;
@@ -81193,17 +81551,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81193
81551
  this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81194
81552
  return chart;
81195
81553
  case "StockChipPhone":
81196
- chart=new StockChipPhone();
81197
- chart.Canvas=this.Canvas;
81198
- chart.ChartBorder=this.Frame.ChartBorder;
81199
- chart.ChartFrame=this.Frame;
81200
- chart.HQChart=this;
81201
- chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
81202
- chart.SetOption(option);
81203
- this.ExtendChartPaint.push(chart);
81204
- this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81205
- this.GlobalOption.RightHorizontal.Show=false;
81206
- return chart;
81554
+ return this.CreateStockChipPhone(option);
81207
81555
  case 'KLineTooltip':
81208
81556
  if (option.Create && typeof(option.Create)=='function') chart=option.Create();
81209
81557
  else chart=new KLineTooltipPaint();
@@ -82377,7 +82725,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82377
82725
 
82378
82726
  var bBGSpit=false, bShowStockChip=false;
82379
82727
  if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
82380
- if (this.GetExtendChartByClassName('StockChip')) bShowStockChip=true; //筹码
82728
+ if (this.GetStockChipChart()) bShowStockChip=true; //筹码
82729
+ var stockChipConfig={Name:'StockChip', ShowType:1, Width:230 };
82730
+ //var stockChipConfig={Name:'StockChipPhone', Width:150 }; //手机版筹码
82381
82731
 
82382
82732
  var bShowCorss=false; //十字光标十字线
82383
82733
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
@@ -82552,7 +82902,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82552
82902
 
82553
82903
  { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
82554
82904
 
82555
- { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
82905
+ { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[stockChipConfig.Name, stockChipConfig]}, Checked:bShowStockChip},
82556
82906
 
82557
82907
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
82558
82908
 
@@ -92035,6 +92385,8 @@ function KLineChartHScreenContainer(uielement)
92035
92385
  frame.ChartBorder=border;
92036
92386
  frame.Identify=i; //窗口序号
92037
92387
  frame.RightSpaceCount=this.RightSpaceCount; //右边
92388
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92389
+ frame.GlobalOption=this.GlobalOption;
92038
92390
 
92039
92391
  frame.HorizontalMax=20;
92040
92392
  frame.HorizontalMin=10;
@@ -92045,6 +92397,7 @@ function KLineChartHScreenContainer(uielement)
92045
92397
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');
92046
92398
  frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');
92047
92399
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
92400
+ frame.YSplitOperator.HQChart=this;
92048
92401
  //主图上下间距
92049
92402
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
92050
92403
  border.TopSpace=12*pixelTatio;
@@ -92055,6 +92408,8 @@ function KLineChartHScreenContainer(uielement)
92055
92408
  frame.YSplitOperator=new FrameSplitY();
92056
92409
  frame.YSplitOperator.LanguageID=this.LanguageID;
92057
92410
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');
92411
+ frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92412
+ frame.YSplitOperator.HQChart=this;
92058
92413
  //frame.IsLocked = true;
92059
92414
  }
92060
92415
 
@@ -92088,6 +92443,39 @@ function KLineChartHScreenContainer(uielement)
92088
92443
  this.Frame.SubFrame[i]=subFrame;
92089
92444
  }
92090
92445
  }
92446
+
92447
+ this.CreateStockChipPhone=function(option)
92448
+ {
92449
+ var chart=new StockChipPhone();
92450
+ chart.Canvas=this.Canvas;
92451
+ chart.ChartBorder=this.Frame.ChartBorder;
92452
+ chart.ChartFrame=this.Frame;
92453
+ chart.HQChart=this;
92454
+ chart.Left=this.Frame.ChartBorder.Bottom; //左边间距使用当前框架间距
92455
+ chart.SetOption(option);
92456
+ this.ExtendChartPaint.push(chart);
92457
+ this.Frame.ChartBorder.Bottom+=chart.Width; //创建筹码需要增加右边的间距
92458
+ this.GlobalOption.RightHorizontal.Show=false;
92459
+
92460
+ return chart;
92461
+ }
92462
+
92463
+ this.DeleteStockChipChart=function()
92464
+ {
92465
+ var stockChip=this.GetStockChipChart();
92466
+ if (!stockChip) return;
92467
+
92468
+ var chipWidth=stockChip.Chart.Width;
92469
+ this.DeleteExtendChart(stockChip);
92470
+ this.Frame.ChartBorder.Bottom-=chipWidth;
92471
+ if (stockChip.Chart.ClassName=="StockChipPhone")
92472
+ {
92473
+ this.GlobalOption.RightHorizontal.Show=true;
92474
+ this.Frame.ResetXYSplit();
92475
+ }
92476
+ this.SetSizeChange(true);
92477
+ this.Draw();
92478
+ }
92091
92479
  }
92092
92480
 
92093
92481
 
@@ -129448,6 +129836,8 @@ function JSReportChartContainer(uielement)
129448
129836
 
129449
129837
  this.UIOnMounseOut=function(e)
129450
129838
  {
129839
+ this.HideMinuteChartTooltip();
129840
+
129451
129841
  var bDraw=false;
129452
129842
  var tabChart=this.GetTabChart();
129453
129843
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -129472,6 +129862,8 @@ function JSReportChartContainer(uielement)
129472
129862
 
129473
129863
  this.UIOnMouseleave=function(e)
129474
129864
  {
129865
+ this.HideMinuteChartTooltip();
129866
+
129475
129867
  var tabChart=this.GetTabChart();
129476
129868
  if (tabChart && tabChart.MoveOnTabIndex>=0)
129477
129869
  {
@@ -149300,7 +149692,7 @@ function HQChartScriptWorker()
149300
149692
 
149301
149693
 
149302
149694
 
149303
- var HQCHART_VERSION="1.1.14171";
149695
+ var HQCHART_VERSION="1.1.14178";
149304
149696
 
149305
149697
  function PrintHQChartVersion()
149306
149698
  {