hqchart 1.1.12396 → 1.1.12414

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.
@@ -5108,6 +5108,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5108
5108
  if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
5109
5109
  if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData)) chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;
5110
5110
  if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat)) chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;
5111
+ if (IFrameSplitOperator.IsNumber(item.TitleBaseLine)) chart.TitlePaint[0].TitleBaseLine=item.TitleBaseLine;
5111
5112
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
5112
5113
  }
5113
5114
 
@@ -24682,10 +24683,11 @@ function IChartPainting()
24682
24683
  if (Array.isArray(color))
24683
24684
  {
24684
24685
  let gradient = this.Canvas.createLinearGradient(x0, y0, x1, y1);
24685
- var offset=1/(color.length);
24686
- for(var i in color)
24686
+ var offset=1/(color.length-1);
24687
+ for(var i=0; i<color.length; ++i)
24687
24688
  {
24688
- gradient.addColorStop(i*offset, color[i]);
24689
+ var value=i*offset;
24690
+ gradient.addColorStop(value, color[i]);
24689
24691
  }
24690
24692
  this.Canvas.fillStyle=gradient;
24691
24693
  }
@@ -39132,12 +39134,20 @@ function ChartDrawSVG()
39132
39134
  this.IsDestroy=false; //是否已销毁
39133
39135
  this.EnableTooltip=true;
39134
39136
  this.TooltipRect=[];
39137
+ this.ExcludeArea=null; //排除区域 { Left, Top, Width, Height, Type:0 }
39138
+ this.AutoPosition=null; //{ Direction:0, MaxYOffset:40 } //自动调整Y轴偏移,防止文字重叠
39139
+
39140
+ this.AryDrawRect=[]; //已经绘制的区域
39141
+ this.AutoYOffset=0;
39135
39142
 
39136
39143
  //this.Data; 存K线数据
39137
39144
 
39138
39145
  this.Draw=function()
39139
39146
  {
39140
39147
  this.TooltipRect=[];
39148
+ this.AryDrawRect=[];
39149
+ this.AutoYOffset=0;
39150
+
39141
39151
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
39142
39152
  if (this.IsShowIndexTitleOnly()) return;
39143
39153
  if (this.IsHideScriptIndex()) return;
@@ -39229,6 +39239,145 @@ function ChartDrawSVG()
39229
39239
  this.Canvas.fillStyle = item.Data.Color;
39230
39240
  this.Canvas.fillText(item.Data.Text, item.X, item.Y);
39231
39241
  }
