hqchart 1.1.14675 → 1.1.14683

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.
@@ -34976,6 +34976,32 @@ function ChartIndexTitle()
34976
34976
  delete this.newMethod;
34977
34977
 
34978
34978
  this.ClassName='ChartIndexTitle'; //类名
34979
+ this.AryTitle=[]; //{ Date, Time, AryText:[ ] }
34980
+ this.MapCache=null; //key=date/date-time value={ Data:[] }
34981
+
34982
+ this.BuildCacheData=function()
34983
+ {
34984
+ var mapData=new Map();
34985
+ this.MapCache=mapData;
34986
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTitle)) return;
34987
+
34988
+ for(var i=0;i<this.AryTitle.length;++i)
34989
+ {
34990
+ var item=this.AryTitle[i];
34991
+ var key=this.BuildKey(item);
34992
+
34993
+ mapData.set(key,{ Data:item });
34994
+ }
34995
+ }
34996
+
34997
+ this.GetItem=function(kItem)
34998
+ {
34999
+ if (!this.MapCache || this.MapCache.size<=0) return null;
35000
+ var key=this.BuildKey(kItem);
35001
+ if (!this.MapCache.has(key)) return null;
35002
+
35003
+ return this.MapCache.get(key);
35004
+ }
34979
35005
 
34980
35006
  this.Draw=function()
34981
35007
  {
@@ -55868,44 +55894,39 @@ function ChartCorssCursor()
55868
55894
  var textSize={ Width:textWidth+4, Height:this.TextHeight, Text:[] };
55869
55895
  var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
55870
55896
 
55871
- if (this.Frame.ChartBorder.Left>=30) //左边
55897
+ var margin=this.LeftConfig.Margin;
55898
+ var textOffset=this.LeftConfig.TextOffset;
55899
+ var rtBG=null;
55900
+ if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1) //左边
55872
55901
  {
55873
- var margin=this.LeftConfig.Margin;
55874
- var textOffset=this.LeftConfig.TextOffset;
55902
+ var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
55903
+ rtBG.Left=rtBG.Right-rtBG.Width;
55904
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
55905
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
55875
55906
 
55876
- var rtBG=null;
55877
- if (this.ShowTextMode.Left==1)
55907
+ if (rtBG.Left<0)
55878
55908
  {
55879
- var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
55880
- rtBG.Left=rtBG.Right-rtBG.Width;
55881
- rtBG.Top=rtBG.YCenter-rtBG.Height/2;
55882
- rtBG.Bottom=rtBG.Top+rtBG.Height;
55883
-
55884
- if (rtBG.Left<0)
55885
- {
55886
- rtBG.Left=0;
55887
- rtBG.Right=rtBG.Left+rtBG.Width;
55888
- }
55889
- }
55890
- else if (this.ShowTextMode.Left==2) //在框架内显示
55891
- {
55892
- var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
55909
+ rtBG.Left=0;
55893
55910
  rtBG.Right=rtBG.Left+rtBG.Width;
55894
- rtBG.Top=rtBG.YCenter-rtBG.Height/2;
55895
- rtBG.Bottom=rtBG.Top+rtBG.Height;
55896
- }
55897
-
55898
- if (rtBG)
55899
- {
55900
- this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
55901
- this.Canvas.textAlign="left";
55902
- this.Canvas.textBaseline="bottom";
55903
- this.Canvas.fillStyle=this.TextColor;
55904
- this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
55905
55911
  }
55912
+
55913
+ }
55914
+ else if (this.ShowTextMode.Left==2) //在框架内显示
55915
+ {
55916
+ var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
55917
+ rtBG.Right=rtBG.Left+rtBG.Width;
55918
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
55919
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
55906
55920
  }
55907
55921
 
55908
-
55922
+ if (rtBG)
55923
+ {
55924
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
55925
+ this.Canvas.textAlign="left";
55926
+ this.Canvas.textBaseline="bottom";
55927
+ this.Canvas.fillStyle=this.TextColor;
55928
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
55929
+ }
55909
55930
 
