hqchart 1.1.14165 → 1.1.14172

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.
@@ -7008,9 +7008,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7008
7008
  {
7009
7009
  IsValueFullRange:false ,
7010
7010
  IsDisplayLatest:false,
7011
- SelectedBorder:{ Mode:0, SelFrame:0 }, //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
7012
- SelectedXBorder: { Mode:0, Date:null } //X边框选中模式 Mode:0=禁用 分时图图有效
7011
+ SelectedBorder:{ Mode:0, SelFrame:0 }, //边框选中模式 Mode:0=禁用 1=右侧标记选中 2=指标窗口标记选中
7012
+ SelectedXBorder: { Mode:0, Date:null }, //X边框选中模式 Mode:0=禁用 分时图图有效
7013
7013
  //XDateFormat (多日分时图x轴底部日期格式)
7014
+ RightHorizontal:
7015
+ {
7016
+ //Show:true,
7017
+ //Width:5
7018
+ } //右侧框架外部坐标和间距
7014
7019
  };
7015
7020
 
7016
7021
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -15800,6 +15805,23 @@ function AverageWidthFrame()
15800
15805
  }
15801
15806
  }
15802
15807
 
15808
+ this.IsShowRightHorizontal=function()
15809
+ {
15810
+ var borderRight=this.ChartBorder.Right;
15811
+ if (borderRight<=10) return false;
15812
+
15813
+ if (this.YTextPosition[1]==2) return false;
15814
+ if (this.IsShowYText[1]===false) return false;
15815
+
15816
+ if (this.GlobalOption && this.GlobalOption.RightHorizontal)
15817
+ {
15818
+ var item=this.GlobalOption.RightHorizontal;
15819
+ if (item.Show===false) return false;
15820
+ }
15821
+
15822
+ return true;
15823
+ }
15824
+
15803
15825
  //画Y轴
15804
15826
  this.DrawHorizontal=function()
15805
15827
  {
@@ -15816,7 +15838,8 @@ function AverageWidthFrame()
15816
15838
  var borderLeft=this.ChartBorder.Left;
15817
15839
 
15818
15840
  var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
15819
- var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
15841
+ //var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
15842
+ var isDrawRight=this.IsShowRightHorizontal();
15820
15843
 
15821
15844
  var rightExtendLine=null; //右侧延长线
15822
15845
  var leftExtendLine=null; //左侧延长线
@@ -17815,7 +17838,8 @@ function AverageWidthFrame()
17815
17838
  var borderRight=this.ChartBorder.Right;
17816
17839
  var borderLeft=this.ChartBorder.Left;
17817
17840
  var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
17818
- var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17841
+ //var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
17842
+ isDrawRight=this.IsShowRightHorizontal();
17819
17843
  }
17820
17844
 
17821
17845
  if (!isDrawRight && !isDrawLeft) return null;
@@ -47713,7 +47737,7 @@ function StockInfoExtendChartPaint()
47713
47737
  this.Canvas.textAlign="left";
47714
47738
  this.Canvas.fillText(this.Name,middle+2,y);
47715
47739
  }
47716
- ;
47740
+
47717
47741
  this.Canvas.strokeStyle=this.BorderColor;
47718
47742
  this.Canvas.moveTo(left,y);
47719
47743
  this.Canvas.lineTo(right,y);
@@ -48494,6 +48518,133 @@ function StockChip()
48494
48518
  }
48495
48519
  }
48496
48520
 
