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.
@@ -5955,16 +5955,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5955
5955
  }
5956
5956
  }
5957
5957
 
5958
- //历史分钟数据 更改日期
5959
- this.ChangeTradeDate=function(tradeDate)
5960
- {
5961
- if(this.JSChartContainer && typeof(this.JSChartContainer.ChangeTradeDate)=='function')
5962
- {
5963
- JSConsole.Chart.Log('[JSChart:ChangeTradeDate] date', tradeDate);
5964
- this.JSChartContainer.ChangeTradeDate(tradeDate);
5965
- }
5966
- }
5967
-
5968
5958
  //多日走势图
5969
5959
  this.ChangeDayCount=function(count, option)
5970
5960
  {
@@ -6167,6 +6157,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
6167
6157
  return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
6168
6158
  }
6169
6159
  }
6160
+
6161
+ this.ExecuteMenuCommand=function(cmdID, aryArgs)
6162
+ {
6163
+ if(this.JSChartContainer && typeof(this.JSChartContainer.ExecuteMenuCommand)=='function')
6164
+ {
6165
+ JSConsole.Chart.Log('[JSChart:ExecuteMenuCommand] ');
6166
+ return this.JSChartContainer.ExecuteMenuCommand(cmdID, aryArgs);
6167
+ }
6168
+ }
6170
6169
  }
6171
6170
 
6172
6171
  JSChart.LastVersion=null; //最新的版本号
@@ -6586,6 +6585,8 @@ var JSCHART_EVENT_ID=
6586
6585
  ON_FORMAT_KLINE_INFO_FLOAT_TOOLTIP:162, //格式化信息地雷显示文字
6587
6586
 
6588
6587
  SEARCH_DIALOG_ON_CLICK_INDEX:163, //切换指标-指标对话框
6588
+
6589
+ ON_CALCULATE_CHIP_DATA:164, //计算筹码数据 (筹码图用)
6589
6590
  }
6590
6591
 
6591
6592
  var JSCHART_OPERATOR_ID=
@@ -13841,22 +13842,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13841
13842
  this.ShowDrawToolDialog();
13842
13843
  break;
13843
13844
  case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:
13844
- var option={Name:'筹码分布', ShowType:1, Width:230 };
13845
- var extendChart=this.CreateExtendChart(option.Name, option); //创建扩展图形
13846
- this.SetSizeChange(true);
13847
- this.Draw();
13848
- break;
13849
- case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13850
- var StockChip=this.GetExtendChartByClassName('StockChip');
13851
- if (StockChip)
13845
+ //var option={Name:'筹码分布', ShowType:1, Width:230 };
13846
+ var stockChip=this.GetStockChipChart();
13847
+ if (stockChip) return;
13848
+ if (srcParam)
13852
13849
  {
13853
- var chipWidth=StockChip.Chart.Width;
13854
- this.DeleteExtendChart(StockChip);
13855
- this.Frame.ChartBorder.Right-=chipWidth;
13850
+ var extendChart=this.CreateExtendChart(srcParam, aryArgs[1]); //创建扩展图形
13856
13851
  this.SetSizeChange(true);
13857
13852
  this.Draw();
13858
13853
  }
13859
13854
  break;
13855
+ case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
13856
+ if (this.DeleteStockChipChart) this.DeleteStockChipChart();
13857
+ break;
13860
13858
  case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:
13861
13859
  if (IFrameSplitOperator.IsBool(srcParam))
13862
13860
  this.EnableSelectRect=srcParam;
@@ -17787,7 +17785,8 @@ function AverageWidthFrame()
17787
17785
  var borderTop=this.ChartBorder.Top;
17788
17786
  var borderBottom=this.ChartBorder.Bottom;
17789
17787
  var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17790
- var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17788
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17789
+ var isDrawRight=this.IsShowRightHorizontal();
17791
17790
  }
17792
17791
  else
17793
17792
  {
@@ -17795,7 +17794,7 @@ function AverageWidthFrame()
17795
17794
  var borderLeft=this.ChartBorder.Left;
17796
17795
  var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17797
17796
  //var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17798
- isDrawRight=this.IsShowRightHorizontal();
17797
+ var isDrawRight=this.IsShowRightHorizontal();
17799
17798
  }