55910
55931
  var complexText=
55911
55932
  {
@@ -56095,7 +56116,7 @@ function ChartCorssCursor()
56095
56116
  this.Canvas.textBaseline="bottom";
56096
56117
  this.Canvas.fillStyle=this.TextColor;
56097
56118
  this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
56098
- }
56119
+ }
56099
56120
  }
56100
56121
 
56101
56122
  //子坐标Y轴
@@ -60070,33 +60091,40 @@ function DynamicChartTitlePainting()
60070
60091
  return aryText;
60071
60092
  }
60072
60093
 
60073
- this.FormatIndexTitle=function(value, dataInfo)
60094
+ this.FormatIndexTitle=function(kItem, dataInfo)
60074
60095
  {
60075
- if (!value) return null;
60096
+ var result=null;
60097
+ var aryText=[];
60098
+ if (dataInfo.Name)
60099
+ {
60100
+ aryText.push({ Text:dataInfo.Name, Color:dataInfo.Color});
60101
+ result={ Text:null, ArrayText:aryText };
60102
+ }
60076
60103
 
60077
- if (IFrameSplitOperator.IsString(value)) return { Text:value, ArrayText:null };
60104
+ if (!kItem) return result;
60105
+ if (!dataInfo.Chart) return result;
60106
+
60107
+ var titleItem=dataInfo.Chart.GetItem(kItem);
60108
+ if (!titleItem || !titleItem.Data) return result;
60109
+ if (!IFrameSplitOperator.IsNonEmptyArray(titleItem.Data.AryText)) return result;
60078
60110
 
60079
- if (IFrameSplitOperator.IsNonEmptyArray(value))
60111
+ if (!result) result={ Text:null, ArrayText:aryText };
60112
+
60113
+ for(var i=0;i<titleItem.Data.AryText.length;++i)
60080
60114
  {
60081
- var aryText=[];
60082
- for(var i=0;i<value.length;++i)
60083
- {
60084
- var item=value[i];
60085
- if (!item) continue;
60086
-
60087
- var textItem={ Name:null, Text:null };
60088
- if (item.Name) textItem.Name=item.Name;
60089
- if (item.Text) textItem.Text=item.Text;
60090
- if (item.Color) textItem.Color=item.Color;
60091
- if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
60115
+ var item=titleItem.Data.AryText[i];
60116
+ if (!item) continue;
60092
60117
 
60093
- aryText.push(textItem);
60094
- }
60118
+ var textItem={ Name:null, Text:null };
60119
+ if (item.Name) textItem.Name=item.Name;
60120
+ if (item.Text) textItem.Text=item.Text;
60121
+ if (item.Color) textItem.Color=item.Color;
60122
+ if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
60095
60123
 
60096
- return { Text:null, ArrayText:aryText }
60124
+ aryText.push(textItem);
60097
60125
  }
60098
60126
 
60099
- return null;
60127
+ return result;
60100
60128
  }
60101
60129
 
60102
60130
  this.GetColor=function(price,yClose)
@@ -2985,24 +2985,38 @@ HQData.APIIndex_TITLE=function(data, callback)
2985
2985
  var textData={ name:"标题", type:10, color:"rgb(0,128,128)", data:[], }; //名字
2986
2986
  var closeData={ name:"收盘价", type:0, color:"rgb(255,165,0)", data:[] } ; //
2987
2987
 
2988
- var aryDate=[];
2989
- var aryTime=[];
2988
+ var titleData=
2989
+ {
2990
+ name:"我的指标标题", type:1,
2991
+ Draw:
2992
+ {
2993
+ Name:"指标标题测试",
2994
+ DrawType:"DRAWTITLE",
2995
+ DrawData:{ AryTitle:[] },
2996
+ },
2997
+ };
2998
+
2990
2999
  for(var i=0;i<kData.Data.length-30;++i)
