hqchart 1.1.14299 → 1.1.14305

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.
@@ -231,7 +231,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
231
231
  }
232
232
  */
233
233
 
234
- stockItem.minute.length=50;
234
+ //stockItem.minute.length=50;
235
235
 
236
236
  var hqchartData={code:0, stock:[stockItem] };
237
237
 
@@ -1860,6 +1860,9 @@ HQData.Report_APIIndex=function(data, callback)
1860
1860
  HQData.APIIndex_DRAWTEXT_LINE(data, callback);
1861
1861
  else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
1862
1862
  HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
1863
+ else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
1864
+ HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
1865
+
1863
1866
  }
1864
1867
 
1865
1868
 
@@ -2264,8 +2267,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
2264
2267
  DrawData:
2265
2268
  {
2266
2269
  Price:price,
2267
- Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
2268
- Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
2270
+ Text:
2271
+ {
2272
+ Title:`价格:${price.toFixed(2)}`,
2273
+ Color:"rgb(255, 165, 0)",
2274
+ },
2275
+
2276
+ Line:
2277
+ {
2278
+ Type:1, //Type 0=不画 1=直线 2=虚线
2279
+ //LineDash:[10,10],
2280
+ Color:"rgb(200,200,0)",
2281
+ //Width:1,
2282
+ },
2269
2283
  }
2270
2284
  }
2271
2285
  };
@@ -2327,3 +2341,50 @@ HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
2327
2341
  }
2328
2342
 
2329
2343
 
