hqchart 1.1.14172 → 1.1.14181

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; //最新的版本号
@@ -6630,6 +6629,8 @@ var JSCHART_EVENT_ID=
6630
6629
  ON_FORMAT_KLINE_INFO_FLOAT_TOOLTIP:162, //格式化信息地雷显示文字
6631
6630
 
6632
6631
  SEARCH_DIALOG_ON_CLICK_INDEX:163, //切换指标-指标对话框
6632
+
6633
+ ON_CALCULATE_CHIP_DATA:164, //计算筹码数据 (筹码图用)
6633
6634
  }
6634
6635
 
6635
6636
  var JSCHART_OPERATOR_ID=
@@ -13885,22 +13886,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13885
13886
  this.ShowDrawToolDialog();
13886
13887
  break;
13887
13888
  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)
13889
+ //var option={Name:'筹码分布', ShowType:1, Width:230 };
13890
+ var stockChip=this.GetStockChipChart();
13891
+ if (stockChip) return;
13892
+ if (srcParam)
13896
13893
  {
13897
- var chipWidth=StockChip.Chart.Width;
13898
- this.DeleteExtendChart(StockChip);
13899
- this.Frame.ChartBorder.Right-=chipWidth;
13894
+ var extendChart=this.CreateExtendChart(srcParam, aryArgs[1]); //创建扩展图形
13900
13895
  this.SetSizeChange(true);
13901
13896
  this.Draw();
13902
13897
  }
13903
13898
  break;
13899
+ case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13900
+ if (this.DeleteStockChipChart) this.DeleteStockChipChart();
13901
+ break;
13904
13902
  case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:
13905
13903
  if (IFrameSplitOperator.IsBool(srcParam))
13906
13904
  this.EnableSelectRect=srcParam;
@@ -17831,7 +17829,8 @@ function AverageWidthFrame()
17831
17829
  var borderTop=this.ChartBorder.Top;
17832
17830
  var borderBottom=this.ChartBorder.Bottom;
17833
17831
  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;
17832
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17833
+ var isDrawRight=this.IsShowRightHorizontal();
17835
17834
  }
17836
17835
  else
17837
17836
  {
@@ -17839,7 +17838,7 @@ function AverageWidthFrame()
17839
17838
  var borderLeft=this.ChartBorder.Left;
17840
17839
  var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17841
17840
  //var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17842
- isDrawRight=this.IsShowRightHorizontal();
17841
+ var isDrawRight=this.IsShowRightHorizontal();
17843
17842
  }
17844
17843
 
17845
17844
  if (!isDrawRight && !isDrawLeft) return null;
@@ -22529,6 +22528,25 @@ function KLineHScreenFrame()
22529
22528
  }
22530
22529
  }
22531
22530
 
22531
+ this.IsShowRightHorizontal=function()
22532
+ {
22533
+ var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22534
+ var borderBottom=this.ChartBorder.Bottom;
22535
+ if (borderBottom<=10*pixelTatio) return false;
22536
+
22537
+ if (this.YTextPosition[1]==2) return false;
22538
+ if (this.IsShowYText[1]===false) return false;
22539
+
22540
+ if (this.GlobalOption && this.GlobalOption.RightHorizontal)
22541
+ {
22542
+ var item=this.GlobalOption.RightHorizontal;
22543
+ if (item.Show===false) return false;
22544
+ }
22545
+
22546
+ return true;
22547
+ }
22548
+
22549
+
22532
22550
  //画Y轴
22533
22551
  this.DrawHorizontal=function()