39242
+
39243
+ this.AryDrawRect.push( {Left:rtBorder.Left, Top:rtBorder.Top, Right:rtBorder.Right, Bottom:rtBorder.Bottom, Type:"Detail" } );
39244
+ }
39245
+
39246
+ this.GetDetailPosition=function(rtSVG, data)
39247
+ {
39248
+ if (!IFrameSplitOperator.IsNonEmptyArray(data.Content)) return null;
39249
+
39250
+ var lefMargin=2;
39251
+ var rightMargin=2;
39252
+ var itemSpace=2;
39253
+ var rtBorder={ Left:rtSVG.Right, Right:rtSVG.Right, Bottom:rtSVG.Bottom };
39254
+ var rightBorder=0; //右边的边界 0=div的宽度 1=图形框架边框
39255
+ if (IFrameSplitOperator.IsNumber(data.ItemSpace)) itemSpace=data.ItemSpace;
39256
+ if (IFrameSplitOperator.IsNumber(data.YOffset)) rtBorder.Bottom+=data.YOffset;
39257
+ if (IFrameSplitOperator.IsNumber(data.XOffset)) rtBorder.Left+=data.XOffset;
39258
+
39259
+ if (IFrameSplitOperator.IsNumber(data.LeftMargin)) lefMargin=data.LeftMargin;
39260
+ if (IFrameSplitOperator.IsNumber(data.RightMargin)) rightMargin=data.RightMargin;
39261
+
39262
+ if (IFrameSplitOperator.IsNumber(data.RightBorder)) rightBorder=data.RightBorder;
39263
+
39264
+ if (data.Font) this.Canvas.font=data.Font;
39265
+ else this.Canvas.font=this.TextFont;
39266
+
39267
+ var textHeight=this.Canvas.measureText("擎").width+2;
39268
+ rtBorder.Height=textHeight+5;
39269
+ var yText=rtBorder.Bottom-(rtBorder.Height-textHeight)/2;
39270
+ var xText=rtBorder.Left+lefMargin;
39271
+
39272
+ var bFrist=true;
39273
+ for(var i=0;i<data.Content.length;++i)
39274
+ {
39275
+ if (!bFrist) xText+=itemSpace;
39276
+
39277
+ var item=data.Content[i];
39278
+ if (!item.Text) continue;
39279
+
39280
+ var textWidth=this.Canvas.measureText(item.Text).width+2;
39281
+
39282
+ xText+=textWidth;
39283
+ rtBorder.Right=xText;
39284
+ bFrist=false;
39285
+ }
39286
+
39287
+ rtBorder.Right+=rightMargin;
39288
+ rtBorder.Width=rtBorder.Right-rtBorder.Left;
39289
+ rtBorder.Top=rtBorder.Bottom-rtBorder.Height;
39290
+
39291
+ var right=this.ChartBorder.GetChartWidth()-1;
39292
+ if (rightBorder==1) right=this.ChartBorder.GetRight();
39293
+ if (rtBorder.Right>right) //右边显示不下,显示在左边
39294
+ {
39295
+ rtBorder.Right=rtSVG.Left;
39296
+ if (IFrameSplitOperator.IsNumber(data.XOffset)) rtBorder.Right-=data.XOffset;
39297
+ rtBorder.Left=rtBorder.Right-rtBorder.Width;
39298
+ }
39299
+
39300
+ return rtBorder;
39301
+ }
39302
+
39303
+ this.CalculateShowPosition=function(item, pt)
39304
+ {
39305
+ var x=pt.X, y=pt.Y;
39306
+ var svgItem=item.SVG;
39307
+ if (IFrameSplitOperator.IsNumber(svgItem.YOffset)) y+=svgItem.YOffset;
39308
+ var fontSVG=`${svgItem.Size}px ${this.Family}`;
39309
+ this.Canvas.font=fontSVG;
39310
+ var halfSize=svgItem.Size/2;
39311
+ var rtSVG={ Left:x-halfSize, Right:x+halfSize, Top:y-svgItem.Size, Bottom:y, Height:svgItem.Size, Width:svgItem.Size };
39312
+
39313
+ if (svgItem.VAlign===0) //top
39314
+ {
39315
+ rtSVG.Top=y;
39316
+ rtSVG.Bottom=rtSVG.Top+svgItem.Size;
39317
+ }
39318
+ else if (svgItem.VAlign===1) //middle
39319
+ {
39320
+ rtSVG.Top=y-svgItem.Size/2;
39321
+ rtSVG.Bottom=rtSVG.Top+svgItem.Size;
39322
+ }
39323
+
39324
+ if (rtSVG.Top<0)
39325
+ {
39326
+ rtSVG.Top=0;
39327
+ rtSVG.Bottom=svgItem.Size;
39328
+ y=rtSVG.Bottom;
39329
+ }
39330
+
39331
+ var rtContent=null;
39332
+ if (item.Detail)
39333
+ rtContent=this.GetDetailPosition(rtSVG,item.Detail);
39334
+
39335
+
39336
+ var yOffset=0, yMoveStep=-5;
39337
+ for(var i=0;i<20;++i)
39338
+ {
39339
+ if (rtSVG && !rtContent)
39340
+ {
39341
+ if (!this.IsRectOverlap(rtSVG))
39342
+ break;
39343
+ }
39344
+ else if (rtSVG && rtContent)
39345
+ {
39346
+ if (!this.IsRectOverlap(rtSVG) && !this.IsRectOverlap(rtContent))
39347
+ break;
39348
+ }
39349
+
39350
+ yOffset+=yMoveStep;
39351
+
39352
+ if (Math.abs(yOffset)>=this.AutoPosition.MaxYOffset) break;
39353
+
39354
+ rtSVG.Top+=yMoveStep;
39355
+ rtSVG.Bottom+=yMoveStep;
39356
+ if (rtContent)
39357
+ {
39358
+ rtContent.Top+=yMoveStep;
39359
+ rtContent.Bottom+=yMoveStep;
39360
+ }
39361
+ }
39362
+
39363
+ pt.X=x;
39364
+ pt.Y=y+yOffset;
39365
+
39366
+ }
39367
+
39368
+ this.IsRectOverlap=function(rect)
39369
+ {
39370
+ for(var i=0; i<this.AryDrawRect.length; ++i)
39371
+ {
39372
+ var item=this.AryDrawRect[i];
39373
+ if ( ((rect.Left>=item.Left && rect.Left<=item.Right) || (rect.Right>=item.Left && rect.Right<=item.Right)) &&
39374
+ ((rect.Top>=item.Top && rect.Top<=item.Bottom) || (rect.Bottom>=item.Top && rect.Bottom<=item.Bottom)) )
39375
+ {
39376
+ return true;
39377
+ }
39378
+ }
39379
+
39380
+ return false;
39232
39381
  }