48521
+ //筹码分布手机版
48522
+ function StockChipPhone()
48523
+ {
48524
+ this.newMethod=StockChip; //派生
48525
+ this.newMethod();
48526
+ delete this.newMethod;
48527
+
48528
+ this.Name='筹码分布手机版';
48529
+ this.ClassName='StockChipPhone';
48530
+ this.ShowType=0; //0=所有筹码 手机版只支持0
48531
+
48532
+ this.Draw=function()
48533
+ {
48534
+ this.ShowType=0;
48535
+ 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
+
48544
+ if (ChartData.IsTickPeriod(this.HQChart.Period))
48545
+ {
48546
+
48547
+ }
48548
+ else
48549
+ {
48550
+ if (this.CalculateChip())
48551
+ {
48552
+ this.DrawFrame();
48553
+ this.DrawAllChip();
48554
+
48555
+ this.CalculateCast(); //计算成本
48556
+ this.DrawChipInfo();
48557
+ }
48558
+ }
48559
+
48560
+ this.DrawBorder();
48561
+ this.SizeChange=false;
48562
+ }
48563
+
48564
+ this.DrawToolbar=function(moveonPoint, mouseStatus)
48565
+ {
48566
+
48567
+ }
48568
+
48569
+ this.GetChipInfoTitle=function()
48570
+ {
48571
+ var aryText=[]; //从底部往上
48572
+
48573
+ var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
48574
+ aryText.push(item);
48575
+
48576
+ var item={ Title:"集中度:", Text:"--.--%", };
48577
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
48578
+ aryText.push(item);
48579
+
48580
+ var item={ Title:"90%成本:", Text:"--.--", };
48581
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].MinPrice.toFixed(2)}-${this.Data.Cast[0].MaxPrice.toFixed(2)}`;
48582
+ aryText.push(item);
48583
+
48584
+
48585
+ var item={ Title:"平均成本::", Text:"--.--", };
48586
+ if (this.Data.ChipInfo && IFrameSplitOperator.IsNumber(this.Data.ChipInfo.AveragePrice)) item.Text=`${this.Data.ChipInfo.AveragePrice.toFixed(2)}`;
48587
+
48588
+ if (IFrameSplitOperator.IsNumber(this.Data.YPrice) && IFrameSplitOperator.IsNumber(this.Data.ChipInfo.YProfitRate))
48589
+ {
48590
+ var item={ Title:`${this.Data.YPrice.toFixed(2)}获利:`, Text:`${this.Data.ChipInfo.YProfitRate.toFixed(2)}%` };
48591
+ aryText.push(item);
48592
+ }
48593
+
48594
+ return aryText;
48595
+ }
48596
+
48597
+ this.DrawChipInfo=function()
48598
+ {
48599
+ var aryText=this.GetChipInfoTitle();
48600
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
48601
+
48602
+ var bottom=this.ClientRect.Top+this.ClientRect.Height-1;
48603
+ var left=this.ClientRect.Left+2;
48604
+ var right=this.ClientRect.Left+this.ClientRect.Width;
48605
+
48606
+ this.Canvas.font=this.Font;
48607
+ this.Canvas.fillStyle=this.InfoColor;
48608
+ this.Canvas.textBaseline='bottom';
48609
+ this.Canvas.textAlign='left';
48610
+
48611
+ var lineHeight=this.LineHeight*GetDevicePixelRatio();
48612
+ var yText=bottom;
48613
+ for(var i=0;i<aryText.length;++i)
48614
+ {
48615
+ var item=aryText[i];
48616
+
48617
+ var textColor=item.TitleColor;
48618
+ if (item.TitleColor) textColor=item.TitleColor;
48619
+ this.Canvas.fillStyle=textColor;
48620
+ this.Canvas.fillText(item.Title,left,yText);
48621
+ var textWidth=this.Canvas.measureText(item.Title).width+4;
48622
+ var xText=left+textWidth;
48623
+
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);
48628
+
48629
+ yText-=lineHeight;
48630
+ }
48631
+
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;
48645
+ }
48646
+ }
48647
+
48497
48648
  //窗口分割
48498
48649
  function FrameSplitPaint()
48499
48650
  {
@@ -81030,6 +81181,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81030
81181
  switch(name)
81031
81182
  {
81032
81183
  case '筹码分布':
81184
+ case "StockChip":
81033
81185
  chart=new StockChip();
81034
81186
  chart.Canvas=this.Canvas;
81035
81187
  chart.ChartBorder=this.Frame.ChartBorder;
@@ -81040,6 +81192,18 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
81040
81192
  this.ExtendChartPaint.push(chart);
81041
81193
  this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
81042
81194
  return chart;
81195
+ 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;
81043
81207
  case 'KLineTooltip':
81044
81208
  if (option.Create && typeof(option.Create)=='function') chart=option.Create();
81045
81209
  else chart=new KLineTooltipPaint();
@@ -137164,6 +137328,7 @@ function JSTReportChartContainer(uielement)
137164
137328
 
137165
137329
  if (item[32]) stock.CloseLine=item[32]; //32=收盘价线
137166
137330
  if (item[33]) stock.KLine=item[33]; //33=K线
137331
+ if (item[34]) stock.ExePrice=item[34]; //34=行权价设置 { BGColor:背景色, Text:, TextColor }
137167
137332
 
137168
137333
  //10个数值型 101-199
137169
137334
  if (IFrameSplitOperator.IsNumber(item[101])) stock.ReserveNumber1=item[101];
@@ -137988,6 +138153,8 @@ var TREPORT_COLUMN_ID=
137988
138153
  NAME_EX_ID:27, //扩展名字
137989
138154
  CLOSE_LINE_ID:28, //收盘价线
137990
138155
  KLINE_ID:29, //K线
138156
+
138157
+ EXE_PRICE_EX_ID:30, //行权价格 扩张设置
137991
138158
 
137992
138159
  //预留数值类型 10个 201-299
137993
138160
  RESERVE_NUMBER1_ID:201, //ReserveNumber1:
@@ -138034,6 +138201,7 @@ var MAP_TREPORT_COLUMN_FIELD=new Map(
138034
138201
  [TREPORT_COLUMN_ID.AVERAGE_PRICE_ID,"AvPrice"],
138035
138202
  [TREPORT_COLUMN_ID.POSITION_ID,"Position"],
138036
138203
  [TREPORT_COLUMN_ID.AMPLITUDE_ID,"Amplitude"],
138204
+ [TREPORT_COLUMN_ID.EXE_PRICE_EX_ID, "ExePrice"],
138037
138205
 
138038
138206
  [TREPORT_COLUMN_ID.RESERVE_NUMBER1_ID,"ReserveNumber1"],
138039
138207
  [TREPORT_COLUMN_ID.RESERVE_NUMBER2_ID,"ReserveNumber2"],
@@ -138716,6 +138884,55 @@ function ChartTReport()
138716
138884
  }
138717
138885
  }
138718
138886
 
138887
+ this.FormatCenterItem=function(data,drawInfo)
138888
+ {
138889
+ if (!data || !data.TData) return;
138890
+ var leftData=this.GetExePriceExtendData(data.TData.LeftData);
138891
+ var rightData=this.GetExePriceExtendData(data.TData.RightData);
138892
+
138893
+ if (leftData)
138894
+ {
138895
+ if (leftData.BGColor) drawInfo.BGColor=leftData.BGColor;
138896
+ if (leftData.TitleColor) drawInfo.TextColor=leftData.TitleColor;
138897
+ if (leftData.Text && leftData.TextColor)
138898
+ {
138899
+ drawInfo.Left={ Text:leftData.Text, TextColor:leftData.TextColor};
138900
+ }
138901
+ else if (leftData.IconFont && leftData.TextColor)
138902
+ {
138903
+ drawInfo.Left={ IconFont:leftData.IconFont, TextColor:leftData.TextColor};
138904
+ }
138905
+
138906
+ }
138907
+
138908
+ if (rightData)
138909
+ {
138910
+ if (rightData.BGColor) drawInfo.BGColor=rightData.BGColor;
138911
+ if (rightData.TitleColor) drawInfo.TextColor=rightData.TitleColor;
138912
+
138913
+ if (rightData.Text && rightData.TextColor)
138914
+ {
138915
+ drawInfo.Right={ Text:rightData.Text, TextColor:rightData.TextColor};
138916
+ }
138917
+ else if (rightData.IconFont && rightData.TextColor)
138918
+ {
138919
+ drawInfo.Right={ IconFont:rightData.IconFont, TextColor:rightData.TextColor};
138920
+ }
138921
+ }
138922
+ }
138923
+
138924
+ //行权价列扩展信息
138925
+ this.GetExePriceExtendData=function(data)
138926
+ {
138927
+ if (!data) return null;
138928
+
138929
+ var fieldName=MAP_TREPORT_COLUMN_FIELD.get(TREPORT_COLUMN_ID.EXE_PRICE_EX_ID);
138930
+ if (!fieldName) return null;
138931
+
138932
+ var value=data[fieldName];
138933
+ return value;
138934
+ }
138935
+
138719
138936
  this.DrawCenterItem=function(index, data, column, rtItem, cellType) //cellType 0=中间字段 1=左侧 2=右侧
138720
138937
  {
138721
138938
  //tooltip提示
@@ -138728,6 +138945,10 @@ function ChartTReport()
138728
138945
  var drawInfo={ Text:null, TextColor:this.CenterItemConfig.TextColor, BGColor:this.CenterItemConfig.BGColor, TextAlign:column.TextAlign, Rect:rtItem, RectText:rtText };
138729
138946
  drawInfo.Text=`${data.ExePrice.toFixed(data.Decimal)}`;
138730
138947
 
138948
+ this.FormatCenterItem(data,drawInfo);
138949
+
138950
+
138951
+
138731
138952
  this.DrawCell(drawInfo);
138732
138953
  }
138733
138954
 
@@ -138969,7 +139190,7 @@ function ChartTReport()
138969
139190
  {
138970
139191
  var rtText=drawInfo.RectText;
138971
139192
  var yCenter=rtText.Top+(rtText.Height/2);
138972
-
139193
+ var fontBackup=null; //字体备份
138973
139194
  if (drawInfo.BGColor) //背景
138974
139195
  {
138975
139196
  var rtItem=drawInfo.Rect;
@@ -138996,6 +139217,44 @@ function ChartTReport()
138996
139217
  if(drawInfo.TextColor) this.Canvas.fillStyle=drawInfo.TextColor;
138997
139218
  this.DrawText(drawInfo.Text, drawInfo.TextAlign, rtText.Left, yCenter, rtText.Width);
138998
139219
  }
139220
+
139221
+ if (drawInfo.Left)
139222
+ {
139223
+ var item=drawInfo.Left;
139224
+ this.Canvas.textAlign="left";
139225
+ this.Canvas.textBaseline="middle";
139226
+ this.Canvas.fillStyle=item.TextColor;
139227
+ if (item.IconFont)
139228
+ {
139229
+ if (!fontBackup) fontBackup=this.Canvas.font;
139230
+ this.Canvas.font=item.IconFont.Font;
139231
+ this.Canvas.fillText(item.IconFont.Symbol,rtText.Left,yCenter);
139232
+ }
139233
+ else if (item.Text)
139234
+ {
139235
+ this.Canvas.fillText(item.Text,rtText.Left,yCenter);
139236
+ }
139237
+ }
139238
+
139239
+ if (drawInfo.Right)
139240
+ {
139241
+ var item=drawInfo.Right;
139242
+ this.Canvas.textAlign="right";
139243
+ this.Canvas.textBaseline="middle";
139244
+ this.Canvas.fillStyle=item.TextColor;
139245
+ if (item.IconFont)
139246
+ {
139247
+ if (!fontBackup) fontBackup=this.Canvas.font;
139248
+ this.Canvas.font=item.IconFont.Font;
139249
+ this.Canvas.fillText(item.IconFont.Symbol,rtText.Right,yCenter);
139250
+ }
139251
+ else if (item.Text)
139252
+ {
139253
+ this.Canvas.fillText(item.Text,rtText.Right,yCenter);
139254
+ }
139255
+ }
139256
+
139257
+ if (fontBackup) this.Canvas.font=fontBackup;
138999
139258
  }
139000
139259
 
139001
139260
  this.GetTooltipData=function(x,y)
@@ -149041,7 +149300,7 @@ function HQChartScriptWorker()
149041
149300
 
149042
149301
 
149043
149302
 
149044
- var HQCHART_VERSION="1.1.14164";
149303
+ var HQCHART_VERSION="1.1.14171";
149045
149304
 
149046
149305
  function PrintHQChartVersion()
149047
149306
  {