2344
+ HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
2345
+ {
2346
+ data.PreventDefault=true;
2347
+ var hqchart=data.HQChart;
2348
+ var kData=hqchart.GetKData();
2349
+
2350
+ var tableData=
2351
+ {
2352
+ name:'DRAW_SIMPLE_PIE', type:1,
2353
+ Draw:
2354
+ {
2355
+ DrawType:'DRAW_SIMPLE_PIE',
2356
+ DrawData:
2357
+ {
2358
+ //BGColor:"rgba(250,250,210,0.8)",
2359
+ //BorderColor:"rgb(110,110,110)",
2360
+ //TextColor:"rgb(0,191,255)",
2361
+ Data:
2362
+ [
2363
+ { Value:10, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
2364
+ { Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
2365
+ { Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
2366
+ { Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
2367
+ { Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
2368
+ ],
2369
+
2370
+ //TextFont:{ Size:16, Name:"微软雅黑"},
2371
+ //XOffset:-10,
2372
+ //YOffset:-15,
2373
+ Radius:80,
2374
+ }
2375
+ }
2376
+ };
2377
+
2378
+ var apiData=
2379
+ {
2380
+ code:0,
2381
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2382
+ outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
2383
+ };
2384
+
2385
+
2386
+ console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
2387
+ callback(apiData);
2388
+ }
2389
+
2390
+
@@ -35688,109 +35688,156 @@ function ChartSimpleTable()
35688
35688
 
35689
35689
 
35690
35690
  //饼图
35691
- function ChartPie()
35691
+ function ChartSimplePie()
35692
35692
  {
35693
35693
  this.newMethod=IChartPainting; //派生
35694
35694
  this.newMethod();
35695
35695
  delete this.newMethod;
35696
35696
 
35697
- this.Radius = 100; //半径默认值
35698
- this.Width=40;
35699
- this.Height=50;
35700
-
35701
- //this.Distance = 30; //指示线超出圆饼的距离
35702
- //this.txtLine = 20; // 文本下划线
35703
- //this.paddingX = 20 / 3;// 设置文本的移动
35704
-
35697
+ this.ClassName='ChartSimplePie'; //类名
35705
35698
 
35699
+ this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
35700
+ this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
35701
+ this.LineExtendWidth=10;
35702
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
35706
35703
 
35707
35704
  this.RectClient={ };
35708
-
35709
- this.Draw=function()
35705
+ this.TotalValue=1;
35706
+ this.Radius = 50; //半径默认值
35707
+ this.TextFont;
35708
+
35709
+
35710
+ this.ReloadResource=function(resource)
35710
35711
  {
35711
- if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
35712
+ this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
35713
+ this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
35714
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
35715
+ }
35712
35716
 
35717
+ this.CalculateSize=function()
35718
+ {
35719
+ var border=this.ChartFrame.GetBorder();
35720
+ var pixelRatio=GetDevicePixelRatio();
35721
+ this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
35722
+ this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
35713
35723
 
35714
35724
 
35715
- let left=this.ChartBorder.GetLeft();
35716
- let right=this.ChartBorder.GetRight();
35717
- let top=this.ChartBorder.GetTop();
35718
- let bottom=this.ChartBorder.GetBottom();
35719
- let width=this.ChartBorder.GetWidth();
35720
- let height=this.ChartBorder.GetHeight();
35725
+ this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
35721
35726
 
35722
- if(isNaN(this.Radius)){
35723
- let str = this.Radius.replace("%","");
35724
- str = str/100;
35725
- if(width >= height){
35726
- this.Radius = str*height;
35727
- }
35728
- if(width < height) this.Radius = str*width;
35727
+ this.RectClient.Right=border.Right+this.Offset.X;
35728
+ this.RectClient.Top=border.TopEx+this.Offset.Y;
35729
+ this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
35730
+ this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
35731
+ }
35732
+
35733
+ this.CalculateTotalValue=function()
35734
+ {
35735
+ var totalValue=0;
35736
+ for(var i=0; i<this.Data.Data.length; ++i)
35737
+ {
35738
+ var item=this.Data.Data[i];
35739
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
35740
+ totalValue += item.Value;
35729
35741
  }
35730
35742
 
35743
+ this.TotalValue=totalValue;
35744
+ }
35731
35745
 
35732
- this.Canvas.save();
35733
- this.Canvas.translate(width/2,height/2);
35746
+ this.DrawPie=function()
35747
+ {
35748
+ this.Canvas.font=this.TextFont;
35749
+ this.Canvas.textBaseline='bottom';
35750
+ this.Canvas.textAlign = 'left';
35734
35751
 
35735
- let totalValue=0; //求和
35736
- for(let i in this.Data.Data)
35752
+ var aryText=[];
35753
+ var maxTextWidth=0;
35754
+ for(var i=0;i<this.Data.Data.length;++i)
35737
35755
  {
35738
- totalValue += this.Data.Data[i].Value;
35756
+ var item=this.Data.Data[i];
35757
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
35758
+ if (!item.Text) continue;
35759
+ var textWidth=this.Canvas.measureText(item.Text).width;
35760
+
35761
+ aryText[i]={ Width:textWidth };
35762
+
35763
+ if (maxTextWidth<textWidth) maxTextWidth=textWidth;
35739
35764
  }
35740
- let start = 0;
35741
- let end = 0;
35742
- //画饼图
35743
- for(let i in this.Data.Data)
35765
+
35766
+ var xOffset=maxTextWidth+this.LineExtendWidth;
35767
+ this.RectClient.Left-=xOffset;
35768
+ this.RectClient.Right-=xOffset;
35769
+
35770
+
35771
+ var start=0, end=0;
35772
+ var x=this.RectClient.Left+this.Radius;
35773
+ var y=this.RectClient.Top+this.Radius;
35774
+
35775
+ for(var i=0;i<this.Data.Data.length;++i)
35744
35776
  {
35745
- let item =this.Data.Data[i];
35746
- let rate=(item.Value/totalValue).toFixed(2); //占比
35747
- //JSConsole.Chart.Log('[ChartPie::Draw]', i, rate, item);
35777
+ var item=this.Data.Data[i];
35778
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
35779
+
35780
+ var rate=item.Value/this.TotalValue;
35748
35781
 
35749
35782
  // 绘制扇形
35750
35783
  this.Canvas.beginPath();
35751
- this.Canvas.moveTo(0,0);
35752
-
35784
+ this.Canvas.moveTo(x,y);
35785
+
35753
35786
  end += rate*2*Math.PI;//终止角度
35754
- this.Canvas.strokeStyle = "white";
35787
+ this.Canvas.strokeStyle = this.BorderColor;
35755
35788
  this.Canvas.fillStyle = item.Color;
35756
- this.Canvas.arc(0,0,this.Radius,start,end);
35789
+ this.Canvas.arc(x,y,this.Radius,start,end);
35757
35790
  this.Canvas.fill();
35758
35791
  this.Canvas.closePath();
35759
- this.Canvas.stroke();
35760
-
35761
- // 绘制直线
35762
- this.Canvas.beginPath();
35763
- this.Canvas.strokeStyle = item.Color;
35764
- this.Canvas.moveTo(0,0);
35765
- let x = (this.Radius + this.Distance)*Math.cos(end- (end-start)/2);
35766
- let y = (this.Radius + this.Distance)*Math.sin(end - (end-start)/2);
35767
- this.Canvas.lineTo(x,y);
35768
- // JSConsole.Chart.Log(x,y,"xy")
35769
-
35770
- // 绘制横线
35771
- let txtLine = this.txtLine;
35772
- let paddingX = this.paddingX;
35773
- this.Canvas.textAlign = 'left';
35774
- if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI ){
35775
-
35776
- txtLine = - this.txtLine;
35777
- paddingX = - this.paddingX;
35778
- this.Canvas.textAlign = 'right';
35779
- }
35780
- this.Canvas.lineTo( x + txtLine, y );
35781
35792
  this.Canvas.stroke();
35782
35793
 
35783
- // 写文字
35784
- if(item.Text){
35785
- this.Canvas.fillText( item.Text, x + txtLine + paddingX, y );
35786
- }else{
35787
- let text = `${item.Name}:${item.Value}`;
35788
- this.Canvas.fillText( text, x + txtLine + paddingX, y );
35789
- }
35790
-
35794
+ if (item.Text)
35795
+ {
35796
+ // 绘制直线
35797
+ var xLine=this.Radius*Math.cos(end- (end-start)/2)+x;
35798
+ var yLine=this.Radius*Math.sin(end - (end-start)/2)+y;
35799
+ var xEnd = (this.Radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
35800
+ var yEnd = (this.Radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
35801
+
35802
+ this.Canvas.beginPath();
35803
+ if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
35804
+ else this.Canvas.strokeStyle = item.Color;
35805
+ this.Canvas.moveTo(xLine,yLine);
35806
+ this.Canvas.lineTo(xEnd,yEnd);
35807
+
35808
+ var textWidth=aryText[i].Width;
35809
+ var yText=xEnd;
35810
+ if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
35811
+ {
35812
+ this.Canvas.lineTo( xEnd - textWidth, yEnd );
35813
+ yText=xEnd - textWidth;
35814
+ }
35815
+ else
35816
+ {
35817
+ this.Canvas.lineTo( xEnd + textWidth, yEnd );
35818
+ }
35819
+ this.Canvas.stroke();
35820
+
35821
+ if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
35822
+ else this.Canvas.fillStyle=item.Color;
35823
+ this.Canvas.fillText(item.Text, yText, yEnd);
35824
+ }
35791
35825
 
35792
35826
  start += rate*2*Math.PI;//起始角度
35793
35827
  }
35828
+ }
35829
+
35830
+ this.Draw=function()
35831
+ {
35832
+ if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
35833
+
35834
+ this.CalculateTotalValue();
35835
+ if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
35836
+ this.CalculateSize();
35837
+
35838
+ this.Canvas.save();
35839
+
35840
+ this.DrawPie();
35794
35841
 
35795
35842
  this.Canvas.restore();
35796
35843
  }
@@ -35798,7 +35845,7 @@ function ChartPie()
35798
35845
  //空数据
35799
35846
  this.DrawEmptyData=function()
35800
35847
  {
35801
- JSConsole.Chart.Log('[ChartPie::DrawEmptyData]')
35848
+ JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
35802
35849
  }
35803
35850
 
35804
35851
  this.GetMaxMin=function()
@@ -40364,6 +40411,7 @@ function ChartMinutePriceLine()
40364
40411
  var pointCount=0;
40365
40412
 
40366
40413
  this.Canvas.save();
40414
+ this.ClipClient(isHScreen);
40367
40415
  if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
40368
40416
  for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
40369
40417
  {
@@ -43869,8 +43917,8 @@ function ChartTextLine()
43869
43917
 
43870
43918
  this.ClassName="ChartTextLine";
43871
43919
 
43872
- this.Text; //Text=内容 Color
43873
- this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
43920
+ this.Text; //{ Title:内容, Color: YOffset:, }
43921
+ this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
43874
43922
  this.Price;
43875
43923
 
43876
43924
  this.Draw=function()
@@ -43884,6 +43932,10 @@ function ChartTextLine()
43884
43932
  var bottom=this.ChartBorder.GetBottomEx();
43885
43933
  var top=this.ChartBorder.GetTopEx();
43886
43934
  var y=this.ChartFrame.GetYFromData(this.Price);
43935
+
43936
+ this.Canvas.save();
43937
+ this.ClipClient(this.IsHScreen);
43938
+
43887
43939
  var textWidth=0;
43888
43940
  if (this.Text.Title)
43889
43941
  {
@@ -43913,23 +43965,22 @@ function ChartTextLine()
43913
43965
  {
43914
43966
  if (this.Line.Type==2) //虚线
43915
43967
  {
43916
- this.Canvas.save();
43917
- this.Canvas.setLineDash([3,5]); //虚线
43968
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash)) this.Canvas.setLineDash(this.Line.LineDash)
43969
+ else this.Canvas.setLineDash([3,5]); //虚线
43918
43970
  }
43919
43971
 
43972
+ if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
43973
+
43920
43974
  var x=left+textWidth;
43921
43975
  this.Canvas.strokeStyle=this.Line.Color;
43922
43976
  this.Canvas.beginPath();
43923
43977
  this.Canvas.moveTo(x,ToFixedPoint(y));
43924
43978
  this.Canvas.lineTo(right,ToFixedPoint(y));
43925
43979
  this.Canvas.stroke();
43926
-
43927
- if (this.Line.Type==2)
43928
- {
43929
- this.Canvas.restore();
43930
- }
43931
43980
  }
43932
43981
 
43982
+
43983
+ this.Canvas.restore();
43933
43984
  }
43934
43985
 
43935
43986
  this.GetMaxMin=function()
@@ -74418,6 +74469,13 @@ function JSChartResource()
74418
74469
  BorderColor:"rgb(217,217,217)",
74419
74470
  }
74420
74471
 
74472
+ this.ChartSimplePie=
74473
+ {
74474
+ TextFont:{ Family:'微软雅黑' , Size:12 },
74475
+ BorderColor:"rgb(169,169,169)",
74476
+ Offset:{ X:-5, Y:5 }
74477
+ }
74478
+
74421
74479
  //手机端tooltip
74422
74480
  this.TooltipPaint = {
74423
74481
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -75647,6 +75705,7 @@ function JSChartResource()
75647
75705
  }
75648
75706
 
75649
75707
  if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
75708
+ if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
75650
75709
 
75651
75710
  if (style.DRAWICON)
75652
75711
  {
@@ -76719,6 +76778,27 @@ function JSChartResource()
76719
76778
  }
76720
76779
  }
76721
76780
 
76781
+ this.SetChartSimplePie=function(style)
76782
+ {
76783
+ var dest=this.ChartSimplePie;
76784
+
76785
+ if (style.TextFont)
76786
+ {
76787
+ var item=style.TextFont;
76788
+ if (item.Name) dest.TextFont.Name=item.Name;
76789
+ if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
76790
+ }
76791
+
76792
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
76793
+
76794
+ if (style.Offset)
76795
+ {
76796
+ var item=style.Offset;
76797
+ if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
76798
+ if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
76799
+ }
76800
+ }
76801
+
76722
76802
  }
76723
76803
 
76724
76804
  var g_JSChartResource=new JSChartResource();
@@ -111948,6 +112028,30 @@ function JSDraw(errorHandler,symbolData)
111948
112028
 
111949
112029
  return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
111950
112030
  }
112031
+
112032
+ //饼图
112033
+ this.PIE_CELL=function(value, color, text, textColor, lineColor)
112034
+ {
112035
+ var cellItem={ Value:value, Color:color };
112036
+ if (text) cellItem.Text=text;
112037
+ if (textColor) cellItem.TextColor=textColor;
112038
+ if (lineColor) cellItem.LineColor=lineColor;
112039
+
112040
+ return cellItem
112041
+ }
112042
+
112043
+ //0=Radius半径
112044
+ this.DRAWPIE=function(aryData)
112045
+ {
112046
+ var radius=aryData[0];
112047
+ var aryCell=[];
112048
+ for(var i=1;i<aryData.length;++i)
112049
+ {
112050
+ aryCell.push(aryData[i]);
112051
+ }
112052
+
112053
+ return result={ DrawData:{ Data:aryCell, Radius:radius }, DrawType:"DRAW_SIMPLE_PIE" };
112054
+ }
111951
112055
  }
111952
112056
 
111953
112057
 
@@ -112002,7 +112106,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
112002
112106
  'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
112003
112107
  "VERTLINE","HORLINE","TIPICON",
112004
112108
  "BUY","SELL","SELLSHORT","BUYSHORT",
112005
- "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
112109
+ "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
112006
112110
  ]);