39233
39382
 
39234
39383
  this.DrawSVG=function()
@@ -39263,6 +39412,14 @@ function ChartDrawSVG()
39263
39412
  else if (item.Value=="Bottom") y=bottom;
39264
39413
  else y=this.ChartFrame.GetYFromData(item.Value);
39265
39414
  if (IFrameSplitOperator.IsNumber(item.YOffset)) y+=item.YOffset; //Y轴偏移
39415
+
39416
+ if (this.AutoPosition)
39417
+ {
39418
+ var pt={ X:x, Y:y };
39419
+ this.CalculateShowPosition(item, pt); //重新计算位置
39420
+ x=pt.X;
39421
+ y=pt.Y;
39422
+ }
39266
39423
 
39267
39424
 
39268
39425
  var svgItem=item.SVG;
@@ -39297,6 +39454,8 @@ function ChartDrawSVG()
39297
39454
  this.Canvas.fillStyle = svgItem.Color;
39298
39455
  this.Canvas.fillText(svgItem.Symbol, x, y);
39299
39456
 
39457
+ this.AryDrawRect.push( {Left:rtSVG.Left, Top:rtSVG.Top, Right:rtSVG.Right, Bottom:rtSVG.Bottom, Type:"SVG" } );
39458
+
39300
39459
  if (this.EnableTooltip) this.TooltipRect.push({ Rect:rtSVG,Index:i });
39301
39460
 
39302
39461
  //文字
@@ -52110,119 +52269,6 @@ function DynamicMinuteTitlePainting()
52110
52269
  }
52111
52270
  }
52112
52271
 