2991
3000
  {
2992
3001
  var kItem=kData.Data[i];
2993
3002
 
2994
3003
  closeData.data.push(kItem.Close);
2995
3004
 
2996
- textData.data.push(
2997
- [
2998
- { Name:`收`, Text:`${kItem.Close.toFixed(2)}`, Color:"rgb(200,10,10)",},
2999
- { Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 }
3000
- ]);
3005
+ titleData.Draw.DrawData.AryTitle.push(
3006
+ {
3007
+ Date:kItem.Date, Time:kItem.Time,
3001
3008
 
3002
- //textData.data.push(`价格:${kItem.Close.toFixed(2)}`);
3009
+ AryText:
3010
+ [
3011
+ { Name:`收`, Text:`${kItem.Close.toFixed(2)}`, Color:"rgb(200,10,10)",},
3012
+ { Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 },
3013
+ { Name:"标题1", Text:"1xxxxx", Color:"rgb(100,200,10)", LeftSpace:2},
3014
+ { Name:"标题2", Text:"2xxxxx", Color:"rgb(200,200,10)", LeftSpace:2},
3015
+ { Name:"标题3", Text:"3xxxxx", Color:"rgb(100,70,80)", LeftSpace:2},
3016
+ ]
3017
+ });
3003
3018
 
3004
- aryDate.push(kItem.Date);
3005
- aryTime.push(kItem.Time);
3019
+ //textData.data.push(`价格:${kItem.Close.toFixed(2)}`);
3006
3020
  }
3007
3021
 
3008
3022
 
@@ -3010,7 +3024,7 @@ HQData.APIIndex_TITLE=function(data, callback)
3010
3024
  {
3011
3025
  code:0,
3012
3026
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
3013
- outdata: { date:aryDate, time:aryTime, outvar:[ textData, closeData] },
3027
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ titleData, closeData] },
3014
3028
 
3015
3029
  //error: { message:"无权限查看指标“测试指标1”" }
3016
3030
  };
@@ -39072,6 +39072,32 @@ function ChartIndexTitle()
39072
39072
  delete this.newMethod;
39073
39073
 
39074
39074
  this.ClassName='ChartIndexTitle'; //类名
39075
+ this.AryTitle=[]; //{ Date, Time, AryText:[ ] }
39076
+ this.MapCache=null; //key=date/date-time value={ Data:[] }
39077
+
39078
+ this.BuildCacheData=function()
39079
+ {
39080
+ var mapData=new Map();
39081
+ this.MapCache=mapData;
39082
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.AryTitle)) return;
39083
+
39084
+ for(var i=0;i<this.AryTitle.length;++i)
39085
+ {
39086
+ var item=this.AryTitle[i];
39087
+ var key=this.BuildKey(item);
39088
+
39089
+ mapData.set(key,{ Data:item });
39090
+ }
39091
+ }
39092
+
39093
+ this.GetItem=function(kItem)
39094
+ {
39095
+ if (!this.MapCache || this.MapCache.size<=0) return null;
39096
+ var key=this.BuildKey(kItem);
39097
+ if (!this.MapCache.has(key)) return null;
39098
+
39099
+ return this.MapCache.get(key);
39100
+ }
39075
39101
 
39076
39102
  this.Draw=function()