112007
112111
  if (setFunctionName.has(name)) return true;
112008
112112
 
@@ -118883,6 +118987,14 @@ function JSExecute(ast,option)
118883
118987
  node.Draw=this.Draw.DRAWTABLE(args);
118884
118988
  node.Out=[];
118885
118989
  break;
118990
+ //饼图
118991
+ case "PIE_CELL":
118992
+ node.Out=this.Draw.PIE_CELL(args[0],args[1],args[2],args[3],args[4]);
118993
+ break;
118994
+ case "DRAWPIE":
118995
+ node.Draw=this.Draw.DRAWPIE(args);
118996
+ node.Out=[];
118997
+ break;
118886
118998
 
118887
118999
  default:
118888
119000
  node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
@@ -121876,6 +121988,29 @@ function ScriptIndex(name,script,args,option)
121876
121988
  hqChart.ChartPaint.push(chart);
121877
121989
  }
121878
121990
 
121991
+ this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
121992
+ {
121993
+ var chart=new ChartSimplePie();
121994
+ chart.Canvas=hqChart.Canvas;
121995
+ chart.Name=varItem.Name;
121996
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
121997
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
121998
+
121999
+ if (varItem.Draw && varItem.Draw.DrawData)
122000
+ {
122001
+ var drawData=varItem.Draw.DrawData;
122002
+ if (drawData.Data) chart.Data.Data=drawData.Data;
122003
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
122004
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
122005
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
122006
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
122007
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
122008
+ if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
122009
+ }
122010
+
122011
+ hqChart.ChartPaint.push(chart);
122012
+ }
122013
+
121879
122014
  this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