17800
17799
 
17801
17800
  if (!isDrawRight && !isDrawLeft) return null;
@@ -22485,6 +22484,25 @@ function KLineHScreenFrame()
22485
22484
  }
22486
22485
  }
22487
22486
 
22487
+ this.IsShowRightHorizontal=function()
22488
+ {
22489
+ var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22490
+ var borderBottom=this.ChartBorder.Bottom;
22491
+ if (borderBottom<=10*pixelTatio) return false;
22492
+
22493
+ if (this.YTextPosition[1]==2) return false;
22494
+ if (this.IsShowYText[1]===false) return false;
22495
+
22496
+ if (this.GlobalOption && this.GlobalOption.RightHorizontal)
22497
+ {
22498
+ var item=this.GlobalOption.RightHorizontal;
22499
+ if (item.Show===false) return false;
22500
+ }
22501
+
22502
+ return true;
22503
+ }
22504
+
22505
+
22488
22506
  //画Y轴
22489
22507
  this.DrawHorizontal=function()
22490
22508
  {
@@ -22500,7 +22518,8 @@ function KLineHScreenFrame()
22500
22518
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
22501
22519
 
22502
22520
  var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
22503
- var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
22521
+ //var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
22522
+ var isDrawRight=this.IsShowRightHorizontal();
22504
22523
 
22505
22524
  for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从左往右画分割线
22506
22525
  {
@@ -48283,12 +48302,38 @@ function StockChip()
48283
48302
  else this.EvenlyDistribute(aryChip, data);
48284
48303
  }
48285
48304
 
48305
+ this.SendCalculateChipEvent=function()
48306
+ {
48307
+ var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_CALCULATE_CHIP_DATA);
48308
+ if (!event) return null;
48309
+
48310
+ var bindData=this.HQChart.ChartPaint[0].Data;
48311
+ var curIndex=bindData.DataOffset+parseInt(this.HQChart.CursorIndex);
48312
+ var sendData=
48313
+ {
48314
+ Symbol:this.HQChart.Symbol, Period:this.HQChart.Period, KData:bindData,
48315
+ CurrentIndex:curIndex, Y:this.HQChart.LastPoint.Y, HQChart:this.HQChart,
48316
+ ShowType:this.ShowType, CalculateType:this.CalculateType,
48317
+ PreventDefault:false,
48318
+ Result:null, //true/false
48319
+ };
48320
+
48321
+ event.Callback(event, sendData, this);
48322
+
48323
+ return sendData;
48324
+ }
48325
+
48286
48326
  this.CalculateChip=function() //计算筹码