39077
39103
  {
@@ -59964,44 +59990,39 @@ function ChartCorssCursor()
59964
59990
  var textSize={ Width:textWidth+4, Height:this.TextHeight, Text:[] };
59965
59991
  var buttonData={Y:y, YValue:yValue, FrameID:yValueExtend.FrameID };
59966
59992
 
59967
- if (this.Frame.ChartBorder.Left>=30) //左边
59993
+ var margin=this.LeftConfig.Margin;
59994
+ var textOffset=this.LeftConfig.TextOffset;
59995
+ var rtBG=null;
59996
+ if (this.Frame.ChartBorder.Left>=30 && this.ShowTextMode.Left==1) //左边
59968
59997
  {
59969
- var margin=this.LeftConfig.Margin;
59970
- var textOffset=this.LeftConfig.TextOffset;
59971
-
59972
- var rtBG=null;
59973
- if (this.ShowTextMode.Left==1)
59974
- {
59975
- var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
59976
- rtBG.Left=rtBG.Right-rtBG.Width;
59977
- rtBG.Top=rtBG.YCenter-rtBG.Height/2;
59978
- rtBG.Bottom=rtBG.Top+rtBG.Height;
59998
+ var rtBG={ Right:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
59999
+ rtBG.Left=rtBG.Right-rtBG.Width;
60000
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
60001
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
59979
60002
 
59980
- if (rtBG.Left<0)
59981
- {
59982
- rtBG.Left=0;
59983
- rtBG.Right=rtBG.Left+rtBG.Width;
59984
- }
59985
- }
59986
- else if (this.ShowTextMode.Left==2) //在框架内显示
60003
+ if (rtBG.Left<0)
59987
60004
  {
59988
- var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
60005
+ rtBG.Left=0;
59989
60006
  rtBG.Right=rtBG.Left+rtBG.Width;
59990
- rtBG.Top=rtBG.YCenter-rtBG.Height/2;
59991
- rtBG.Bottom=rtBG.Top+rtBG.Height;
59992
- }
59993
-
59994
- if (rtBG)
59995
- {
59996
- this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
59997
- this.Canvas.textAlign="left";
59998
- this.Canvas.textBaseline="bottom";
59999
- this.Canvas.fillStyle=this.TextColor;
60000
- this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
60001
60007
  }
60008
+
60009
+ }
60010
+ else if (this.ShowTextMode.Left==2) //在框架内显示
60011
+ {
60012
+ var rtBG={ Left:left, Width:textWidth+margin.Left+margin.Right, YCenter:y, Height:textHeight+margin.Top+margin.Bottom };
60013
+ rtBG.Right=rtBG.Left+rtBG.Width;
60014
+ rtBG.Top=rtBG.YCenter-rtBG.Height/2;
60015
+ rtBG.Bottom=rtBG.Top+rtBG.Height;
60002
60016
  }
60003
60017
 
60004
-
60018
+ if (rtBG)
60019
+ {
60020
+ this.DrawTextBGRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);
60021
+ this.Canvas.textAlign="left";
60022
+ this.Canvas.textBaseline="bottom";
60023
+ this.Canvas.fillStyle=this.TextColor;
60024
+ this.Canvas.fillText(text,rtBG.Left+textOffset.X, rtBG.Bottom+textOffset.Y);
60025
+ }
60005
60026
 
60006
60027
  var complexText=
60007
60028
  {
@@ -60191,7 +60212,7 @@ function ChartCorssCursor()
60191
60212
  this.Canvas.textBaseline="bottom";
60192
60213
  this.Canvas.fillStyle=this.TextColor;
60193
60214
  this.Canvas.fillText(text,rtBG.Left+textOffset.X,rtBG.Bottom+textOffset.Y,textWidth);
60194
- }
60215
+ }
60195
60216
  }
60196
60217
 
60197
60218
  //子坐标Y轴
@@ -64166,33 +64187,40 @@ function DynamicChartTitlePainting()
64166
64187
  return aryText;
64167
64188
  }
64168
64189
 