121880
122015
  {
121881
122016
  var chart=new ChartTradeIcon();
@@ -122744,6 +122879,8 @@ function ScriptIndex(name,script,args,option)
122744
122879
  case "DRAW_SIMPLE_TABLE":
122745
122880
  this.CreateSimpleTable(hqChart,windowIndex,item,i);
122746
122881
  break;
122882
+ case "DRAW_SIMPLE_PIE":
122883
+ this.CreateSimplePie(hqChart,windowIndex,item,i);
122747
122884
  case "BUY":
122748
122885
  case "SELL":
122749
122886
  case "SELLSHORT":
@@ -123094,6 +123231,8 @@ function OverlayScriptIndex(name,script,args,option)
123094
123231
  case "DRAW_SIMPLE_TABLE":
123095
123232
  this.CreateSimpleTable(hqChart,windowIndex,item,i);
123096
123233
  break;
123234
+ case "DRAW_SIMPLE_PIE":
123235
+ this.CreateSimplePie(hqChart,windowIndex,item,i);
123097
123236
 
123098
123237
  case "KLINE_BG":
123099
123238
  this.CreateBackgroud(hqChart,windowIndex,item,i);
@@ -124131,6 +124270,33 @@ function OverlayScriptIndex(name,script,args,option)
124131
124270
  frame.ChartPaint.push(chart);
124132
124271
  }
