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/lib/umychart.vue.js +196 -201
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +64 -3
- package/src/jscommon/umychart.complier.js +98 -1
- package/src/jscommon/umychart.js +161 -81
- package/src/jscommon/umychart.style.js +5 -0
- package/src/jscommon/umychart.testdata.js +64 -3
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +265 -83
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +64 -3
- package/src/jscommon/umychart.vue/umychart.vue.js +265 -83
|
@@ -55763,7 +55763,7 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
55763
55763
|
}
|
|
55764
55764
|
*/
|
|
55765
55765
|
|
|
55766
|
-
stockItem.minute.length=50;
|
|
55766
|
+
//stockItem.minute.length=50;
|
|
55767
55767
|
|
|
55768
55768
|
var hqchartData={code:0, stock:[stockItem] };
|
|
55769
55769
|
|
|
@@ -57392,6 +57392,9 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57392
57392
|
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
57393
57393
|
else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
|
|
57394
57394
|
HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
|
|
57395
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
|
|
57396
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
|
|
57397
|
+
|
|
57395
57398
|
}
|
|
57396
57399
|
|
|
57397
57400
|
|
|
@@ -57796,8 +57799,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
57796
57799
|
DrawData:
|
|
57797
57800
|
{
|
|
57798
57801
|
Price:price,
|
|
57799
|
-
Text:
|
|
57800
|
-
|
|
57802
|
+
Text:
|
|
57803
|
+
{
|
|
57804
|
+
Title:`价格:${price.toFixed(2)}`,
|
|
57805
|
+
Color:"rgb(255, 165, 0)",
|
|
57806
|
+
},
|
|
57807
|
+
|
|
57808
|
+
Line:
|
|
57809
|
+
{
|
|
57810
|
+
Type:1, //Type 0=不画 1=直线 2=虚线
|
|
57811
|
+
//LineDash:[10,10],
|
|
57812
|
+
Color:"rgb(200,200,0)",
|
|
57813
|
+
//Width:1,
|
|
57814
|
+
},
|
|
57801
57815
|
}
|
|
57802
57816
|
}
|
|
57803
57817
|
};
|
|
@@ -57859,6 +57873,53 @@ HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
|
|
|
57859
57873
|
}
|
|
57860
57874
|
|
|
57861
57875
|
|
|
57876
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
|
|
57877
|
+
{
|
|
57878
|
+
data.PreventDefault=true;
|
|
57879
|
+
var hqchart=data.HQChart;
|
|
57880
|
+
var kData=hqchart.GetKData();
|
|
57881
|
+
|
|
57882
|
+
var tableData=
|
|
57883
|
+
{
|
|
57884
|
+
name:'DRAW_SIMPLE_PIE', type:1,
|
|
57885
|
+
Draw:
|
|
57886
|
+
{
|
|
57887
|
+
DrawType:'DRAW_SIMPLE_PIE',
|
|
57888
|
+
DrawData:
|
|
57889
|
+
{
|
|
57890
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
57891
|
+
//BorderColor:"rgb(110,110,110)",
|
|
57892
|
+
//TextColor:"rgb(0,191,255)",
|
|
57893
|
+
Data:
|
|
57894
|
+
[
|
|
57895
|
+
{ Value:10, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
|
|
57896
|
+
{ Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
|
|
57897
|
+
{ Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
|
|
57898
|
+
{ Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
|
|
57899
|
+
{ Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
|
|
57900
|
+
],
|
|
57901
|
+
|
|
57902
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
57903
|
+
//XOffset:-10,
|
|
57904
|
+
//YOffset:-15,
|
|
57905
|
+
Radius:80,
|
|
57906
|
+
}
|
|
57907
|
+
}
|
|
57908
|
+
};
|
|
57909
|
+
|
|
57910
|
+
var apiData=
|
|
57911
|
+
{
|
|
57912
|
+
code:0,
|
|
57913
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57914
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
57915
|
+
};
|
|
57916
|
+
|
|
57917
|
+
|
|
57918
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
|
|
57919
|
+
callback(apiData);
|
|
57920
|
+
}
|
|
57921
|
+
|
|
57922
|
+
|
|
57862
57923
|
|
|
57863
57924
|
|
|
57864
57925
|
/*暴露外部用的方法*/
|
|
@@ -35732,109 +35732,156 @@ function ChartSimpleTable()
|
|
|
35732
35732
|
|
|
35733
35733
|
|
|
35734
35734
|
//饼图
|
|
35735
|
-
function
|
|
35735
|
+
function ChartSimplePie()
|
|
35736
35736
|
{
|
|
35737
35737
|
this.newMethod=IChartPainting; //派生
|
|
35738
35738
|
this.newMethod();
|
|
35739
35739
|
delete this.newMethod;
|
|
35740
35740
|
|
|
35741
|
-
this.
|
|
35742
|
-
this.Width=40;
|
|
35743
|
-
this.Height=50;
|
|
35744
|
-
|
|
35745
|
-
//this.Distance = 30; //指示线超出圆饼的距离
|
|
35746
|
-
//this.txtLine = 20; // 文本下划线
|
|
35747
|
-
//this.paddingX = 20 / 3;// 设置文本的移动
|
|
35748
|
-
|
|
35741
|
+
this.ClassName='ChartSimplePie'; //类名
|
|
35749
35742
|
|
|
35743
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
35744
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
35745
|
+
this.LineExtendWidth=10;
|
|
35746
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
35750
35747
|
|
|
35751
35748
|
this.RectClient={ };
|
|
35752
|
-
|
|
35753
|
-
this.
|
|
35749
|
+
this.TotalValue=1;
|
|
35750
|
+
this.Radius = 50; //半径默认值
|
|
35751
|
+
this.TextFont;
|
|
35752
|
+
|
|
35753
|
+
|
|
35754
|
+
this.ReloadResource=function(resource)
|
|
35754
35755
|
{
|
|
35755
|
-
|
|
35756
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
35757
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
35758
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
35759
|
+
}
|
|
35756
35760
|
|
|
35761
|
+
this.CalculateSize=function()
|
|
35762
|
+
{
|
|
35763
|
+
var border=this.ChartFrame.GetBorder();
|
|
35764
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
35765
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
35766
|
+
this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
|
|
35757
35767
|
|
|
35758
35768
|
|
|
35759
|
-
|
|
35760
|
-
let right=this.ChartBorder.GetRight();
|
|
35761
|
-
let top=this.ChartBorder.GetTop();
|
|
35762
|
-
let bottom=this.ChartBorder.GetBottom();
|
|
35763
|
-
let width=this.ChartBorder.GetWidth();
|
|
35764
|
-
let height=this.ChartBorder.GetHeight();
|
|
35769
|
+
this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
|
|
35765
35770
|
|
|
35766
|
-
|
|
35767
|
-
|
|
35768
|
-
|
|
35769
|
-
|
|
35770
|
-
|
|
35771
|
-
|
|
35772
|
-
|
|
35771
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
35772
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
35773
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
35774
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
35775
|
+
}
|
|
35776
|
+
|
|
35777
|
+
this.CalculateTotalValue=function()
|
|
35778
|
+
{
|
|
35779
|
+
var totalValue=0;
|
|
35780
|
+
for(var i=0; i<this.Data.Data.length; ++i)
|
|
35781
|
+
{
|
|
35782
|
+
var item=this.Data.Data[i];
|
|
35783
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35784
|
+
totalValue += item.Value;
|
|
35773
35785
|
}
|
|
35774
35786
|
|
|
35787
|
+
this.TotalValue=totalValue;
|
|
35788
|
+
}
|
|
35775
35789
|
|
|
35776
|
-
|
|
35777
|
-
|
|
35790
|
+
this.DrawPie=function()
|
|
35791
|
+
{
|
|
35792
|
+
this.Canvas.font=this.TextFont;
|
|
35793
|
+
this.Canvas.textBaseline='bottom';
|
|
35794
|
+
this.Canvas.textAlign = 'left';
|
|
35778
35795
|
|
|
35779
|
-
|
|
35780
|
-
|
|
35796
|
+
var aryText=[];
|
|
35797
|
+
var maxTextWidth=0;
|
|
35798
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
35781
35799
|
{
|
|
35782
|
-
|
|
35800
|
+
var item=this.Data.Data[i];
|
|
35801
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35802
|
+
if (!item.Text) continue;
|
|
35803
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35804
|
+
|
|
35805
|
+
aryText[i]={ Width:textWidth };
|
|
35806
|
+
|
|
35807
|
+
if (maxTextWidth<textWidth) maxTextWidth=textWidth;
|
|
35783
35808
|
}
|
|
35784
|
-
|
|
35785
|
-
|
|
35786
|
-
|
|
35787
|
-
|
|
35809
|
+
|
|
35810
|
+
var xOffset=maxTextWidth+this.LineExtendWidth;
|
|
35811
|
+
this.RectClient.Left-=xOffset;
|
|
35812
|
+
this.RectClient.Right-=xOffset;
|
|
35813
|
+
|
|
35814
|
+
|
|
35815
|
+
var start=0, end=0;
|
|
35816
|
+
var x=this.RectClient.Left+this.Radius;
|
|
35817
|
+
var y=this.RectClient.Top+this.Radius;
|
|
35818
|
+
|
|
35819
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
35788
35820
|
{
|
|
35789
|
-
|
|
35790
|
-
|
|
35791
|
-
|
|
35821
|
+
var item=this.Data.Data[i];
|
|
35822
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35823
|
+
|
|
35824
|
+
var rate=item.Value/this.TotalValue;
|
|
35792
35825
|
|
|
35793
35826
|
// 绘制扇形
|
|
35794
35827
|
this.Canvas.beginPath();
|
|
35795
|
-
this.Canvas.moveTo(
|
|
35796
|
-
|
|
35828
|
+
this.Canvas.moveTo(x,y);
|
|
35829
|
+
|
|
35797
35830
|
end += rate*2*Math.PI;//终止角度
|
|
35798
|
-
this.Canvas.strokeStyle =
|
|
35831
|
+
this.Canvas.strokeStyle = this.BorderColor;
|
|
35799
35832
|
this.Canvas.fillStyle = item.Color;
|
|
35800
|
-
this.Canvas.arc(
|
|
35833
|
+
this.Canvas.arc(x,y,this.Radius,start,end);
|
|
35801
35834
|
this.Canvas.fill();
|
|
35802
35835
|
this.Canvas.closePath();
|
|
35803
|
-
this.Canvas.stroke();
|
|
35804
|
-
|
|
35805
|
-
// 绘制直线
|
|
35806
|
-
this.Canvas.beginPath();
|
|
35807
|
-
this.Canvas.strokeStyle = item.Color;
|
|
35808
|
-
this.Canvas.moveTo(0,0);
|
|
35809
|
-
let x = (this.Radius + this.Distance)*Math.cos(end- (end-start)/2);
|
|
35810
|
-
let y = (this.Radius + this.Distance)*Math.sin(end - (end-start)/2);
|
|
35811
|
-
this.Canvas.lineTo(x,y);
|
|
35812
|
-
// JSConsole.Chart.Log(x,y,"xy")
|
|
35813
|
-
|
|
35814
|
-
// 绘制横线
|
|
35815
|
-
let txtLine = this.txtLine;
|
|
35816
|
-
let paddingX = this.paddingX;
|
|
35817
|
-
this.Canvas.textAlign = 'left';
|
|
35818
|
-
if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI ){
|
|
35819
|
-
|
|
35820
|
-
txtLine = - this.txtLine;
|
|
35821
|
-
paddingX = - this.paddingX;
|
|
35822
|
-
this.Canvas.textAlign = 'right';
|
|
35823
|
-
}
|
|
35824
|
-
this.Canvas.lineTo( x + txtLine, y );
|
|
35825
35836
|
this.Canvas.stroke();
|
|
35826
35837
|
|
|
35827
|
-
|
|
35828
|
-
|
|
35829
|
-
|
|
35830
|
-
|
|
35831
|
-
|
|
35832
|
-
|
|
35833
|
-
|
|
35834
|
-
|
|
35838
|
+
if (item.Text)
|
|
35839
|
+
{
|
|
35840
|
+
// 绘制直线
|
|
35841
|
+
var xLine=this.Radius*Math.cos(end- (end-start)/2)+x;
|
|
35842
|
+
var yLine=this.Radius*Math.sin(end - (end-start)/2)+y;
|
|
35843
|
+
var xEnd = (this.Radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
|
|
35844
|
+
var yEnd = (this.Radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
|
|
35845
|
+
|
|
35846
|
+
this.Canvas.beginPath();
|
|
35847
|
+
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
35848
|
+
else this.Canvas.strokeStyle = item.Color;
|
|
35849
|
+
this.Canvas.moveTo(xLine,yLine);
|
|
35850
|
+
this.Canvas.lineTo(xEnd,yEnd);
|
|
35851
|
+
|
|
35852
|
+
var textWidth=aryText[i].Width;
|
|
35853
|
+
var yText=xEnd;
|
|
35854
|
+
if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
|
|
35855
|
+
{
|
|
35856
|
+
this.Canvas.lineTo( xEnd - textWidth, yEnd );
|
|
35857
|
+
yText=xEnd - textWidth;
|
|
35858
|
+
}
|
|
35859
|
+
else
|
|
35860
|
+
{
|
|
35861
|
+
this.Canvas.lineTo( xEnd + textWidth, yEnd );
|
|
35862
|
+
}
|
|
35863
|
+
this.Canvas.stroke();
|
|
35864
|
+
|
|
35865
|
+
if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
|
|
35866
|
+
else this.Canvas.fillStyle=item.Color;
|
|
35867
|
+
this.Canvas.fillText(item.Text, yText, yEnd);
|
|
35868
|
+
}
|
|
35835
35869
|
|
|
35836
35870
|
start += rate*2*Math.PI;//起始角度
|
|
35837
35871
|
}
|
|
35872
|
+
}
|
|
35873
|
+
|
|
35874
|
+
this.Draw=function()
|
|
35875
|
+
{
|
|
35876
|
+
if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
|
|
35877
|
+
|
|
35878
|
+
this.CalculateTotalValue();
|
|
35879
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
|
|
35880
|
+
this.CalculateSize();
|
|
35881
|
+
|
|
35882
|
+
this.Canvas.save();
|
|
35883
|
+
|
|
35884
|
+
this.DrawPie();
|
|
35838
35885
|
|
|
35839
35886
|
this.Canvas.restore();
|
|
35840
35887
|
}
|
|
@@ -35842,7 +35889,7 @@ function ChartPie()
|
|
|
35842
35889
|
//空数据
|
|
35843
35890
|
this.DrawEmptyData=function()
|
|
35844
35891
|
{
|
|
35845
|
-
JSConsole.Chart.Log('[
|
|
35892
|
+
JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
|
|
35846
35893
|
}
|
|
35847
35894
|
|
|
35848
35895
|
this.GetMaxMin=function()
|
|
@@ -40408,6 +40455,7 @@ function ChartMinutePriceLine()
|
|
|
40408
40455
|
var pointCount=0;
|
|
40409
40456
|
|
|
40410
40457
|
this.Canvas.save();
|
|
40458
|
+
this.ClipClient(isHScreen);
|
|
40411
40459
|
if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
|
|
40412
40460
|
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
40413
40461
|
{
|
|
@@ -43913,8 +43961,8 @@ function ChartTextLine()
|
|
|
43913
43961
|
|
|
43914
43962
|
this.ClassName="ChartTextLine";
|
|
43915
43963
|
|
|
43916
|
-
this.Text; //
|
|
43917
|
-
this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
|
|
43964
|
+
this.Text; //{ Title:内容, Color: YOffset:, }
|
|
43965
|
+
this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
|
|
43918
43966
|
this.Price;
|
|
43919
43967
|
|
|
43920
43968
|
this.Draw=function()
|
|
@@ -43928,6 +43976,10 @@ function ChartTextLine()
|
|
|
43928
43976
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
43929
43977
|
var top=this.ChartBorder.GetTopEx();
|
|
43930
43978
|
var y=this.ChartFrame.GetYFromData(this.Price);
|
|
43979
|
+
|
|
43980
|
+
this.Canvas.save();
|
|
43981
|
+
this.ClipClient(this.IsHScreen);
|
|
43982
|
+
|
|
43931
43983
|
var textWidth=0;
|
|
43932
43984
|
if (this.Text.Title)
|
|
43933
43985
|
{
|
|
@@ -43957,23 +44009,22 @@ function ChartTextLine()
|
|
|
43957
44009
|
{
|
|
43958
44010
|
if (this.Line.Type==2) //虚线
|
|
43959
44011
|
{
|
|
43960
|
-
this.Canvas.
|
|
43961
|
-
this.Canvas.setLineDash([3,5]); //虚线
|
|
44012
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash)) this.Canvas.setLineDash(this.Line.LineDash)
|
|
44013
|
+
else this.Canvas.setLineDash([3,5]); //虚线
|
|
43962
44014
|
}
|
|
43963
44015
|
|
|
44016
|
+
if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
|
|
44017
|
+
|
|
43964
44018
|
var x=left+textWidth;
|
|
43965
44019
|
this.Canvas.strokeStyle=this.Line.Color;
|
|
43966
44020
|
this.Canvas.beginPath();
|
|
43967
44021
|
this.Canvas.moveTo(x,ToFixedPoint(y));
|
|
43968
44022
|
this.Canvas.lineTo(right,ToFixedPoint(y));
|
|
43969
44023
|
this.Canvas.stroke();
|
|
43970
|
-
|
|
43971
|
-
if (this.Line.Type==2)
|
|
43972
|
-
{
|
|
43973
|
-
this.Canvas.restore();
|
|
43974
|
-
}
|
|
43975
44024
|
}
|
|
43976
44025
|
|
|
44026
|
+
|
|
44027
|
+
this.Canvas.restore();
|
|
43977
44028
|
}
|
|
43978
44029
|
|
|
43979
44030
|
this.GetMaxMin=function()
|
|
@@ -74462,6 +74513,13 @@ function JSChartResource()
|
|
|
74462
74513
|
BorderColor:"rgb(217,217,217)",
|
|
74463
74514
|
}
|
|
74464
74515
|
|
|
74516
|
+
this.ChartSimplePie=
|
|
74517
|
+
{
|
|
74518
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
74519
|
+
BorderColor:"rgb(169,169,169)",
|
|
74520
|
+
Offset:{ X:-5, Y:5 }
|
|
74521
|
+
}
|
|
74522
|
+
|
|
74465
74523
|
//手机端tooltip
|
|
74466
74524
|
this.TooltipPaint = {
|
|
74467
74525
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -75691,6 +75749,7 @@ function JSChartResource()
|
|
|
75691
75749
|
}
|
|
75692
75750
|
|
|
75693
75751
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
75752
|
+
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
75694
75753
|
|
|
75695
75754
|
if (style.DRAWICON)
|
|
75696
75755
|
{
|
|
@@ -76763,6 +76822,27 @@ function JSChartResource()
|
|
|
76763
76822
|
}
|
|
76764
76823
|
}
|
|
76765
76824
|
|
|
76825
|
+
this.SetChartSimplePie=function(style)
|
|
76826
|
+
{
|
|
76827
|
+
var dest=this.ChartSimplePie;
|
|
76828
|
+
|
|
76829
|
+
if (style.TextFont)
|
|
76830
|
+
{
|
|
76831
|
+
var item=style.TextFont;
|
|
76832
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
76833
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
76834
|
+
}
|
|
76835
|
+
|
|
76836
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
76837
|
+
|
|
76838
|
+
if (style.Offset)
|
|
76839
|
+
{
|
|
76840
|
+
var item=style.Offset;
|
|
76841
|
+
if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
|
|
76842
|
+
if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
|
|
76843
|
+
}
|
|
76844
|
+
}
|
|
76845
|
+
|
|
76766
76846
|
}
|
|
76767
76847
|
|
|
76768
76848
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -111992,6 +112072,30 @@ function JSDraw(errorHandler,symbolData)
|
|
|
111992
112072
|
|
|
111993
112073
|
return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
|
|
111994
112074
|
}
|
|
112075
|
+
|
|
112076
|
+
//饼图
|
|
112077
|
+
this.PIE_CELL=function(value, color, text, textColor, lineColor)
|
|
112078
|
+
{
|
|
112079
|
+
var cellItem={ Value:value, Color:color };
|
|
112080
|
+
if (text) cellItem.Text=text;
|
|
112081
|
+
if (textColor) cellItem.TextColor=textColor;
|
|
112082
|
+
if (lineColor) cellItem.LineColor=lineColor;
|
|
112083
|
+
|
|
112084
|
+
return cellItem
|
|
112085
|
+
}
|
|
112086
|
+
|
|
112087
|
+
//0=Radius半径
|
|
112088
|
+
this.DRAWPIE=function(aryData)
|
|
112089
|
+
{
|
|
112090
|
+
var radius=aryData[0];
|
|
112091
|
+
var aryCell=[];
|
|
112092
|
+
for(var i=1;i<aryData.length;++i)
|
|
112093
|
+
{
|
|
112094
|
+
aryCell.push(aryData[i]);
|
|
112095
|
+
}
|
|
112096
|
+
|
|
112097
|
+
return result={ DrawData:{ Data:aryCell, Radius:radius }, DrawType:"DRAW_SIMPLE_PIE" };
|
|
112098
|
+
}
|
|
111995
112099
|
}
|
|
111996
112100
|
|
|
111997
112101
|
|
|
@@ -112046,7 +112150,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
112046
112150
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
112047
112151
|
"VERTLINE","HORLINE","TIPICON",
|
|
112048
112152
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
112049
|
-
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
|
|
112153
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
|
|
112050
112154
|
]);
|
|
112051
112155
|
if (setFunctionName.has(name)) return true;
|
|
112052
112156
|
|
|
@@ -118927,6 +119031,14 @@ function JSExecute(ast,option)
|
|
|
118927
119031
|
node.Draw=this.Draw.DRAWTABLE(args);
|
|
118928
119032
|
node.Out=[];
|
|
118929
119033
|
break;
|
|
119034
|
+
//饼图
|
|
119035
|
+
case "PIE_CELL":
|
|
119036
|
+
node.Out=this.Draw.PIE_CELL(args[0],args[1],args[2],args[3],args[4]);
|
|
119037
|
+
break;
|
|
119038
|
+
case "DRAWPIE":
|
|
119039
|
+
node.Draw=this.Draw.DRAWPIE(args);
|
|
119040
|
+
node.Out=[];
|
|
119041
|
+
break;
|
|
118930
119042
|
|
|
118931
119043
|
default:
|
|
118932
119044
|
node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
|
|
@@ -121920,6 +122032,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
121920
122032
|
hqChart.ChartPaint.push(chart);
|
|
121921
122033
|
}
|
|
121922
122034
|
|
|
122035
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
122036
|
+
{
|
|
122037
|
+
var chart=new ChartSimplePie();
|
|
122038
|
+
chart.Canvas=hqChart.Canvas;
|
|
122039
|
+
chart.Name=varItem.Name;
|
|
122040
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
122041
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
122042
|
+
|
|
122043
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
122044
|
+
{
|
|
122045
|
+
var drawData=varItem.Draw.DrawData;
|
|
122046
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
122047
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
122048
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
122049
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
122050
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
122051
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
122052
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
122053
|
+
}
|
|
122054
|
+
|
|
122055
|
+
hqChart.ChartPaint.push(chart);
|
|
122056
|
+
}
|
|
122057
|
+
|
|
121923
122058
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
121924
122059
|
{
|
|
121925
122060
|
var chart=new ChartTradeIcon();
|
|
@@ -122788,6 +122923,8 @@ function ScriptIndex(name,script,args,option)
|
|
|
122788
122923
|
case "DRAW_SIMPLE_TABLE":
|
|
122789
122924
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122790
122925
|
break;
|
|
122926
|
+
case "DRAW_SIMPLE_PIE":
|
|
122927
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
122791
122928
|
case "BUY":
|
|
122792
122929
|
case "SELL":
|
|
122793
122930
|
case "SELLSHORT":
|
|
@@ -123138,6 +123275,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
123138
123275
|
case "DRAW_SIMPLE_TABLE":
|
|
123139
123276
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
123140
123277
|
break;
|
|
123278
|
+
case "DRAW_SIMPLE_PIE":
|
|
123279
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
123141
123280
|
|
|
123142
123281
|
case "KLINE_BG":
|
|
123143
123282
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
@@ -124175,6 +124314,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
124175
124314
|
frame.ChartPaint.push(chart);
|
|
124176
124315
|
}
|
|
124177
124316
|
|
|
124317
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
124318
|
+
{
|
|
124319
|
+
var overlayIndex=this.OverlayIndex;
|
|
124320
|
+
var frame=overlayIndex.Frame;
|
|
124321
|
+
var chart=new ChartSimplePie();
|
|
124322
|
+
chart.Canvas=hqChart.Canvas;
|
|
124323
|
+
chart.Name=varItem.Name;
|
|
124324
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
124325
|
+
chart.ChartFrame=frame.Frame;
|
|
124326
|
+
chart.Identify=overlayIndex.Identify;
|
|
124327
|
+
chart.HQChart=hqChart;
|
|
124328
|
+
|
|
124329
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
124330
|
+
{
|
|
124331
|
+
var drawData=varItem.Draw.DrawData;
|
|
124332
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
124333
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
124334
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
124335
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
124336
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
124337
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
124338
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
124339
|
+
}
|
|
124340
|
+
|
|
124341
|
+
frame.ChartPaint.push(chart);
|
|
124342
|
+
}
|
|
124343
|
+
|
|
124178
124344
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
124179
124345
|
{
|
|
124180
124346
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -125377,6 +125543,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
125377
125543
|
outVarItem.Draw=drawItem;
|
|
125378
125544
|
result.push(outVarItem);
|
|
125379
125545
|
}
|
|
125546
|
+
else if (draw.DrawType=="DRAW_SIMPLE_PIE")
|
|
125547
|
+
{
|
|
125548
|
+
drawItem.Name=draw.Name;
|
|
125549
|
+
drawItem.Type=draw.Type;
|
|
125550
|
+
|
|
125551
|
+
drawItem.DrawType=draw.DrawType;
|
|
125552
|
+
drawItem.DrawData=draw.DrawData; //{ Data:[ {Value, Color, Text: }, ], BorderColor:, TextFont:{ Size:, Name: } };
|
|
125553
|
+
|
|
125554
|
+
outVarItem.Draw=drawItem;
|
|
125555
|
+
result.push(outVarItem);
|
|
125556
|
+
}
|
|
125380
125557
|
else
|
|
125381
125558
|
{
|
|
125382
125559
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -126988,6 +127165,11 @@ function GetBlackStyle()
|
|
|
126988
127165
|
BorderColor:"rgb(90,90,90)",
|
|
126989
127166
|
},
|
|
126990
127167
|
|
|
127168
|
+
ChartSimplePie:
|
|
127169
|
+
{
|
|
127170
|
+
BorderColor:"rgb(220,220,220)",
|
|
127171
|
+
},
|
|
127172
|
+
|
|
126991
127173
|
ChartDrawVolProfile:
|
|
126992
127174
|
{
|
|
126993
127175
|
BGColor:"rgba(244,250,254,0.3)",
|
|
@@ -151127,7 +151309,7 @@ function HQChartScriptWorker()
|
|
|
151127
151309
|
|
|
151128
151310
|
|
|
151129
151311
|
|
|
151130
|
-
var HQCHART_VERSION="1.1.
|
|
151312
|
+
var HQCHART_VERSION="1.1.14304";
|
|
151131
151313
|
|
|
151132
151314
|
function PrintHQChartVersion()
|
|
151133
151315
|
{
|