48287
48327
  {
48288
48328
  if (!this.HQChart) return false;
48289
48329
  if (!this.HQChart.FlowCapitalReady) return false;
48290
48330
  var symbol=this.HQChart.Symbol;
48291
48331
  if (!symbol) return false;
48332
+
48333
+ var recvData=this.SendCalculateChipEvent();
48334
+ if (recvData && recvData.PreventDefault)
48335
+ return recvData.Result;
48336
+
48292
48337
  if (MARKET_SUFFIX_NAME.IsSHSZIndex(symbol)) return false; //指数暂时不支持移动筹码
48293
48338
 
48294
48339
  var bindData=this.HQChart.ChartPaint[0].Data;
@@ -48485,18 +48530,35 @@ function StockChipPhone()
48485
48530
  this.ClassName='StockChipPhone';
48486
48531
  this.ShowType=0; //0=所有筹码 手机版只支持0
48487
48532
 
48533
+ //手机端没有按钮
48534
+ this.DrawToolbar=function(moveonPoint, mouseStatus) { }
48535
+
48488
48536
  this.Draw=function()
48489
48537
  {
48490
- this.ShowType=0;
48538
+ this.IsHScreen=this.ChartFrame.IsHScreen==true;
48491
48539
  this.PixelRatio=GetDevicePixelRatio();
48492
- var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
48493
- var top=ToFixedPoint(this.ChartBorder.GetTop());
48494
- var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
48495
- var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
48496
- var width=right-left;
48497
- var height=bottom-top;
48498
- this.ClientRect={Left:left,Top:top,Width:width,Height:height};
48499
-
48540
+ if (this.IsHScreen)
48541
+ {
48542
+ var border=this.ChartBorder.GetHScreenBorder();
48543
+ var left=ToFixedPoint(border.Left);
48544
+ var right=ToFixedPoint(border.Right);
48545
+ var top=ToFixedPoint(border.Bottom+this.Left);
48546
+ var bottom=ToFixedPoint(border.ChartHeight-2*this.PixelRatio);
48547
+ this.ClientRect={Left:left,Top:top, Right:right, Bottom:bottom};
48548
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48549
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48550
+ }
48551
+ else
48552
+ {
48553
+ var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
48554
+ var top=ToFixedPoint(this.ChartBorder.GetTop());
48555
+ var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
48556
+ var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
48557
+ this.ClientRect={Left:left,Top:top,Right:right, Bottom:bottom};
48558
+ this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
48559
+ this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
48560
+ }
48561
+
48500
48562
  if (ChartData.IsTickPeriod(this.HQChart.Period))
48501
48563
  {
48502
48564
 
@@ -48505,11 +48567,12 @@ function StockChipPhone()
48505
48567
  {
48506
48568
  if (this.CalculateChip())
48507
48569
  {
48508
- this.DrawFrame();
48509
48570
  this.DrawAllChip();
48510
-
48511
- this.CalculateCast(); //计算成本
48512
- this.DrawChipInfo();
48571
+ if (this.ShowType==1|| this.ShowType==2) this.DrawDayChip();
48572
+
48573
+ this.CalculateCast(); //计算成本
48574
+ if (this.IsHScreen) this.DrawHScreenChipInfo();
48575
+ else this.DrawChipInfo();
48513
48576
  }
48514
48577
  }
48515
48578
 
@@ -48517,17 +48580,170 @@ function StockChipPhone()
48517
48580
  this.SizeChange=false;
48518
48581
  }
48519
48582
 
48520
- this.DrawToolbar=function(moveonPoint, mouseStatus)
48583
+ this.DrawAllChip=function()
48584
+ {
48585
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48586
+ var selectPrice=this.Data.SelectData.Close;
48587
+ var aryProfitPoint=[];
48588
+ var aryNoProfitPoint=[];
48589
+ var totalVol=0,totalAmount=0,totalProfitVol=0, totalYProfitVol=0; //总的成交量, 总的成交金额, 总的盈利的成交量
48590
+ var yPrice=this.Data.YPrice;
48591
+
48592
+ var maxPrice=KLineFrame.HorizontalMax;
48593
+ var minPrice=KLineFrame.HorizontalMin;
48594
+
48595
+ var MaxVol=1;
48596
+ for(var i=0;i<this.Data.AllChip.length;++i)
48597
+ {
48598
+ var vol=this.Data.AllChip[i];
48599
+ if(!vol) continue;
48600
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48601
+ totalVol+=vol;
48602
+ totalAmount+=price*vol;
48603
+
48604
+ if (price<yPrice) totalYProfitVol+=vol; //获利的成交量
48605
+ if (price<selectPrice) totalProfitVol+=vol; //鼠标当前位置 获利的成交量
48606
+
48607
+ if (price<=maxPrice && price>=minPrice)
48608
+ {
48609
+ if (MaxVol<vol) MaxVol=vol;
48610
+ }
48611
+ }
48612
+ this.Data.MaxVol=MaxVol; //把成交量最大值替换成 当前屏成交量最大值
48613
+
48614
+ for(var i=0;i<this.Data.AllChip.length;++i)
48615
+ {
48616
+ var vol=this.Data.AllChip[i];
48617
+ if(!vol) continue;
48618
+ var price=(i+this.Data.MinPrice)/this.PriceZoom;
48619
+ if (price>maxPrice || price<minPrice) continue;
48620
+
48621
+ if (this.IsHScreen)
48622
+ {
48623
+ var y=KLineFrame.GetYFromData(price,false);
48624
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48625
+ }
48626
+ else
48627
+ {
48628
+ var y=KLineFrame.GetYFromData(price,false);
48629
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48630
+ }
48631
+
48632
+ if (price<selectPrice) aryProfitPoint.push({X:x,Y:y});
48633
+ else aryNoProfitPoint.push({X:x,Y:y});
48634
+ }
48635
+
48636
+ this.Data.ChipInfo=
48637
+ {
48638
+ Vol:totalVol, AveragePrice:totalAmount/totalVol, ProfitVol:totalProfitVol,
48639
+ ProfitRate:totalVol>0?totalProfitVol/totalVol*100:0,
48640
+ YProfitRate:totalVol>0?totalYProfitVol/totalVol*100:0
48641
+ };
48642
+
48643
+ if (this.ShowType==0)
48644
+ {
48645
+ this.DrawLines(aryProfitPoint,this.ColorProfit);
48646
+ this.DrawLines(aryNoProfitPoint,this.ColorNoProfit);
48647
+ var averagePrice=this.Data.ChipInfo.AveragePrice;
48648
+ if (averagePrice>0 && averagePrice<=maxPrice && averagePrice>=minPrice)
48649
+ {
48650
+ averagePrice=averagePrice.toFixed(2);
48651
+ this.DrawAveragePriceLine(aryProfitPoint,aryNoProfitPoint,KLineFrame.GetYFromData(averagePrice),this.ColorAveragePrice);
48652
+ }
48653
+ }
48654
+ else //在火焰山模式下, 筹码用一个颜色
48655
+ {
48656
+ this.DrawLines(aryProfitPoint,this.ColorBG);
48657
+ this.DrawLines(aryNoProfitPoint,this.ColorBG);
48658
+ }
48659
+ }
48660
+
48661
+ this.DrawLines=function(aryPoint,color)
48521
48662
  {
48663
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48522
48664
 
48665
+ this.Canvas.strokeStyle=color;
48666
+ this.Canvas.beginPath();
48667
+ for(var i =0; i<aryPoint.length; ++i)
48668
+ {
48669
+ var item=aryPoint[i];
48670
+ if (this.IsHScreen)
48671
+ {
48672
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48673
+ this.Canvas.lineTo(item.Y,item.X);
48674
+ }
48675
+ else
48676
+ {
48677
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48678
+ this.Canvas.lineTo(item.X,item.Y);
48679
+ }
48680
+
48681
+ }
48682
+ this.Canvas.stroke();
48683
+ }
48684
+
48685
+ this.DrawAveragePriceLine=function(aryProfitPoint,aryNoProfitPoint,y,color)
48686
+ {
48687
+ for(var i=0; i<aryProfitPoint.length; ++i)
48688
+ {
48689
+ var item=aryProfitPoint[i];
48690
+ if (item.Y==y)
48691
+ {
48692
+ this.Canvas.strokeStyle=color;
48693
+ this.Canvas.beginPath();
48694
+ if (this.IsHScreen)
48695
+ {
48696
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48697
+ this.Canvas.lineTo(item.Y,item.X);
48698
+ }
48699
+ else
48700
+ {
48701
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48702
+ this.Canvas.lineTo(item.X,item.Y);
48703
+ }
48704
+
48705
+ this.Canvas.stroke();
48706
+ return;
48707
+ }
48708
+ }
48709
+
48710
+ for(var i=0; i<aryNoProfitPoint.length; ++i)
48711
+ {
48712
+ var item=aryNoProfitPoint[i];
48713
+ if (item.Y==y)
48714
+ {
48715
+ this.Canvas.strokeStyle=color;
48716
+ this.Canvas.beginPath();
48717
+ if (this.IsHScreen)
48718
+ {
48719
+ this.Canvas.moveTo(item.Y,this.ClientRect.Top);
48720
+ this.Canvas.lineTo(item.Y,item.X);
48721
+ }
48722
+ else
48723
+ {
48724
+ this.Canvas.moveTo(this.ClientRect.Left,item.Y);
48725
+ this.Canvas.lineTo(item.X,item.Y);
48726
+ }
48727
+ this.Canvas.stroke();
48728
+ return;
48729
+ }
48730
+ }
48523
48731
  }
48524
48732
 
48525
48733
  this.GetChipInfoTitle=function()
48526
48734
  {
48527
48735
  var aryText=[]; //从底部往上
48528
48736
 
48529
- var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48530
- aryText.push(item);
48737
+ if (ChartData.IsDayPeriod(this.HQChart.Period, true))
48738
+ {
48739
+ var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48740
+ aryText.push(item);
48741
+ }
48742
+ else if (ChartData.IsMinutePeriod(this.HQChart.Period, true))
48743
+ {
48744
+ var item={ Title:`${IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date)} ${IFrameSplitOperator.FormatTimeString(this.Data.SelectData.Time, "HH:MM")}` };
48745
+ aryText.push(item);
48746
+ }
48531
48747
 
48532
48748
  var item={ Title:"集中度:", Text:"--.--%", };
48533
48749
  if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
@@ -48547,9 +48763,66 @@ function StockChipPhone()
48547
48763
  aryText.push(item);
48548
48764
  }
48549
48765
 
48766
+ if (this.IsHScreen) //横屏直接就显示数值 画进度条太麻烦了
48767
+ {
48768
+ var item={ Title:"获利比例:", Text: `${this.Data.ChipInfo.ProfitRate.toFixed(2)}%`};
48769
+ aryText.push(item);
48770
+ }
48771
+ else
48772
+ {
48773
+ var item={ Title:"获利比例:", Type:1 };
48774
+ aryText.push(item);
48775
+ }
48776
+
48550
48777
  return aryText;
48551
48778
  }
48552
48779
 
48780
+ this.DrawHScreenChipInfo=function()
48781
+ {
48782
+ var aryText=this.GetChipInfoTitle();
48783
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
48784
+
48785
+ this.Canvas.font=this.Font;
48786
+ this.Canvas.fillStyle=this.InfoColor;
48787
+ this.Canvas.textBaseline='bottom';
48788
+ this.Canvas.textAlign='left';
48789
+
48790
+ var top=this.ClientRect.Top+2*this.PixelRatio;
48791
+ var left=this.ClientRect.Left+2*this.PixelRatio;
48792
+ var bottom=this.ClientRect.Bottom;
48793
+ var lineHeight=this.LineHeight*GetDevicePixelRatio();
48794
+
48795
+ this.Canvas.save();
48796
+ this.Canvas.translate(left, top);
48797
+ this.Canvas.rotate(90 * Math.PI / 180);
48798
+
48799
+ var yText=0, xText=0;
48800
+ for(var i=0;i<aryText.length;++i)
48801
+ {
48802
+ var item=aryText[i];
48803
+ yText=0;
48804
+ var textColor=item.TitleColor;
48805
+ if (item.TitleColor) textColor=item.TitleColor;
48806
+ this.Canvas.fillStyle=textColor;
48807
+ this.Canvas.fillText(item.Title,yText,xText);
48808
+ var textWidth=this.Canvas.measureText(item.Title).width+4*this.PixelRatio;
48809
+ var yText=textWidth;
48810
+
48811
+ if (item.Text)
48812
+ {
48813
+ var textColor=item.TitleColor;
48814
+ if (item.TextColor) textColor=item.TextColor;
48815
+ this.Canvas.fillStyle=textColor;
48816
+ this.Canvas.fillText(item.Text,yText,xText);
48817
+ }
48818
+
48819
+ xText-=lineHeight;
48820
+ }
48821
+
48822
+
48823
+ this.Canvas.restore();
48824
+ }
48825
+
48553
48826
  this.DrawChipInfo=function()
48554
48827
  {
48555
48828
  var aryText=this.GetChipInfoTitle();
@@ -48577,27 +48850,94 @@ function StockChipPhone()
48577
48850
  var textWidth=this.Canvas.measureText(item.Title).width+4;
48578
48851
  var xText=left+textWidth;
48579
48852
 
48580
- var textColor=item.TitleColor;
48581
- if (item.TextColor) textColor=item.TextColor;
48582
- this.Canvas.fillStyle=textColor;
48583
- this.Canvas.fillText(item.Text,xText,yText);
48853
+ if (item.Text)
48854
+ {
48855
+ var textColor=item.TitleColor;
48856
+ if (item.TextColor) textColor=item.TextColor;
48857
+ this.Canvas.fillStyle=textColor;
48858
+ this.Canvas.fillText(item.Text,xText,yText);
48859
+ }
48860
+
48861
+ if (item.Type==1)
48862
+ {
48863
+ var barLeft=left+textWidth+2;
48864
+ var barWidth=(right-5-barLeft);
48865
+ this.Canvas.strokeStyle=this.ColorNoProfit;
48866
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
48867
+ this.Canvas.strokeStyle=this.ColorProfit;
48868
+ this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
48869
+ var text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
48870
+ this.Canvas.textAlign='center';
48871
+ this.Canvas.fillText(text,barLeft+barWidth/2,yText);
48872
+ }
48584
48873
 
48585
48874
  yText-=lineHeight;
48586
48875
  }
48876
+ }
48877
+
48878
+ this.DrawDayChip=function()
48879
+ {
48880
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.DayChip)) return;
48881
+
48882
+ var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
48883
+ for(var i=0;i<this.Data.DayChip.length;++i)
48884
+ {
48885
+ var aryPoint=[];
48886
+ var chipData=this.Data.DayChip[i].Chip;
48887
+ if (!chipData) continue;
48888
+ var totalVol=0;
48889
+ for(var j=0;j<chipData.length;++j)
48890
+ {
48891
+ var vol=chipData[j];
48892
+ if(!vol) continue;
48893
+ totalVol+=vol;
48894
+ var price=(j+this.Data.MinPrice)/100;
48895
+ if (this.IsHScreen)
48896
+ {
48897
+ var y=KLineFrame.GetYFromData(price);
48898
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
48899
+ }
48900
+ else
48901
+ {
48902
+ var y=KLineFrame.GetYFromData(price);
48903
+ var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
48904
+ }
48905
+
48906
+ aryPoint.push({X:x,Y:y});
48907
+ }
48908
+ this.Data.DayChip[i].Vol=totalVol;
48909
+ this.DrawArea(aryPoint,this.Data.DayChip[i].Color);
48910
+ }
48911
+ }
48912
+
48913
+ this.DrawArea=function(aryPoint,color)
48914
+ {
48915
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
48916
+
48917
+ this.Canvas.fillStyle=color;
48918
+ this.Canvas.beginPath();
48919
+ if (this.IsHScreen)
48920
+ {
48921
+ this.Canvas.moveTo(aryPoint[0].Y,this.ClientRect.Top);
48922
+ for(var i=0; i<aryPoint.length; ++i)
48923
+ {
48924
+ var item=aryPoint[i];
48925
+ this.Canvas.lineTo(item.Y,item.X);
48926
+ }
48927
+ this.Canvas.lineTo(aryPoint[aryPoint.length-1].Y,this.ClientRect.Top);
48928
+ }
48929
+ else
48930
+ {
48931
+ this.Canvas.moveTo(this.ClientRect.Left,aryPoint[0].Y);
48932
+ for(var i=0; i<aryPoint.length; ++i)
48933
+ {
48934
+ var item=aryPoint[i];
48935
+ this.Canvas.lineTo(item.X,item.Y);
48936
+ }
48937
+ this.Canvas.lineTo(this.ClientRect.Left,aryPoint[aryPoint.length-1].Y);
48938
+ }
48587
48939
 
48588
- var text='获利比例:';
48589
- this.Canvas.fillText(text,left,yText);
48590
- var textWidth=this.Canvas.measureText(text).width+2;
48591
- var barLeft=left+textWidth;
48592
- var barWidth=(right-5-barLeft);
48593
- this.Canvas.strokeStyle=this.ColorNoProfit;
48594
- this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
48595
- this.Canvas.strokeStyle=this.ColorProfit;
48596
- this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
48597
- text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
48598
- this.Canvas.textAlign='center';
48599
- this.Canvas.fillText(text,barLeft+barWidth/2,yText);
48600
- yText-=lineHeight;
48940
+ this.Canvas.fill();
48601
48941
  }