52113
- /*
52114
- if(this.IsShowName)
52115
- {
52116
- if (!this.DrawText(this.Name,this.NameColor,position)) return;
52117
- }
52118
-
52119
- if (this.IsShowDate || this.IsShowTime)
52120
- {
52121
- var bShowUpdateTime=false; //是否显示了更新时间
52122
- if (isLastOne && this.ShowLastDataFormat==1)
52123
- {
52124
- if (this.Data && this.Data.UpdateTime && IFrameSplitOperator.IsNumber(this.Data.UpdateTime.Date) && IFrameSplitOperator.IsNumber(this.Data.UpdateTime.Time))
52125
- {
52126
- var text=IFrameSplitOperator.FormatTimeString(this.Data.UpdateTime.Time, "HH:MM:SS");
52127
- if (!this.DrawText(text,this.DateTimeColor,position)) return;
52128
- bShowUpdateTime=true;
52129
- }
52130
- }
52131
-
52132
- if (!bShowUpdateTime)
52133
- {
52134
- if (this.TimeFormat) //指定时间格式
52135
- {
52136
- var strDate=null, strTime=null, text=null;
52137
- if (this.IsShowDate) strDate=IFrameSplitOperator.FormatDateString("YYYY-MM-DD", item.Date);
52138
- if (this.IsShowTime) strTime=IFrameSplitOperator.FormatTimeString(item.Time,this.TimeFormat);
52139
- if (strDate && strTime) text=`${strDate} ${strTime}`;
52140
- else if (strDate) text=strDate;
52141
- else if (strTime) text=strTime;
52142
- if (text) if (!this.DrawText(text,this.DateTimeColor,position)) return;
52143
- }
52144
- else
52145
- {
52146
- var text=IFrameSplitOperator.FormatDateTimeString(item.DateTime,this.IsShowDate, this.IsShowTime);
52147
- if (!this.DrawText(text,this.DateTimeColor,position)) return;
52148
- }
52149
- }
52150
- }
52151
-
52152
- var close=item.Close;
52153
- var increase=item.Increase;
52154
- var vol=item.Vol;
52155
- var amount=item.Amount;
52156
- if (item.Before) //读取盘前数据
52157
- {
52158
- close=item.Before.Close;
52159
- increase=item.Before.Increase;
52160
- vol=item.Before.Vol;
52161
- amount=item.Before.Amount;
52162
- }
52163
-
52164
- if (close)
52165
- {
52166
- var color=this.GetColor(close,this.YClose);
52167
- var text=g_JSChartLocalization.GetText('MTitle-Close',this.LanguageID)+close.toFixed(defaultfloatPrecision);
52168
- if (!this.DrawText(text,color,position)) return;
52169
- }
52170
-
52171
- if (increase!=null)
52172
- {
52173
- var color=this.GetColor(increase,0);
52174
- var text=g_JSChartLocalization.GetText('MTitle-Increase',this.LanguageID)+increase.toFixed(2)+'%';
52175
- if (!this.DrawText(text,color,position)) return;
52176
- }
52177
-
52178
- var isShowAvPrice=true;
52179
- var upperSymbol=this.Symbol.toUpperCase();
52180
- if (MARKET_SUFFIX_NAME.IsET(upperSymbol) && !MARKET_SUFFIX_NAME.IsETShowAvPrice(upperSymbol)) isShowAvPrice=false;
52181
- else if (MARKET_SUFFIX_NAME.IsShowAvPrice && !MARKET_SUFFIX_NAME.IsShowAvPrice(upperSymbol)) isShowAvPrice=false;
52182
-
52183
- if (item.AvPrice && isShowAvPrice && this.IsShowAveragePrice)
52184
- {
52185
- var color=this.GetColor(item.AvPrice,this.YClose);
52186
- var text=g_JSChartLocalization.GetText('MTitle-AvPrice',this.LanguageID)+item.AvPrice.toFixed(defaultfloatPrecision);
52187
- if (!this.DrawText(text,color,position)) return;
52188
- }
52189
-
52190
- var text=g_JSChartLocalization.GetText('MTitle-Vol',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(vol,2,this.LanguageID);
52191
- if (!this.DrawText(text,this.VolColor,position)) return;
52192
-
52193
- if (IFrameSplitOperator.IsNumber(amount))
52194
- {
52195
- var text=g_JSChartLocalization.GetText('MTitle-Amount',this.LanguageID)+IFrameSplitOperator.FormatValueString(amount,2,this.LanguageID);
52196
- if (!this.DrawText(text,this.AmountColor,position)) return;
52197
- }
52198
-
52199
- if (IFrameSplitOperator.IsNumber(item.Position))
52200
- {
52201
- var text=g_JSChartLocalization.GetText('MTitle-Position',this.LanguageID)+IFrameSplitOperator.FromatIntegerString(item.Position,2,this.LanguageID);
52202
- if (!this.DrawText(text,this.VolColor,position)) return;
52203
- }
52204
-
52205
- if (isLastOne && this.ShowLastDataFormat==0) //显示数据最后的更新时间
52206
- {
52207
- if (this.Data && this.Data.UpdateTime && IFrameSplitOperator.IsNumber(this.Data.UpdateTime.Date) && IFrameSplitOperator.IsNumber(this.Data.UpdateTime.Time))
52208
- {
52209
- var text=g_JSChartLocalization.GetText('MTitle-UpdateTime',this.LanguageID)+IFrameSplitOperator.FormatTimeString(this.Data.UpdateTime.Time, "HH:MM:SS");
52210
- if (!this.DrawText(text,this.DateTimeColor,position)) return;
52211
- }
52212
- }
52213
-
52214
- //叠加股票的名字
52215
- for(var i in this.OverlayChartPaint)
52216
- {
52217
- var item=this.OverlayChartPaint[i];
52218
- if (!item.Symbol || !item.Title) continue;
52219
-
52220
- var name=item.Title;
52221
- var clrText=item.Color;
52222
- var text='['+name+']';
52223
- if (!this.DrawText(text,clrText,position)) return;
52224
- }
52225
- */
52226
52272
  }
52227
52273
 
52228
52274
  //盘前 盘后数据格式化
@@ -108035,7 +108081,7 @@ function JSExecute(ast,option)
108035
108081
  ["ISEQUAL",null], ["ISUP",null],["ISDOWN"], //ISUP=收阳 ISEQUAL=平盘 ISDOWN=收阴
108036
108082
 
108037
108083
  //日期类
108038
- ['DATE',null],['YEAR',null],['MONTH',null],['PERIOD', null],['WEEK',null],["TIME",null],["DAY",null],["DATETIME",null],["TIME2",null],
108084
+ ['DATE',null],['YEAR',null],['MONTH',null],['PERIOD', null],['WEEK',null],['WEEKDAY',null],["TIME",null],["DAY",null],["DATETIME",null],["TIME2",null],
108039
108085
  ["WEEKOFYEAR", null],["DAYSTOTODAY", null],
108040
108086
 
108041
108087
  //大盘数据
@@ -108317,6 +108363,7 @@ function JSExecute(ast,option)
108317
108363
  case 'MONTH':
108318
108364
  return this.SymbolData.MONTH();
108319
108365
  case 'WEEK':
108366
+ case "WEEKDAY":
108320
108367
  return this.SymbolData.WEEK();
108321
108368
  case "DAY":
108322
108369
  return this.SymbolData.DAY();
@@ -113050,6 +113097,11 @@ function OverlayScriptIndex(name,script,args,option)
113050
113097
  this.CreatePartLine(hqChart,windowIndex,item,i);
113051
113098
  break;
113052
113099
 
113100
+ case "DRAWTEXTABS":
113101
+ case "DRAWTEXTREL":
113102
+ this.CreateDrawText(hqChart,windowIndex,item,i);
113103
+ break;
113104
+
113053
113105
  case SCRIPT_CHART_NAME.OVERLAY_BARS:
113054
113106
  this.CreateStackedBar(hqChart,windowIndex,item,i);
113055
113107
  break;
@@ -113227,6 +113279,30 @@ function OverlayScriptIndex(name,script,args,option)
113227
113279
  frame.ChartPaint.push(chart);
113228
113280
  }
113229
113281
 
113282
+ this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
113283
+ {
113284
+ var overlayIndex=this.OverlayIndex;
113285
+ var frame=overlayIndex.Frame;
113286
+ var chart=new ChartSingleText();
113287
+ chart.Canvas=hqChart.Canvas;
113288
+ chart.Name=varItem.Name;
113289
+ chart.ChartBorder=frame.Frame.ChartBorder;
113290
+ chart.ChartFrame=frame.Frame;
113291
+ chart.Identify=overlayIndex.Identify;
113292
+ chart.ReloadResource();
113293
+
113294
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
113295
+ else chart.Color=this.GetDefaultColor(id);
113296
+
113297
+ if (varItem.IsDrawAbove) chart.Direction=1;
113298
+ else chart.Direction=0;
113299
+
113300
+ chart.DrawData=varItem.Draw.DrawData;
113301
+ if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
113302
+
113303
+ frame.ChartPaint.push(chart);
113304
+ }
113305
+
113230
113306
  //DRAWTEXT