124133
124272
 
124273
+ this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
124274
+ {
124275
+ var overlayIndex=this.OverlayIndex;
124276
+ var frame=overlayIndex.Frame;
124277
+ var chart=new ChartSimplePie();
124278
+ chart.Canvas=hqChart.Canvas;
124279
+ chart.Name=varItem.Name;
124280
+ chart.ChartBorder=frame.Frame.ChartBorder;
124281
+ chart.ChartFrame=frame.Frame;
124282
+ chart.Identify=overlayIndex.Identify;
124283
+ chart.HQChart=hqChart;
124284
+
124285
+ if (varItem.Draw && varItem.Draw.DrawData)
124286
+ {
124287
+ var drawData=varItem.Draw.DrawData;
124288
+ if (drawData.Data) chart.Data.Data=drawData.Data;
124289
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
124290
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
124291
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
124292
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
124293
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
124294
+ if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
124295
+ }
124296
+
124297
+ frame.ChartPaint.push(chart);
124298
+ }
124299
+
124134
124300
  this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
124135
124301
  {
124136
124302
  var overlayIndex=this.OverlayIndex;
@@ -125333,6 +125499,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
125333
125499
  outVarItem.Draw=drawItem;
125334
125500
  result.push(outVarItem);
125335
125501
  }
125502
+ else if (draw.DrawType=="DRAW_SIMPLE_PIE")
125503
+ {
125504
+ drawItem.Name=draw.Name;
125505
+ drawItem.Type=draw.Type;
125506
+
125507
+ drawItem.DrawType=draw.DrawType;
125508
+ drawItem.DrawData=draw.DrawData; //{ Data:[ {Value, Color, Text: }, ], BorderColor:, TextFont:{ Size:, Name: } };
125509
+
125510
+ outVarItem.Draw=drawItem;
125511
+ result.push(outVarItem);
125512
+ }
125336
125513
  else
125337
125514
  {
125338
125515
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -126944,6 +127121,11 @@ function GetBlackStyle()
126944
127121
  BorderColor:"rgb(90,90,90)",
126945
127122
  },
126946
127123
 
127124
+ ChartSimplePie:
127125
+ {
127126
+ BorderColor:"rgb(220,220,220)",
127127
+ },
127128
+
126947
127129
  ChartDrawVolProfile:
126948
127130
  {
126949
127131
  BGColor:"rgba(244,250,254,0.3)",
@@ -141479,7 +141661,7 @@ function ScrollBarBGChart()
141479
141661
 
141480
141662
 
141481
141663
 
141482
- var HQCHART_VERSION="1.1.14298";
141664
+ var HQCHART_VERSION="1.1.14304";
141483
141665
 
141484
141666
  function PrintHQChartVersion()
141485
141667
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14298";
8
+ var HQCHART_VERSION="1.1.14304";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {