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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14299",
3
+ "version": "1.1.14305",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -55745,7 +55745,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
55745
55745
  }
55746
55746
  */
55747
55747
 
55748
- stockItem.minute.length=50;
55748
+ //stockItem.minute.length=50;
55749
55749
 
55750
55750
  var hqchartData={code:0, stock:[stockItem] };
55751
55751
 
@@ -57374,6 +57374,9 @@ HQData.Report_APIIndex=function(data, callback)
57374
57374
  HQData.APIIndex_DRAWTEXT_LINE(data, callback);
57375
57375
  else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
57376
57376
  HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
57377
+ else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
57378
+ HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
57379
+
57377
57380
  }
57378
57381
 
57379
57382
 
@@ -57778,8 +57781,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
57778
57781
  DrawData:
57779
57782
  {
57780
57783
  Price:price,
57781
- Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
57782
- Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
57784
+ Text:
57785
+ {
57786
+ Title:`价格:${price.toFixed(2)}`,
57787
+ Color:"rgb(255, 165, 0)",
57788
+ },
57789
+
57790
+ Line:
57791
+ {
57792
+ Type:1, //Type 0=不画 1=直线 2=虚线
57793
+ //LineDash:[10,10],
57794
+ Color:"rgb(200,200,0)",
57795
+ //Width:1,
57796
+ },
57783
57797
  }
57784
57798
  }
57785
57799
  };
@@ -57841,3 +57855,50 @@ HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
57841
57855
  }
57842
57856
 
57843
57857
 
57858
+ HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
57859
+ {
57860
+ data.PreventDefault=true;
57861
+ var hqchart=data.HQChart;
57862
+ var kData=hqchart.GetKData();
57863
+
57864
+ var tableData=
57865
+ {
57866
+ name:'DRAW_SIMPLE_PIE', type:1,
57867
+ Draw:
57868
+ {
57869
+ DrawType:'DRAW_SIMPLE_PIE',
57870
+ DrawData:
57871
+ {
57872
+ //BGColor:"rgba(250,250,210,0.8)",
57873
+ //BorderColor:"rgb(110,110,110)",
57874
+ //TextColor:"rgb(0,191,255)",
57875
+ Data:
57876
+ [
57877
+ { Value:10, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
57878
+ { Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
57879
+ { Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
57880
+ { Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
57881
+ { Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
57882
+ ],
57883
+
57884
+ //TextFont:{ Size:16, Name:"微软雅黑"},
57885
+ //XOffset:-10,
57886
+ //YOffset:-15,
57887
+ Radius:80,
57888
+ }
57889
+ }
57890
+ };
57891
+
57892
+ var apiData=
57893
+ {
57894
+ code:0,
57895
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
57896
+ outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
57897
+ };
57898
+
57899
+
57900
+ console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
57901
+ callback(apiData);
57902
+ }
57903
+
57904
+
@@ -11540,6 +11540,30 @@ function JSDraw(errorHandler,symbolData)
11540
11540
 
11541
11541
  return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
11542
11542
  }
11543
+
11544
+ //饼图
11545
+ this.PIE_CELL=function(value, color, text, textColor, lineColor)
11546
+ {
11547
+ var cellItem={ Value:value, Color:color };
11548
+ if (text) cellItem.Text=text;
11549
+ if (textColor) cellItem.TextColor=textColor;
11550
+ if (lineColor) cellItem.LineColor=lineColor;
11551
+
11552
+ return cellItem
11553
+ }
11554
+
11555
+ //0=Radius半径
11556
+ this.DRAWPIE=function(aryData)
11557
+ {
11558
+ var radius=aryData[0];
11559
+ var aryCell=[];
11560
+ for(var i=1;i<aryData.length;++i)
11561
+ {
11562
+ aryCell.push(aryData[i]);
11563
+ }
11564
+
11565
+ return result={ DrawData:{ Data:aryCell, Radius:radius }, DrawType:"DRAW_SIMPLE_PIE" };
11566
+ }
11543
11567
  }
11544
11568
 
11545
11569
 
@@ -11594,7 +11618,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
11594
11618
  'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
11595
11619
  "VERTLINE","HORLINE","TIPICON",
11596
11620
  "BUY","SELL","SELLSHORT","BUYSHORT",
11597
- "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
11621
+ "DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
11598
11622
  ]);
11599
11623
  if (setFunctionName.has(name)) return true;
11600
11624
 
@@ -18475,6 +18499,14 @@ function JSExecute(ast,option)
18475
18499
  node.Draw=this.Draw.DRAWTABLE(args);
18476
18500
  node.Out=[];
18477
18501
  break;
18502
+ //饼图
18503
+ case "PIE_CELL":
18504
+ node.Out=this.Draw.PIE_CELL(args[0],args[1],args[2],args[3],args[4]);
18505
+ break;
18506
+ case "DRAWPIE":
18507
+ node.Draw=this.Draw.DRAWPIE(args);
18508
+ node.Out=[];
18509
+ break;
18478
18510
 
18479
18511
  default:
18480
18512
  node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
@@ -21468,6 +21500,29 @@ function ScriptIndex(name,script,args,option)
21468
21500
  hqChart.ChartPaint.push(chart);
21469
21501
  }