113231
113307
  this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id)
113232
113308
  {
@@ -113878,6 +113954,7 @@ function OverlayScriptIndex(name,script,args,option)
113878
113954
  chart.Family=varItem.Draw.DrawData.Family;
113879
113955
  chart.TextFont=varItem.Draw.DrawData.TextFont;
113880
113956
  chart.Texts= varItem.Draw.DrawData.Data;
113957
+ if (varItem.Draw.AutoPosition) chart.AutoPosition=varItem.Draw.AutoPosition;
113881
113958
 
113882
113959
  this.ReloadChartResource(hqChart, windowIndex, chart);
113883
113960
 
@@ -114949,6 +115026,7 @@ function APIScriptIndex(name,script,args,option, isOverlay)
114949
115026
  drawItem.Text=draw.Text;
114950
115027
  drawItem.Name=draw.Name;
114951
115028
  drawItem.DrawType=draw.DrawType;
115029
+ if (draw.AutoPosition) drawItem.AutoPosition=draw.AutoPosition;
114952
115030
  drawItem.DrawData={ Data:this.FittingMultiText(draw.Data,date,time,hqChart), Family:draw.Family, TextFont:draw.TextFont, EnableTooltip:draw.EnableTooltip, IsDrawFirst:draw.IsDrawFirst };
114953
115031
  this.GetKLineData(drawItem.DrawData.Data, hqChart);
114954
115032
  outVarItem.Draw=drawItem;
@@ -115349,6 +115427,7 @@ function APIScriptIndex(name,script,args,option, isOverlay)
115349
115427
  drawItem.Text=draw.Text;
115350
115428
  drawItem.Name=draw.Name;
115351
115429
  drawItem.DrawType=draw.DrawType;
115430
+ if (draw.AutoPosition) drawItem.AutoPosition=draw.AutoPosition;
115352
115431
  drawItem.DrawData={ Data:this.FittingMultiText(draw.Data,date,time,hqChart), Family:draw.Family, TextFont:draw.TextFont ,EnableTooltip:draw.EnableTooltip,IsDrawFirst:draw.IsDrawFirst };
115353
115432
  this.GetKLineData(drawItem.DrawData.Data, hqChart);
115354
115433
  outVarItem.Draw=drawItem;
@@ -127476,7 +127555,7 @@ function ScrollBarBGChart()
127476
127555
 
127477
127556
 
127478
127557
 
127479
- var HQCHART_VERSION="1.1.12395";
127558
+ var HQCHART_VERSION="1.1.12413";
127480
127559
 
127481
127560
  function PrintHQChartVersion()
127482
127561
  {
@@ -222,8 +222,8 @@ function IChartPainting()
222
222
  if (Array.isArray(color))
223
223
  {
224
224
  let gradient = this.Canvas.createLinearGradient(x0, y0, x1, y1);
225
- var offset = 1 / (color.length);
226
- for (var i in color)
225
+ var offset = 1 / (color.length-1);
226
+ for (var i=0;i<color.length;++i)
227
227
  {
228
228
  gradient.addColorStop(i * offset, color[i]);
229
229
  }
@@ -12215,7 +12215,7 @@ function JSExecute(ast,option)
12215
12215
  ["ISEQUAL",null], ["ISUP",null],["ISDOWN"], //ISUP=收阳 ISEQUAL=平盘 ISDOWN=收阴
12216
12216
 
12217
12217
  //日期类
12218
- ['DATE', null], ['YEAR', null], ['MONTH', null], ['PERIOD', null], ['WEEK', null],["TIME",null],["DATETIME",null],["TIME2",null],
12218
+ ['DATE', null], ['YEAR', null], ['MONTH', null], ['PERIOD', null], ['WEEK', null],['WEEKDAY',null],["TIME",null],["DATETIME",null],["TIME2",null],
12219
12219
  ["WEEKOFYEAR", null],["DAYSTOTODAY", null],
12220
12220
 
12221
12221
  //大盘数据
@@ -12454,6 +12454,7 @@ function JSExecute(ast,option)
12454
12454
  case 'MONTH':
12455
12455
  return this.SymbolData.MONTH();
12456
12456
  case 'WEEK':
12457
+ case "WEEKDAY":
12457
12458
  return this.SymbolData.WEEK();
12458
12459
  case 'PERIOD':
12459
12460
  return this.SymbolData.PERIOD();
@@ -1631,6 +1631,11 @@ function OverlayScriptIndex(name,script,args,option)
1631
1631
  this.CreatePartLine(hqChart,windowIndex,item,i);
1632
1632
  break;
1633
1633
 
1634
+ case "DRAWTEXTABS":
1635
+ case "DRAWTEXTREL":
1636
+ this.CreateDrawText(hqChart,windowIndex,item,i);
1637
+ break;
1638
+
1634
1639
  case SCRIPT_CHART_NAME.OVERLAY_BARS:
1635
1640
  this.CreateStackedBar(hqChart,windowIndex,item,i);
1636
1641
  break;
@@ -1788,6 +1793,30 @@ function OverlayScriptIndex(name,script,args,option)
1788
1793
  frame.ChartPaint.push(chart);
1789
1794
  }
1790
1795
 
1796
+ this.CreateDrawText=function(hqChart,windowIndex,varItem,id)
1797
+ {
1798
+ var overlayIndex=this.OverlayIndex;
1799
+ var frame=overlayIndex.Frame;
1800
+ var chart=new ChartSingleText();
1801
+ chart.Canvas=hqChart.Canvas;
1802
+ chart.Name=varItem.Name;
1803
+ chart.ChartBorder=frame.Frame.ChartBorder;
1804
+ chart.ChartFrame=frame.Frame;
1805
+ chart.Identify=overlayIndex.Identify;
1806
+ chart.ReloadResource();
1807
+
1808
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
1809
+ else chart.Color=this.GetDefaultColor(id);
1810
+
1811
+ if (varItem.IsDrawAbove) chart.Direction=1;
1812
+ else chart.Direction=0;
1813
+
1814
+ chart.DrawData=varItem.Draw.DrawData;
1815
+ if (varItem.DrawFontSize>0) chart.TextFont=`${varItem.DrawFontSize*GetDevicePixelRatio()}px 微软雅黑`; //临时用下吧
1816
+
1817
+ frame.ChartPaint.push(chart);
1818
+ }
1819
+
1791
1820
  //DRAWTEXT
1792
1821
  this.CreateDrawTextV2=function(hqChart,windowIndex,varItem,id)
1793
1822
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.12393";
8
+ var HQCHART_VERSION="1.1.12411";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -3243,6 +3243,36 @@ function JSChartContainer(uielement)
3243
3243
 
3244
3244
  return true;
3245
3245
  }
3246
+
3247
+ //获取扩展画法
3248
+ this.GetExtendChartByClassName=function(name)
3249
+ {
3250
+ for(var i=0; i<this.ExtendChartPaint.length; ++i)
3251
+ {
3252
+ var item=this.ExtendChartPaint[i];
3253
+ if (item.ClassName==name) return { Index:i, Chart:item };
3254
+ }
3255
+
3256
+ return null
3257
+ }
3258
+
3259
+ //获取多个扩展画法
3260
+ this.GetExtendChartByClassNameV2=function(name)
3261
+ {
3262
+ var aryChart=[];
3263
+ for(var i=0; i<this.ExtendChartPaint.length; ++i)
3264
+ {
3265
+ var item=this.ExtendChartPaint[i];
3266
+ if (item.ClassName==name)
3267
+ {
3268
+ aryChart.push({ Index:i, Chart:item });
3269
+ }
3270
+ }
3271
+
3272
+ if (aryChart.length<=0) return null;
3273
+
3274
+ return aryChart;
3275
+ }
3246
3276
  }
3247
3277
 
3248
3278
  function ToFixed(number, precision)