22534
22552
  {
@@ -22544,7 +22562,8 @@ function KLineHScreenFrame()
22544
22562
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22545
22563
 
22546
22564
  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;
22565
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
22566
+ var isDrawRight=this.IsShowRightHorizontal();
22548
22567
 
22549
22568
  for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从左往右画分割线
22550
22569
  {
@@ -48327,12 +48346,38 @@ function StockChip()
48327
48346
  else this.EvenlyDistribute(aryChip, data);
48328
48347
  }
48329
48348
 
48349
+ this.SendCalculateChipEvent=function()
48350
+ {
48351
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_CALCULATE_CHIP_DATA);
48352
+ if (!event) return null;
48353
+
48354
+ var bindData=this.HQChart.ChartPaint[0].Data;
48355
+ var curIndex=bindData.DataOffset+parseInt(this.HQChart.CursorIndex);
48356
+ var sendData=
48357
+ {
48358
+ Symbol:this.HQChart.Symbol, Period:this.HQChart.Period, KData:bindData,
48359
+ CurrentIndex:curIndex, Y:this.HQChart.LastPoint.Y, HQChart:this.HQChart,
48360
+ ShowType:this.ShowType, CalculateType:this.CalculateType,
48361
+ PreventDefault:false,
48362
+ Result:null, //true/false
48363
+ };
48364
+
48365
+ event.Callback(event, sendData, this);
48366
+
48367
+ return sendData;
48368
+ }
48369
+
48330
48370
  this.CalculateChip=function() //计算筹码