21470
21502
 
21503
+ this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
21504
+ {
21505
+ var chart=new ChartSimplePie();
21506
+ chart.Canvas=hqChart.Canvas;
21507
+ chart.Name=varItem.Name;
21508
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
21509
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
21510
+
21511
+ if (varItem.Draw && varItem.Draw.DrawData)
21512
+ {
21513
+ var drawData=varItem.Draw.DrawData;
21514
+ if (drawData.Data) chart.Data.Data=drawData.Data;
21515
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
21516
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
21517
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
21518
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
21519
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
21520
+ if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
21521
+ }
21522
+
21523
+ hqChart.ChartPaint.push(chart);
21524
+ }
21525
+
21471
21526
  this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
21472
21527
  {
21473
21528
  var chart=new ChartTradeIcon();
@@ -22336,6 +22391,8 @@ function ScriptIndex(name,script,args,option)
22336
22391
  case "DRAW_SIMPLE_TABLE":
22337
22392
  this.CreateSimpleTable(hqChart,windowIndex,item,i);
22338
22393
  break;
22394
+ case "DRAW_SIMPLE_PIE":
22395
+ this.CreateSimplePie(hqChart,windowIndex,item,i);
22339
22396
  case "BUY":
22340
22397
  case "SELL":
22341
22398
  case "SELLSHORT":
@@ -22686,6 +22743,8 @@ function OverlayScriptIndex(name,script,args,option)
22686
22743
  case "DRAW_SIMPLE_TABLE":
22687
22744
  this.CreateSimpleTable(hqChart,windowIndex,item,i);
22688
22745
  break;
22746
+ case "DRAW_SIMPLE_PIE":
22747
+ this.CreateSimplePie(hqChart,windowIndex,item,i);
22689
22748
 
22690
22749
  case "KLINE_BG":
22691
22750
  this.CreateBackgroud(hqChart,windowIndex,item,i);
@@ -23723,6 +23782,33 @@ function OverlayScriptIndex(name,script,args,option)
23723
23782
  frame.ChartPaint.push(chart);
23724
23783
  }
23725
23784
 
23785
+ this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
23786
+ {
23787
+ var overlayIndex=this.OverlayIndex;
23788
+ var frame=overlayIndex.Frame;
23789
+ var chart=new ChartSimplePie();
23790
+ chart.Canvas=hqChart.Canvas;
23791
+ chart.Name=varItem.Name;
23792
+ chart.ChartBorder=frame.Frame.ChartBorder;
23793
+ chart.ChartFrame=frame.Frame;
23794
+ chart.Identify=overlayIndex.Identify;
23795
+ chart.HQChart=hqChart;
23796
+
23797
+ if (varItem.Draw && varItem.Draw.DrawData)
23798
+ {
23799
+ var drawData=varItem.Draw.DrawData;
23800
+ if (drawData.Data) chart.Data.Data=drawData.Data;
23801
+ if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
23802
+ if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
23803
+ if (drawData.TextColor) chart.TextColor=drawData.TextColor;
23804
+ if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
23805
+ if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
23806
+ if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
23807
+ }
23808
+
23809
+ frame.ChartPaint.push(chart);
23810
+ }
23811
+
23726
23812
  this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
23727
23813
  {
23728
23814
  var overlayIndex=this.OverlayIndex;
@@ -24925,6 +25011,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
24925
25011
  outVarItem.Draw=drawItem;
24926
25012
  result.push(outVarItem);
24927
25013
  }
25014
+ else if (draw.DrawType=="DRAW_SIMPLE_PIE")
25015
+ {
25016
+ drawItem.Name=draw.Name;
25017
+ drawItem.Type=draw.Type;
25018
+
25019
+ drawItem.DrawType=draw.DrawType;
25020
+ drawItem.DrawData=draw.DrawData; //{ Data:[ {Value, Color, Text: }, ], BorderColor:, TextFont:{ Size:, Name: } };
25021
+
25022
+ outVarItem.Draw=drawItem;
25023
+ result.push(outVarItem);
25024
+ }
24928
25025
  else