64169
- this.FormatIndexTitle=function(value, dataInfo)
64190
+ this.FormatIndexTitle=function(kItem, dataInfo)
64170
64191
  {
64171
- if (!value) return null;
64192
+ var result=null;
64193
+ var aryText=[];
64194
+ if (dataInfo.Name)
64195
+ {
64196
+ aryText.push({ Text:dataInfo.Name, Color:dataInfo.Color});
64197
+ result={ Text:null, ArrayText:aryText };
64198
+ }
64172
64199
 
64173
- if (IFrameSplitOperator.IsString(value)) return { Text:value, ArrayText:null };
64200
+ if (!kItem) return result;
64201
+ if (!dataInfo.Chart) return result;
64202
+
64203
+ var titleItem=dataInfo.Chart.GetItem(kItem);
64204
+ if (!titleItem || !titleItem.Data) return result;
64205
+ if (!IFrameSplitOperator.IsNonEmptyArray(titleItem.Data.AryText)) return result;
64174
64206
 
64175
- if (IFrameSplitOperator.IsNonEmptyArray(value))
64207
+ if (!result) result={ Text:null, ArrayText:aryText };
64208
+
64209
+ for(var i=0;i<titleItem.Data.AryText.length;++i)
64176
64210
  {
64177
- var aryText=[];
64178
- for(var i=0;i<value.length;++i)
64179
- {
64180
- var item=value[i];
64181
- if (!item) continue;
64182
-
64183
- var textItem={ Name:null, Text:null };
64184
- if (item.Name) textItem.Name=item.Name;
64185
- if (item.Text) textItem.Text=item.Text;
64186
- if (item.Color) textItem.Color=item.Color;
64187
- if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
64211
+ var item=titleItem.Data.AryText[i];
64212
+ if (!item) continue;
64188
64213
 
64189
- aryText.push(textItem);
64190
- }
64214
+ var textItem={ Name:null, Text:null };
64215
+ if (item.Name) textItem.Name=item.Name;
64216
+ if (item.Text) textItem.Text=item.Text;
64217
+ if (item.Color) textItem.Color=item.Color;
64218
+ if (IFrameSplitOperator.IsNumber(item.LeftSpace)) textItem.LeftSpace=item.LeftSpace;
64191
64219
 
64192
- return { Text:null, ArrayText:aryText }
64220
+ aryText.push(textItem);
64193
64221
  }
64194
64222
 
64195
- return null;
64223
+ return result;
64196
64224
  }
64197
64225
 
64198
64226
  this.GetColor=function(price,yClose)
@@ -125729,13 +125757,16 @@ function ScriptIndex(name,script,args,option)
125729
125757
  chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
125730
125758
  chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
125731
125759
  chart.Identify=this.Guid;
125760
+ chart.Data=hqChart.GetKData(); //绑定K线
125732
125761
  if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
125733
125762
  else chart.Color=this.GetDefaultColor(id);
125734
- chart.Data.Data=varItem.Data;
125763
+ chart.AryTitle=varItem.Draw.DrawData.AryTitle;
125764
+ chart.BuildCacheData();
125735
125765
 
125736
125766
  var titleIndex=windowIndex+1;
125737
125767
  var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
125738
125768
  titleData.DataType="ChartIndexTitle";
125769
+ titleData.Chart=chart;
125739
125770
  hqChart.TitlePaint[titleIndex].Data[id]=titleData;
125740
125771
 
125741
125772
  this.SetChartIndexName(chart);
@@ -127553,6 +127584,9 @@ function ScriptIndex(name,script,args,option)
127553
127584
  case "DRAWSVG":
127554
127585
  this.CreateChartDrawSVG(hqChart,windowIndex,item,i);
127555
127586
  break;
127587
+ case "DRAWTITLE":
127588
+ this.CreateTitle(hqChart,windowIndex,item,i);
127589
+ break;
127556
127590
  case "MULTI_HTMLDOM":
127557
127591
  this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
127558
127592
  break;
@@ -127646,11 +127680,7 @@ function ScriptIndex(name,script,args,option)
127646
127680
  {
127647
127681
  this.CreateArea(hqChart,windowIndex,item,i);
127648
127682
  }
127649
- else if (item.Type==10) //标题
127650
- {
127651
- this.CreateTitle(hqChart,windowIndex,item,i);
127652
- }
127653
-
127683
+
127654
127684
  var titlePaint=hqChart.TitlePaint[windowIndex+1];
127655
127685
  if (titlePaint && titlePaint.Data && i<titlePaint.Data.length) //设置标题数值 小数位数和格式
127656
127686
  {
@@ -127927,6 +127957,9 @@ function OverlayScriptIndex(name,script,args,option)
127927
127957
  case "DRAWSVG":
127928
127958
  this.CreateChartDrawSVG(hqChart,windowIndex,item,i);
127929
127959
  break;
127960
+ case "DRAWTITLE":
127961
+ this.CreateTitle(hqChart,windowIndex,item,i);
127962
+ break;
127930
127963
  case "MULTI_HTMLDOM":
127931
127964
  this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
127932
127965
  break;
@@ -128000,11 +128033,6 @@ function OverlayScriptIndex(name,script,args,option)
128000
128033
  {
128001
128034
  this.CreateLine(hqChart,windowIndex,item,i, item.Type);
128002
128035
  }
128003
- else if (item.Type==10)
128004
- {
128005
- this.CreateTitle(hqChart,windowIndex,item,i);
128006
- }
128007
-
128008
128036
 
128009
128037
 
128010
128038
  var titleData=titleInfo.Data[i];
@@ -128589,22 +128617,25 @@ function OverlayScriptIndex(name,script,args,option)
128589
128617
  {
128590
128618
  var overlayIndex=this.OverlayIndex;
128591
128619
  var frame=overlayIndex.Frame;
128592
- let chart=new ChartIndexTitle();
128620
+ var chart=new ChartIndexTitle();
128593
128621
  chart.Canvas=hqChart.Canvas;
128594
128622
 
128595
128623
  chart.Name=varItem.Name;
128596
128624
  chart.ChartBorder=frame.Frame.ChartBorder;
128597
128625
  chart.ChartFrame=frame.Frame;
128598
128626
  chart.Identify=overlayIndex.Identify;
128599
-
128627
+ chart.Data=hqChart.GetKData(); //绑定K线
128628
+
128600
128629
  if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
128601
128630
  else chart.Color=this.GetDefaultColor(id);
128602
- chart.Data.Data=varItem.Data;
128631
+ chart.AryTitle=varItem.Draw.DrawData.AryTitle;
128632
+ chart.BuildCacheData();
128603
128633
 
128604
128634
  var titleIndex=windowIndex+1;
128605
128635
  var titlePaint=hqChart.TitlePaint[titleIndex];
128606
128636
  var titleData=new DynamicTitleData(chart.Data,chart.Name,chart.Color);
128607
128637
  titleData.DataType="ChartIndexTitle";
128638
+ titleData.Chart=chart;
128608
128639
  titlePaint.OverlayIndex.get(overlayIndex.Identify).Data[id]=titleData;
128609
128640
 
128610
128641
  this.SetChartIndexName(chart);
@@ -130220,6 +130251,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
130220
130251
 
130221
130252
  result.push(outVarItem);
130222
130253
  }
130254
+ else if (draw.DrawType=="DRAWTITLE")
130255
+ {
130256
+ drawItem.Name=draw.Name;
130257
+ drawItem.Type=draw.Type;
130258
+
130259
+ drawItem.DrawType=draw.DrawType;
130260
+ drawItem.DrawData=draw.DrawData;
130261
+
130262
+ outVarItem.Draw=drawItem;
130263
+
130264
+ result.push(outVarItem);
130265
+ }
130223
130266
  else if (draw.DrawType=="MULTI_HTMLDOM") //外部自己创建dom
130224
130267
  {
130225
130268
  drawItem.Text=draw.Text;
@@ -130778,6 +130821,18 @@ function APIScriptIndex(name,script,args,option, isOverlay)
130778
130821
 
130779
130822
  result.push(outVarItem);
130780
130823
  }
130824
+ else if (draw.DrawType=="DRAWTITLE")
130825
+ {
130826
+ drawItem.Name=draw.Name;
130827
+ drawItem.Type=draw.Type;
130828
+
130829
+ drawItem.DrawType=draw.DrawType;
130830
+ drawItem.DrawData=draw.DrawData;
130831
+
130832
+ outVarItem.Draw=drawItem;
130833
+
130834
+ result.push(outVarItem);
130835
+ }
130781
130836
  else
130782
130837
  {
130783
130838
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -147125,7 +147180,7 @@ function ScrollBarBGChart()
147125
147180
 
147126
147181
 
147127
147182
 
147128
- var HQCHART_VERSION="1.1.14674";
147183
+ var HQCHART_VERSION="1.1.14682";
147129
147184
 
147130
147185
  function PrintHQChartVersion()
147131
147186
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14674";
8
+ var HQCHART_VERSION="1.1.14682";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -58517,24 +58517,38 @@ HQData.APIIndex_TITLE=function(data, callback)
58517
58517
  var textData={ name:"标题", type:10, color:"rgb(0,128,128)", data:[], }; //名字
58518
58518
  var closeData={ name:"收盘价", type:0, color:"rgb(255,165,0)", data:[] } ; //
58519
58519
 
58520
- var aryDate=[];
58521
- var aryTime=[];
58520
+ var titleData=
58521
+ {
58522
+ name:"我的指标标题", type:1,
58523
+ Draw:
58524
+ {
58525
+ Name:"指标标题测试",
58526
+ DrawType:"DRAWTITLE",
58527
+ DrawData:{ AryTitle:[] },
58528
+ },
58529
+ };
58530
+
58522
58531
  for(var i=0;i<kData.Data.length-30;++i)
58523
58532
  {
58524
58533
  var kItem=kData.Data[i];
58525
58534
 
58526
58535
  closeData.data.push(kItem.Close);
58527
58536
 
58528
- textData.data.push(
58529
- [
58530
- { Name:`收`, Text:`${kItem.Close.toFixed(2)}`, Color:"rgb(200,10,10)",},
58531
- { Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 }
58532
- ]);
58537
+ titleData.Draw.DrawData.AryTitle.push(
58538
+ {
58539
+ Date:kItem.Date, Time:kItem.Time,
58533
58540
 
58534
- //textData.data.push(`价格:${kItem.Close.toFixed(2)}`);
58541
+ AryText:
58542
+ [
58543
+ { Name:`收`, Text:`${kItem.Close.toFixed(2)}`, Color:"rgb(200,10,10)",},
58544
+ { Name:`开`, Text:`${kItem.Open.toFixed(2)}`, Color:"rgb(0,200,10)", LeftSpace:2 },
58545
+ { Name:"标题1", Text:"1xxxxx", Color:"rgb(100,200,10)", LeftSpace:2},
58546
+ { Name:"标题2", Text:"2xxxxx", Color:"rgb(200,200,10)", LeftSpace:2},
58547
+ { Name:"标题3", Text:"3xxxxx", Color:"rgb(100,70,80)", LeftSpace:2},
58548
+ ]
58549
+ });
58535
58550
 
58536
- aryDate.push(kItem.Date);
58537
- aryTime.push(kItem.Time);
58551
+ //textData.data.push(`价格:${kItem.Close.toFixed(2)}`);
58538
58552
  }
58539
58553
 
58540
58554
 
@@ -58542,7 +58556,7 @@ HQData.APIIndex_TITLE=function(data, callback)
58542
58556
  {
58543
58557
  code:0,
58544
58558
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
58545
- outdata: { date:aryDate, time:aryTime, outvar:[ textData, closeData] },
58559
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ titleData, closeData] },
58546
58560
 
58547
58561
  //error: { message:"无权限查看指标“测试指标1”" }
58548
58562
  };