48331
48371
  {
48332
48372
  if (!this.HQChart) return false;
48333
48373
  if (!this.HQChart.FlowCapitalReady) return false;
48334
48374
  var symbol=this.HQChart.Symbol;
48335
48375
  if (!symbol) return false;
48376
+
48377
+ var recvData=this.SendCalculateChipEvent();
48378
+ if (recvData && recvData.PreventDefault)
48379
+ return recvData.Result;
48380
+
48336
48381
  if (MARKET_SUFFIX_NAME.IsSHSZIndex(symbol)) return false; //指数暂时不支持移动筹码
48337
48382
 
48338
48383
  var bindData=this.HQChart.ChartPaint[0].Data;
@@ -48529,18 +48574,35 @@ function StockChipPhone()
48529
48574
  this.ClassName='StockChipPhone';
48530
48575
  this.ShowType=0; //0=所有筹码 手机版只支持0
48531
48576
 
48577
+ //手机端没有按钮
48578
+ this.DrawToolbar=function(moveonPoint, mouseStatus) { }
48579
+
48532
48580
  this.Draw=function()
48533
48581
  {
48534
- this.ShowType=0;
48582
+ this.IsHScreen=this.ChartFrame.IsHScreen==true;
48535
48583
  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
-
48584
+ if (this.IsHScreen)
48585
+ {
48586
+ var border=this.ChartBorder.GetHScreenBorder();
48587
+ var left=ToFixedPoint(border.Left);
48588
+ var right=ToFixedPoint(border.Right);
48589
+ var top=ToFixedPoint(border.Bottom+this.Left);
48590
+ var bottom=ToFixedPoint(border.ChartHeight-2*this.PixelRatio);
48591
+ this.ClientRect={Left:left,Top:top, Right:right, Bottom:bottom};
48592
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48593
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48594
+ }
48595
+ else
48596
+ {
48597
+ var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
48598
+ var top=ToFixedPoint(this.ChartBorder.GetTop());
48599
+ var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
48600
+ var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
48601
+ this.ClientRect={Left:left,Top:top,Right:right, Bottom:bottom};
48602
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48603
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48604
+ }
48605
+
48544
48606
  if (ChartData.IsTickPeriod(this.HQChart.Period))
48545
48607
  {
48546
48608
 
@@ -48549,11 +48611,12 @@ function StockChipPhone()
48549
48611
  {
48550
48612
  if (this.CalculateChip())
48551
48613
  {
48552
- this.DrawFrame();
48553
48614
  this.DrawAllChip();
48554
-
48555
- this.CalculateCast(); //计算成本
48556
- this.DrawChipInfo();
48615
+ if (this.ShowType==1|| this.ShowType==2) this.DrawDayChip();
48616
+
48617
+ this.CalculateCast(); //计算成本
48618
+ if (this.IsHScreen) this.DrawHScreenChipInfo();
48619
+ else this.DrawChipInfo();
48557
48620
  }
48558
48621
  }
48559
48622
 
@@ -48561,17 +48624,170 @@ function StockChipPhone()
48561
48624
  this.SizeChange=false;
48562
48625
  }
48563
48626
 
48564
- this.DrawToolbar=function(moveonPoint, mouseStatus)
48627
+ this.DrawAllChip=function()
48628
+ {
48629
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48630
+ var selectPrice=this.Data.SelectData.Close;
48631
+ var aryProfitPoint=[];
48632
+ var aryNoProfitPoint=[];
48633
+ var totalVol=0,totalAmount=0,totalProfitVol=0, totalYProfitVol=0; //总的成交量, 总的成交金额, 总的盈利的成交量
48634
+ var yPrice=this.Data.YPrice;
48635
+
48636
+ var maxPrice=KLineFrame.HorizontalMax;
48637
+ var minPrice=KLineFrame.HorizontalMin;
48638
+
48639
+ var MaxVol=1;
48640
+ for(var i=0;i<this.Data.AllChip.length;++i)
48641
+ {
48642
+ var vol=this.Data.AllChip[i];
48643
+ if(!vol) continue;
48644
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48645
+ totalVol+=vol;
48646
+ totalAmount+=price*vol;
48647
+
48648
+ if (price<yPrice) totalYProfitVol+=vol; //获利的成交量
48649
+ if (price<selectPrice) totalProfitVol+=vol; //鼠标当前位置 获利的成交量
48650
+
48651
+ if (price<=maxPrice && price>=minPrice)
48652
+ {
48653
+ if (MaxVol<vol) MaxVol=vol;
48654
+ }
48655
+ }
48656
+ this.Data.MaxVol=MaxVol; //把成交量最大值替换成 当前屏成交量最大值
48657
+
48658
+ for(var i=0;i<this.Data.AllChip.length;++i)
48659
+ {
48660
+ var vol=this.Data.AllChip[i];
48661
+ if(!vol) continue;
48662
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48663
+ if (price>maxPrice || price<minPrice) continue;
48664
+
48665
+ if (this.IsHScreen)
48666
+ {
48667
+ var y=KLineFrame.GetYFromData(price,false);
48668
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48669
+ }
48670
+ else
48671
+ {
48672
+ var y=KLineFrame.GetYFromData(price,false);
48673
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48674
+ }
48675
+
48676
+ if (price<selectPrice) aryProfitPoint.push({X:x,Y:y});
48677
+ else aryNoProfitPoint.push({X:x,Y:y});
48678
+ }
48679
+
48680
+ this.Data.ChipInfo=
48681
+ {
48682
+ Vol:totalVol, AveragePrice:totalAmount/totalVol, ProfitVol:totalProfitVol,
48683
+ ProfitRate:totalVol>0?totalProfitVol/totalVol*100:0,
48684
+ YProfitRate:totalVol>0?totalYProfitVol/totalVol*100:0
48685
+ };
48686
+
48687
+ if (this.ShowType==0)
48688
+ {
48689
+ this.DrawLines(aryProfitPoint,this.ColorProfit);
48690
+ this.DrawLines(aryNoProfitPoint,this.ColorNoProfit);
48691
+ var averagePrice=this.Data.ChipInfo.AveragePrice;
48692
+ if (averagePrice>0 && averagePrice<=maxPrice && averagePrice>=minPrice)
48693
+ {
48694
+ averagePrice=averagePrice.toFixed(2);
48695
+ this.DrawAveragePriceLine(aryProfitPoint,aryNoProfitPoint,KLineFrame.GetYFromData(averagePrice),this.ColorAveragePrice);
48696
+ }
48697
+ }
48698
+ else //在火焰山模式下, 筹码用一个颜色
48699
+ {
48700
+ this.DrawLines(aryProfitPoint,this.ColorBG);
48701
+ this.DrawLines(aryNoProfitPoint,this.ColorBG);
48702
+ }
48703
+ }
48704
+
48705
+ this.DrawLines=function(aryPoint,color)
48565
48706
  {
48707
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48566
48708
 
48709
+ this.Canvas.strokeStyle=color;
48710
+ this.Canvas.beginPath();
48711
+ for(var i =0; i<aryPoint.length; ++i)
48712
+ {
48713
+ var item=aryPoint[i];
48714
+ if (this.IsHScreen)
48715
+ {
48716
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48717
+ this.Canvas.lineTo(item.Y,item.X);
48718
+ }
48719
+ else
48720
+ {
48721
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48722
+ this.Canvas.lineTo(item.X,item.Y);
48723
+ }
48724
+
48725
+ }
48726
+ this.Canvas.stroke();
48727
+ }
48728
+
48729
+ this.DrawAveragePriceLine=function(aryProfitPoint,aryNoProfitPoint,y,color)
48730
+ {
48731
+ for(var i=0; i<aryProfitPoint.length; ++i)
48732
+ {
48733
+ var item=aryProfitPoint[i];
48734
+ if (item.Y==y)
48735
+ {
48736
+ this.Canvas.strokeStyle=color;
48737
+ this.Canvas.beginPath();
48738
+ if (this.IsHScreen)
48739
+ {
48740
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48741
+ this.Canvas.lineTo(item.Y,item.X);
48742
+ }
48743
+ else
48744
+ {
48745
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48746
+ this.Canvas.lineTo(item.X,item.Y);
48747
+ }
48748
+
48749
+ this.Canvas.stroke();
48750
+ return;
48751
+ }
48752
+ }
48753
+
48754
+ for(var i=0; i<aryNoProfitPoint.length; ++i)
48755
+ {
48756
+ var item=aryNoProfitPoint[i];
48757
+ if (item.Y==y)
48758
+ {
48759
+ this.Canvas.strokeStyle=color;
48760
+ this.Canvas.beginPath();
48761
+ if (this.IsHScreen)
48762
+ {
48763
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48764
+ this.Canvas.lineTo(item.Y,item.X);
48765
+ }
48766
+ else
48767
+ {
48768
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48769
+ this.Canvas.lineTo(item.X,item.Y);
48770
+ }
48771
+ this.Canvas.stroke();
48772
+ return;
48773
+ }
48774
+ }
48567
48775
  }
48568
48776
 
48569
48777
  this.GetChipInfoTitle=function()
48570
48778
  {
48571
48779
  var aryText=[]; //从底部往上
48572
48780
 
48573
- var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48574
- aryText.push(item);
48781
+ if (ChartData.IsDayPeriod(this.HQChart.Period, true))
48782
+ {
48783
+ var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48784
+ aryText.push(item);
48785
+ }
48786
+ else if (ChartData.IsMinutePeriod(this.HQChart.Period, true))
48787
+ {
48788
+ var item={ Title:`${IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date)} ${IFrameSplitOperator.FormatTimeString(this.Data.SelectData.Time, "HH:MM")}` };
48789
+ aryText.push(item);
48790
+ }
48575
48791
 
48576
48792
  var item={ Title:"集中度:", Text:"--.--%", };
48577
48793
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
@@ -48591,9 +48807,66 @@ function StockChipPhone()
48591
48807
  aryText.push(item);
48592
48808
  }
48593
48809
 
48810
+ if (this.IsHScreen) //横屏直接就显示数值 画进度条太麻烦了
48811
+ {
48812
+ var item={ Title:"获利比例:", Text: `${this.Data.ChipInfo.ProfitRate.toFixed(2)}%`};
48813
+ aryText.push(item);
48814
+ }
48815
+ else
48816
+ {
48817
+ var item={ Title:"获利比例:", Type:1 };
48818
+ aryText.push(item);
48819
+ }
48820
+
48594
48821
  return aryText;
48595
48822
  }
48596
48823
 
48824
+ this.DrawHScreenChipInfo=function()
48825
+ {
48826
+ var aryText=this.GetChipInfoTitle();
48827
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
48828
+
48829
+ this.Canvas.font=this.Font;
48830
+ this.Canvas.fillStyle=this.InfoColor;
48831
+ this.Canvas.textBaseline='bottom';
48832
+ this.Canvas.textAlign='left';
48833
+
48834
+ var top=this.ClientRect.Top+2*this.PixelRatio;
48835
+ var left=this.ClientRect.Left+2*this.PixelRatio;
48836
+ var bottom=this.ClientRect.Bottom;
48837
+ var lineHeight=this.LineHeight*GetDevicePixelRatio();
48838
+
48839
+ this.Canvas.save();
48840
+ this.Canvas.translate(left, top);
48841
+ this.Canvas.rotate(90 * Math.PI / 180);
48842
+
48843
+ var yText=0, xText=0;
48844
+ for(var i=0;i<aryText.length;++i)
48845
+ {
48846
+ var item=aryText[i];
48847
+ yText=0;
48848
+ var textColor=item.TitleColor;
48849
+ if (item.TitleColor) textColor=item.TitleColor;
48850
+ this.Canvas.fillStyle=textColor;
48851
+ this.Canvas.fillText(item.Title,yText,xText);
48852
+ var textWidth=this.Canvas.measureText(item.Title).width+4*this.PixelRatio;
48853
+ var yText=textWidth;
48854
+
48855
+ if (item.Text)
48856
+ {
48857
+ var textColor=item.TitleColor;
48858
+ if (item.TextColor) textColor=item.TextColor;
48859
+ this.Canvas.fillStyle=textColor;
48860
+ this.Canvas.fillText(item.Text,yText,xText);
48861
+ }
48862
+
48863
+ xText-=lineHeight;
48864
+ }
48865
+
48866
+
48867
+ this.Canvas.restore();
48868
+ }
48869
+
48597
48870
  this.DrawChipInfo=function()
48598
48871
  {
48599
48872
  var aryText=this.GetChipInfoTitle();
@@ -48621,27 +48894,94 @@ function StockChipPhone()
48621
48894
  var textWidth=this.Canvas.measureText(item.Title).width+4;
48622
48895
  var xText=left+textWidth;
48623
48896
 
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);
48897
+ if (item.Text)
48898
+ {
48899
+ var textColor=item.TitleColor;
48900
+ if (item.TextColor) textColor=item.TextColor;
48901
+ this.Canvas.fillStyle=textColor;
48902
+ this.Canvas.fillText(item.Text,xText,yText);
48903
+ }
48904
+
48905
+ if (item.Type==1)
48906
+ {
48907
+ var barLeft=left+textWidth+2;
48908
+ var barWidth=(right-5-barLeft);
48909
+ this.Canvas.strokeStyle=this.ColorNoProfit;
48910
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
48911
+ this.Canvas.strokeStyle=this.ColorProfit;
48912
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
48913
+ var text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
48914
+ this.Canvas.textAlign='center';
48915
+ this.Canvas.fillText(text,barLeft+barWidth/2,yText);
48916
+ }
48628
48917
 
48629
48918
  yText-=lineHeight;
48630
48919
  }