48602
48942
  }
48603
48943
 
@@ -81131,6 +81471,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81131
81471
  this.Draw();
81132
81472
  }
81133
81473
 
81474
+ //获取筹码图 className=指定筹码类名 否则就查询所有
81475
+ this.GetStockChipChart=function(className)
81476
+ {
81477
+ if (className)
81478
+ return this.GetExtendChartByClassName(className);
81479
+
81480
+ var chart=this.GetExtendChartByClassName('StockChip');
81481
+ if (chart) return chart;
81482
+
81483
+ chart=this.GetExtendChartByClassName("StockChipPhone");
81484
+ return chart;
81485
+ }
81486
+
81487
+ this.DeleteStockChipChart=function()
81488
+ {
81489
+ var stockChip=this.GetStockChipChart();
81490
+ if (!stockChip) return;
81491
+
81492
+ var chipWidth=stockChip.Chart.Width;
81493
+ this.DeleteExtendChart(stockChip);
81494
+ this.Frame.ChartBorder.Right-=chipWidth;
81495
+ if (stockChip.Chart.ClassName=="StockChipPhone")
81496
+ {
81497
+ this.GlobalOption.RightHorizontal.Show=true;
81498
+ this.Frame.ResetXYSplit();
81499
+ }
81500
+ this.SetSizeChange(true);
81501
+ this.Draw();
81502
+ }
81503
+
81504
+ this.CreateStockChipPhone=function(option)
81505
+ {
81506
+ var chart=new StockChipPhone();
81507
+ chart.Canvas=this.Canvas;
81508
+ chart.ChartBorder=this.Frame.ChartBorder;
81509
+ chart.ChartFrame=this.Frame;
81510
+ chart.HQChart=this;
81511
+ chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
81512
+ chart.SetOption(option);
81513
+ this.ExtendChartPaint.push(chart);
81514
+ this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81515
+ this.GlobalOption.RightHorizontal.Show=false;
81516
+
81517
+ return chart;
81518
+ }
81519
+
81134
81520
  this.CreateExtendChart=function(name, option) //创建扩展图形
81135
81521
  {
81136
81522
  var chart;
@@ -81149,17 +81535,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81149
81535
  this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81150
81536
  return chart;
81151
81537
  case "StockChipPhone":
81152
- chart=new StockChipPhone();
81153
- chart.Canvas=this.Canvas;
81154
- chart.ChartBorder=this.Frame.ChartBorder;
81155
- chart.ChartFrame=this.Frame;
81156
- chart.HQChart=this;
81157
- chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
81158
- chart.SetOption(option);
81159
- this.ExtendChartPaint.push(chart);
81160
- this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81161
- this.GlobalOption.RightHorizontal.Show=false;
81162
- return chart;
81538
+ return this.CreateStockChipPhone(option);
81163
81539
  case 'KLineTooltip':
81164
81540
  if (option.Create && typeof(option.Create)=='function') chart=option.Create();
81165
81541
  else chart=new KLineTooltipPaint();
@@ -82333,7 +82709,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82333
82709
 
82334
82710
  var bBGSpit=false, bShowStockChip=false;
82335
82711
  if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
82336
- if (this.GetExtendChartByClassName('StockChip')) bShowStockChip=true; //筹码
82712
+ if (this.GetStockChipChart()) bShowStockChip=true; //筹码
82713
+ var stockChipConfig={Name:'StockChip', ShowType:1, Width:230 };
82714
+ //var stockChipConfig={Name:'StockChipPhone', Width:150 }; //手机版筹码
82337
82715
 
82338
82716
  var bShowCorss=false; //十字光标十字线
82339
82717
  if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
@@ -82508,7 +82886,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82508
82886
 
82509
82887
  { Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
82510
82888
 
82511
- { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
82889
+ { Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[stockChipConfig.Name, stockChipConfig]}, Checked:bShowStockChip},
82512
82890
 
82513
82891
  { Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
82514
82892
 
@@ -91991,6 +92369,8 @@ function KLineChartHScreenContainer(uielement)
91991
92369
  frame.ChartBorder=border;
91992
92370
  frame.Identify=i; //窗口序号
91993
92371
  frame.RightSpaceCount=this.RightSpaceCount; //右边
92372
+ frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92373
+ frame.GlobalOption=this.GlobalOption;
91994
92374
 
91995
92375
  frame.HorizontalMax=20;
91996
92376
  frame.HorizontalMin=10;
@@ -92001,6 +92381,7 @@ function KLineChartHScreenContainer(uielement)
92001
92381
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');
92002
92382
  frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');
92003
92383
  frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
92384
+ frame.YSplitOperator.HQChart=this;
92004
92385
  //主图上下间距
92005
92386
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
92006
92387
  border.TopSpace=12*pixelTatio;
@@ -92011,6 +92392,8 @@ function KLineChartHScreenContainer(uielement)
92011
92392
  frame.YSplitOperator=new FrameSplitY();
92012
92393
  frame.YSplitOperator.LanguageID=this.LanguageID;
92013
92394
  frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');
92395
+ frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
92396
+ frame.YSplitOperator.HQChart=this;
92014
92397
  //frame.IsLocked = true;
92015
92398
  }
92016
92399
 
@@ -92044,6 +92427,39 @@ function KLineChartHScreenContainer(uielement)
92044
92427
  this.Frame.SubFrame[i]=subFrame;
92045
92428
  }
92046
92429
  }