24929
25026
  {
24930
25027
  var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
@@ -31763,109 +31763,156 @@ function ChartSimpleTable()
31763
31763
 
31764
31764
 
31765
31765
  //饼图
31766
- function ChartPie()
31766
+ function ChartSimplePie()
31767
31767
  {
31768
31768
  this.newMethod=IChartPainting; //派生
31769
31769
  this.newMethod();
31770
31770
  delete this.newMethod;
31771
31771
 
31772
- this.Radius = 100; //半径默认值
31773
- this.Width=40;
31774
- this.Height=50;
31775
-
31776
- //this.Distance = 30; //指示线超出圆饼的距离
31777
- //this.txtLine = 20; // 文本下划线
31778
- //this.paddingX = 20 / 3;// 设置文本的移动
31779
-
31772
+ this.ClassName='ChartSimplePie'; //类名
31780
31773
 
31774
+ this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
31775
+ this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
31776
+ this.LineExtendWidth=10;
31777
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
31781
31778
 
31782
31779
  this.RectClient={ };
31783
-
31784
- this.Draw=function()
31780
+ this.TotalValue=1;
31781
+ this.Radius = 50; //半径默认值
31782
+ this.TextFont;
31783
+
31784
+
31785
+ this.ReloadResource=function(resource)
31785
31786
  {
31786
- if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
31787
+ this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
31788
+ this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
31789
+ this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
31790
+ }
31787
31791
 
31792
+ this.CalculateSize=function()
31793
+ {
31794
+ var border=this.ChartFrame.GetBorder();
31795
+ var pixelRatio=GetDevicePixelRatio();
31796
+ this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
31797
+ this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
31788
31798
 
31789
31799
 
31790
- let left=this.ChartBorder.GetLeft();
31791
- let right=this.ChartBorder.GetRight();
31792
- let top=this.ChartBorder.GetTop();
31793
- let bottom=this.ChartBorder.GetBottom();
31794
- let width=this.ChartBorder.GetWidth();
31795
- let height=this.ChartBorder.GetHeight();
31800
+ this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
31796
31801
 
31797
- if(isNaN(this.Radius)){
31798
- let str = this.Radius.replace("%","");
31799
- str = str/100;
31800
- if(width >= height){
31801
- this.Radius = str*height;
31802
- }
31803
- if(width < height) this.Radius = str*width;
31802
+ this.RectClient.Right=border.Right+this.Offset.X;
31803
+ this.RectClient.Top=border.TopEx+this.Offset.Y;
31804
+ this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
31805
+ this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
31806
+ }
31807
+
31808
+ this.CalculateTotalValue=function()
31809
+ {
31810
+ var totalValue=0;
31811
+ for(var i=0; i<this.Data.Data.length; ++i)
31812
+ {
31813
+ var item=this.Data.Data[i];
31814
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
31815
+ totalValue += item.Value;
31804
31816
  }
31805
31817
 
31818
+ this.TotalValue=totalValue;
31819
+ }
31806
31820
 
31807
- this.Canvas.save();
31808
- this.Canvas.translate(width/2,height/2);
31821
+ this.DrawPie=function()
31822
+ {
31823
+ this.Canvas.font=this.TextFont;
31824
+ this.Canvas.textBaseline='bottom';
31825
+ this.Canvas.textAlign = 'left';
31809
31826
 
31810
- let totalValue=0; //求和
31811
- for(let i in this.Data.Data)
31827
+ var aryText=[];
31828
+ var maxTextWidth=0;
31829
+ for(var i=0;i<this.Data.Data.length;++i)
31812
31830
  {
31813
- totalValue += this.Data.Data[i].Value;
31831
+ var item=this.Data.Data[i];
31832
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
31833
+ if (!item.Text) continue;
31834
+ var textWidth=this.Canvas.measureText(item.Text).width;
31835
+
31836
+ aryText[i]={ Width:textWidth };
31837
+
31838
+ if (maxTextWidth<textWidth) maxTextWidth=textWidth;
31814
31839
  }
31815
- let start = 0;
31816
- let end = 0;
31817
- //画饼图
31818
- for(let i in this.Data.Data)
31840
+
31841
+ var xOffset=maxTextWidth+this.LineExtendWidth;
31842
+ this.RectClient.Left-=xOffset;
31843
+ this.RectClient.Right-=xOffset;
31844
+
31845
+
31846
+ var start=0, end=0;
31847
+ var x=this.RectClient.Left+this.Radius;
31848
+ var y=this.RectClient.Top+this.Radius;
31849
+
31850
+ for(var i=0;i<this.Data.Data.length;++i)
31819
31851
  {
31820
- let item =this.Data.Data[i];
31821
- let rate=(item.Value/totalValue).toFixed(2); //占比
31822
- //JSConsole.Chart.Log('[ChartPie::Draw]', i, rate, item);
31852
+ var item=this.Data.Data[i];
31853
+ if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
31854
+
31855
+ var rate=item.Value/this.TotalValue;
31823
31856
 
31824
31857
  // 绘制扇形
31825
31858
  this.Canvas.beginPath();
31826
- this.Canvas.moveTo(0,0);
31827
-
31859
+ this.Canvas.moveTo(x,y);
31860
+
31828
31861
  end += rate*2*Math.PI;//终止角度
31829
- this.Canvas.strokeStyle = "white";
31862
+ this.Canvas.strokeStyle = this.BorderColor;
31830
31863
  this.Canvas.fillStyle = item.Color;
31831
- this.Canvas.arc(0,0,this.Radius,start,end);
31864
+ this.Canvas.arc(x,y,this.Radius,start,end);
31832
31865
  this.Canvas.fill();
31833
31866
  this.Canvas.closePath();
31834
- this.Canvas.stroke();
31835
-
31836
- // 绘制直线
31837
- this.Canvas.beginPath();
31838
- this.Canvas.strokeStyle = item.Color;
31839
- this.Canvas.moveTo(0,0);
31840
- let x = (this.Radius + this.Distance)*Math.cos(end- (end-start)/2);
31841
- let y = (this.Radius + this.Distance)*Math.sin(end - (end-start)/2);
31842
- this.Canvas.lineTo(x,y);
31843
- // JSConsole.Chart.Log(x,y,"xy")
31844
-
31845
- // 绘制横线
31846
- let txtLine = this.txtLine;
31847
- let paddingX = this.paddingX;
31848
- this.Canvas.textAlign = 'left';
31849
- if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI ){
31850
-
31851
- txtLine = - this.txtLine;
31852
- paddingX = - this.paddingX;
31853
- this.Canvas.textAlign = 'right';
31854
- }
31855
- this.Canvas.lineTo( x + txtLine, y );
31856
31867
  this.Canvas.stroke();
31857
31868
 
31858
- // 写文字
31859
- if(item.Text){
31860
- this.Canvas.fillText( item.Text, x + txtLine + paddingX, y );
31861
- }else{
31862
- let text = `${item.Name}:${item.Value}`;
31863
- this.Canvas.fillText( text, x + txtLine + paddingX, y );
31864
- }
31865
-
31869
+ if (item.Text)
31870
+ {
31871
+ // 绘制直线
31872
+ var xLine=this.Radius*Math.cos(end- (end-start)/2)+x;
31873
+ var yLine=this.Radius*Math.sin(end - (end-start)/2)+y;
31874
+ var xEnd = (this.Radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
31875
+ var yEnd = (this.Radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
31876
+
31877
+ this.Canvas.beginPath();
31878
+ if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
31879
+ else this.Canvas.strokeStyle = item.Color;
31880
+ this.Canvas.moveTo(xLine,yLine);
31881
+ this.Canvas.lineTo(xEnd,yEnd);
31882
+
31883
+ var textWidth=aryText[i].Width;
31884
+ var yText=xEnd;
31885
+ if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
31886
+ {
31887
+ this.Canvas.lineTo( xEnd - textWidth, yEnd );
31888
+ yText=xEnd - textWidth;
31889
+ }
31890
+ else
31891
+ {
31892
+ this.Canvas.lineTo( xEnd + textWidth, yEnd );
31893
+ }
31894
+ this.Canvas.stroke();
31895
+
31896
+ if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
31897
+ else this.Canvas.fillStyle=item.Color;
31898
+ this.Canvas.fillText(item.Text, yText, yEnd);
31899
+ }
31866
31900
 
31867
31901
  start += rate*2*Math.PI;//起始角度
31868
31902
  }
31903
+ }
31904
+
31905
+ this.Draw=function()
31906
+ {
31907
+ if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
31908
+
31909
+ this.CalculateTotalValue();
31910
+ if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
31911
+ this.CalculateSize();
31912
+
31913
+ this.Canvas.save();
31914
+
31915
+ this.DrawPie();
31869
31916
 
31870
31917
  this.Canvas.restore();
31871
31918
  }
@@ -31873,7 +31920,7 @@ function ChartPie()
31873
31920
  //空数据
31874
31921
  this.DrawEmptyData=function()
31875
31922
  {
31876
- JSConsole.Chart.Log('[ChartPie::DrawEmptyData]')
31923
+ JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
31877
31924
  }
31878
31925
 
31879
31926
  this.GetMaxMin=function()
@@ -36439,6 +36486,7 @@ function ChartMinutePriceLine()
36439
36486
  var pointCount=0;
36440
36487
 
36441
36488
  this.Canvas.save();
36489
+ this.ClipClient(isHScreen);
36442
36490
  if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
36443
36491
  for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
36444
36492
  {
@@ -39944,8 +39992,8 @@ function ChartTextLine()
39944
39992
 
39945
39993
  this.ClassName="ChartTextLine";
39946
39994
 
39947
- this.Text; //Text=内容 Color
39948
- this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
39995
+ this.Text; //{ Title:内容, Color: YOffset:, }
39996
+ this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
39949
39997
  this.Price;
39950
39998
 
39951
39999
  this.Draw=function()
@@ -39959,6 +40007,10 @@ function ChartTextLine()
39959
40007
  var bottom=this.ChartBorder.GetBottomEx();
39960
40008
  var top=this.ChartBorder.GetTopEx();
39961
40009
  var y=this.ChartFrame.GetYFromData(this.Price);
40010
+
40011
+ this.Canvas.save();
40012
+ this.ClipClient(this.IsHScreen);
40013
+
39962
40014
  var textWidth=0;
39963
40015
  if (this.Text.Title)
39964
40016
  {
@@ -39988,23 +40040,22 @@ function ChartTextLine()
39988
40040
  {
39989
40041
  if (this.Line.Type==2) //虚线
39990
40042
  {
39991
- this.Canvas.save();
39992
- this.Canvas.setLineDash([3,5]); //虚线
40043
+ if (IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash)) this.Canvas.setLineDash(this.Line.LineDash)
40044
+ else this.Canvas.setLineDash([3,5]); //虚线
39993
40045
  }
39994
40046
 
40047
+ if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
40048
+
39995
40049
  var x=left+textWidth;
39996
40050
  this.Canvas.strokeStyle=this.Line.Color;
39997
40051
  this.Canvas.beginPath();
39998
40052
  this.Canvas.moveTo(x,ToFixedPoint(y));
39999
40053
  this.Canvas.lineTo(right,ToFixedPoint(y));
40000
40054
  this.Canvas.stroke();
40001
-
40002
- if (this.Line.Type==2)
40003
- {
40004
- this.Canvas.restore();
40005
- }
40006
40055
  }
40007
40056
 
40057
+
40058
+ this.Canvas.restore();
40008
40059
  }
40009
40060
 
40010
40061
  this.GetMaxMin=function()
@@ -70493,6 +70544,13 @@ function JSChartResource()
70493
70544
  BorderColor:"rgb(217,217,217)",
70494
70545
  }
70495
70546
 
70547
+ this.ChartSimplePie=
70548
+ {
70549
+ TextFont:{ Family:'微软雅黑' , Size:12 },
70550
+ BorderColor:"rgb(169,169,169)",
70551
+ Offset:{ X:-5, Y:5 }
70552
+ }
70553
+
70496
70554
  //手机端tooltip
70497
70555
  this.TooltipPaint = {
70498
70556
  BGColor:'rgba(250,250,250,0.8)', //背景色
@@ -71722,6 +71780,7 @@ function JSChartResource()
71722
71780
  }
71723
71781
 
71724
71782
  if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
71783
+ if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
71725
71784
 
71726
71785
  if (style.DRAWICON)
71727
71786
  {
@@ -72794,6 +72853,27 @@ function JSChartResource()
72794
72853
  }
72795
72854
  }
72796
72855
 
72856
+ this.SetChartSimplePie=function(style)
72857
+ {
72858
+ var dest=this.ChartSimplePie;
72859
+
72860
+ if (style.TextFont)
72861
+ {
72862
+ var item=style.TextFont;
72863
+ if (item.Name) dest.TextFont.Name=item.Name;
72864
+ if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
72865
+ }
72866
+
72867
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
72868
+
72869
+ if (style.Offset)
72870
+ {
72871
+ var item=style.Offset;
72872
+ if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
72873
+ if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
72874
+ }
72875
+ }
72876
+
72797
72877
  }
72798
72878
 
72799
72879
  var g_JSChartResource=new JSChartResource();
@@ -541,6 +541,11 @@ function GetBlackStyle()
541
541
  BorderColor:"rgb(90,90,90)",
542
542
  },
543
543
 
544
+ ChartSimplePie:
545
+ {
546
+ BorderColor:"rgb(220,220,220)",
547
+ },
548
+
544
549
  ChartDrawVolProfile:
545
550
  {
546
551
  BGColor:"rgba(244,250,254,0.3)",