48920
+ }
48921
+
48922
+ this.DrawDayChip=function()
48923
+ {
48924
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.DayChip)) return;
48925
+
48926
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48927
+ for(var i=0;i<this.Data.DayChip.length;++i)
48928
+ {
48929
+ var aryPoint=[];
48930
+ var chipData=this.Data.DayChip[i].Chip;
48931
+ if (!chipData) continue;
48932
+ var totalVol=0;
48933
+ for(var j=0;j<chipData.length;++j)
48934
+ {
48935
+ var vol=chipData[j];
48936
+ if(!vol) continue;
48937
+ totalVol+=vol;
48938
+ var price=(j+this.Data.MinPrice)/100;
48939
+ if (this.IsHScreen)
48940
+ {
48941
+ var y=KLineFrame.GetYFromData(price);
48942
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48943
+ }
48944
+ else
48945
+ {
48946
+ var y=KLineFrame.GetYFromData(price);
48947
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48948
+ }
48949
+
48950
+ aryPoint.push({X:x,Y:y});
48951
+ }
48952
+ this.Data.DayChip[i].Vol=totalVol;
48953
+ this.DrawArea(aryPoint,this.Data.DayChip[i].Color);
48954
+ }
48955
+ }
48956
+
48957
+ this.DrawArea=function(aryPoint,color)
48958
+ {
48959
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48960
+
48961
+ this.Canvas.fillStyle=color;
48962
+ this.Canvas.beginPath();
48963
+ if (this.IsHScreen)
48964
+ {
48965
+ this.Canvas.moveTo(aryPoint[0].Y,this.ClientRect.Top);
48966
+ for(var i=0; i<aryPoint.length; ++i)
48967
+ {
48968
+ var item=aryPoint[i];
48969
+ this.Canvas.lineTo(item.Y,item.X);
48970
+ }
48971
+ this.Canvas.lineTo(aryPoint[aryPoint.length-1].Y,this.ClientRect.Top);
48972
+ }
48973
+ else
48974
+ {
48975
+ this.Canvas.moveTo(this.ClientRect.Left,aryPoint[0].Y);
48976
+ for(var i=0; i<aryPoint.length; ++i)
48977
+ {
48978
+ var item=aryPoint[i];
48979
+ this.Canvas.lineTo(item.X,item.Y);
48980
+ }
48981
+ this.Canvas.lineTo(this.ClientRect.Left,aryPoint[aryPoint.length-1].Y);
48982
+ }
48631
48983
 
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;
48984
+ this.Canvas.fill();
48645
48985
  }
48646
48986
  }
48647
48987
 
@@ -81175,6 +81515,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81175
81515
  this.Draw();
81176
81516
  }
81177
81517
 
81518
+ //获取筹码图 className=指定筹码类名 否则就查询所有
81519
+ this.GetStockChipChart=function(className)
81520
+ {
81521
+ if (className)
81522
+ return this.GetExtendChartByClassName(className);
81523
+
81524
+ var chart=this.GetExtendChartByClassName('StockChip');
81525
+ if (chart) return chart;
81526
+
81527
+ chart=this.GetExtendChartByClassName("StockChipPhone");
81528
+ return chart;
81529
+ }
81530
+
81531
+ this.DeleteStockChipChart=function()
81532
+ {
81533
+ var stockChip=this.GetStockChipChart();
81534
+ if (!stockChip) return;
81535
+
81536
+ var chipWidth=stockChip.Chart.Width;
81537
+ this.DeleteExtendChart(stockChip);
81538
+ this.Frame.ChartBorder.Right-=chipWidth;
81539
+ if (stockChip.Chart.ClassName=="StockChipPhone")
81540
+ {
81541
+ this.GlobalOption.RightHorizontal.Show=true;
81542
+ this.Frame.ResetXYSplit();
81543
+ }
81544
+ this.SetSizeChange(true);
81545
+ this.Draw();
81546
+ }
81547
+
81548
+ this.CreateStockChipPhone=function(option)
81549
+ {
81550
+ var chart=new StockChipPhone();
81551
+ chart.Canvas=this.Canvas;
81552
+ chart.ChartBorder=this.Frame.ChartBorder;
81553
+ chart.ChartFrame=this.Frame;
81554
+ chart.HQChart=this;
81555
+ chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
81556
+ chart.SetOption(option);
81557
+ this.ExtendChartPaint.push(chart);
81558
+ this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81559
+ this.GlobalOption.RightHorizontal.Show=false;
81560
+
81561
+ return chart;
81562
+ }
81563
+
81178
81564
  this.CreateExtendChart=function(name, option) //创建扩展图形