92430
+
92431
+ this.CreateStockChipPhone=function(option)
92432
+ {
92433
+ var chart=new StockChipPhone();
92434
+ chart.Canvas=this.Canvas;
92435
+ chart.ChartBorder=this.Frame.ChartBorder;
92436
+ chart.ChartFrame=this.Frame;
92437
+ chart.HQChart=this;
92438
+ chart.Left=this.Frame.ChartBorder.Bottom; //左边间距使用当前框架间距
92439
+ chart.SetOption(option);
92440
+ this.ExtendChartPaint.push(chart);
92441
+ this.Frame.ChartBorder.Bottom+=chart.Width; //创建筹码需要增加右边的间距
92442
+ this.GlobalOption.RightHorizontal.Show=false;
92443
+
92444
+ return chart;
92445
+ }
92446
+
92447
+ this.DeleteStockChipChart=function()
92448
+ {
92449
+ var stockChip=this.GetStockChipChart();
92450
+ if (!stockChip) return;
92451
+
92452
+ var chipWidth=stockChip.Chart.Width;
92453
+ this.DeleteExtendChart(stockChip);
92454
+ this.Frame.ChartBorder.Bottom-=chipWidth;
92455
+ if (stockChip.Chart.ClassName=="StockChipPhone")
92456
+ {
92457
+ this.GlobalOption.RightHorizontal.Show=true;
92458
+ this.Frame.ResetXYSplit();
92459
+ }
92460
+ this.SetSizeChange(true);
92461
+ this.Draw();
92462
+ }
92047
92463
  }
92048
92464
 
92049
92465
 
@@ -129404,6 +129820,8 @@ function JSReportChartContainer(uielement)
129404
129820
 
129405
129821
  this.UIOnMounseOut=function(e)
129406
129822
  {
129823
+ this.HideMinuteChartTooltip();
129824
+
129407
129825
  var bDraw=false;
129408
129826
  var tabChart=this.GetTabChart();
129409
129827
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -129428,6 +129846,8 @@ function JSReportChartContainer(uielement)
129428
129846
 
129429
129847
  this.UIOnMouseleave=function(e)
129430
129848
  {
129849
+ this.HideMinuteChartTooltip();
129850
+
129431
129851
  var tabChart=this.GetTabChart();
129432
129852
  if (tabChart && tabChart.MoveOnTabIndex>=0)
129433
129853
  {
@@ -139695,7 +140115,7 @@ function ScrollBarBGChart()
139695
140115
 
139696
140116
 
139697
140117
 
139698
- var HQCHART_VERSION="1.1.14171";
140118
+ var HQCHART_VERSION="1.1.14180";
139699
140119
 
139700
140120
  function PrintHQChartVersion()
139701
140121
  {