81179
81565
  {
81180
81566
  var chart;
@@ -81193,17 +81579,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81193
81579
  this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81194
81580
  return chart;
81195
81581
  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;
81582
+ return this.CreateStockChipPhone(option);
81207
81583
  case 'KLineTooltip':
81208
81584
  if (option.Create && typeof(option.Create)=='function') chart=option.Create();
81209
81585
  else chart=new KLineTooltipPaint();
@@ -82377,7 +82753,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82377
82753
 
82378
82754
  var bBGSpit=false, bShowStockChip=false;
82379
82755
  if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
82380
- if (this.GetExtendChartByClassName('StockChip')) bShowStockChip=true; //筹码
82756
+ if (this.GetStockChipChart()) bShowStockChip=true; //筹码
82757
+ var stockChipConfig={Name:'StockChip', ShowType:1, Width:230 };
82758
+ //var stockChipConfig={Name:'StockChipPhone', Width:150 }; //手机版筹码
82381
82759
 
82382
82760
  var bShowCorss=false; //十字光标十字线
82383
82761
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
@@ -82552,7 +82930,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82552
82930
 
82553
82931
  { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
82554
82932
 
82555
- { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
82933
+ { 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
82934
 
82557
82935
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
82558
82936
 
@@ -92035,6 +92413,8 @@ function KLineChartHScreenContainer(uielement)
92035
92413
  frame.ChartBorder=border;
92036
92414
  frame.Identify=i; //窗口序号
92037
92415
  frame.RightSpaceCount=this.RightSpaceCount; //右边
92416
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92417
+ frame.GlobalOption=this.GlobalOption;
92038
92418
 
92039
92419
  frame.HorizontalMax=20;
92040
92420
  frame.HorizontalMin=10;
@@ -92045,6 +92425,7 @@ function KLineChartHScreenContainer(uielement)
92045
92425
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');
92046
92426
  frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');
92047
92427
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
92428
+ frame.YSplitOperator.HQChart=this;
92048
92429
  //主图上下间距
92049
92430
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
92050
92431
  border.TopSpace=12*pixelTatio;
@@ -92055,6 +92436,8 @@ function KLineChartHScreenContainer(uielement)
92055
92436
  frame.YSplitOperator=new FrameSplitY();
92056
92437
  frame.YSplitOperator.LanguageID=this.LanguageID;
92057
92438
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');
92439
+ frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92440
+ frame.YSplitOperator.HQChart=this;
92058
92441
  //frame.IsLocked = true;
92059
92442
  }
92060
92443
 
@@ -92088,6 +92471,39 @@ function KLineChartHScreenContainer(uielement)
92088
92471
  this.Frame.SubFrame[i]=subFrame;
92089
92472
  }
92090
92473
  }
92474
+
92475
+ this.CreateStockChipPhone=function(option)
92476
+ {
92477
+ var chart=new StockChipPhone();
92478
+ chart.Canvas=this.Canvas;
92479
+ chart.ChartBorder=this.Frame.ChartBorder;
92480
+ chart.ChartFrame=this.Frame;
92481
+ chart.HQChart=this;
92482
+ chart.Left=this.Frame.ChartBorder.Bottom; //左边间距使用当前框架间距
92483
+ chart.SetOption(option);
92484
+ this.ExtendChartPaint.push(chart);
92485
+ this.Frame.ChartBorder.Bottom+=chart.Width; //创建筹码需要增加右边的间距
92486
+ this.GlobalOption.RightHorizontal.Show=false;
92487
+
92488
+ return chart;
92489
+ }
92490
+
92491
+ this.DeleteStockChipChart=function()
92492
+ {
92493
+ var stockChip=this.GetStockChipChart();
92494
+ if (!stockChip) return;
92495
+
92496
+ var chipWidth=stockChip.Chart.Width;
92497
+ this.DeleteExtendChart(stockChip);
92498
+ this.Frame.ChartBorder.Bottom-=chipWidth;
92499
+ if (stockChip.Chart.ClassName=="StockChipPhone")
92500
+ {
92501
+ this.GlobalOption.RightHorizontal.Show=true;
92502
+ this.Frame.ResetXYSplit();
92503
+ }
92504
+ this.SetSizeChange(true);
92505
+ this.Draw();
92506
+ }
92091
92507
  }
92092
92508
 
92093
92509
 
@@ -129448,6 +129864,8 @@ function JSReportChartContainer(uielement)
129448
129864
 
129449
129865
  this.UIOnMounseOut=function(e)
129450
129866
  {
129867
+ this.HideMinuteChartTooltip();
129868
+
129451
129869
  var bDraw=false;
129452
129870
  var tabChart=this.GetTabChart();
129453
129871
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -129472,6 +129890,8 @@ function JSReportChartContainer(uielement)
129472
129890
 
129473
129891
  this.UIOnMouseleave=function(e)
129474
129892
  {
129893
+ this.HideMinuteChartTooltip();
129894
+
129475
129895
  var tabChart=this.GetTabChart();
129476
129896
  if (tabChart && tabChart.MoveOnTabIndex>=0)
129477
129897
  {
@@ -149300,7 +149720,7 @@ function HQChartScriptWorker()
149300
149720
 
149301
149721
 
149302
149722
 
149303
- var HQCHART_VERSION="1.1.14171";
149723
+ var HQCHART_VERSION="1.1.14180";
149304
149724
 
149305
149725
  function PrintHQChartVersion()
149306
149726
  {