hqchart 1.1.14295 → 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 +36 -22
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +111 -2
- package/src/jscommon/umychart.PopKeyboard.js +2 -2
- package/src/jscommon/umychart.complier.js +102 -1
- package/src/jscommon/umychart.js +211 -9
- package/src/jscommon/umychart.style.js +5 -0
- package/src/jscommon/umychart.testdata.js +111 -2
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +319 -11
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +111 -2
- package/src/jscommon/umychart.vue/umychart.vue.js +321 -13
|
@@ -55763,6 +55763,8 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
55763
55763
|
}
|
|
55764
55764
|
*/
|
|
55765
55765
|
|
|
55766
|
+
//stockItem.minute.length=50;
|
|
55767
|
+
|
|
55766
55768
|
var hqchartData={code:0, stock:[stockItem] };
|
|
55767
55769
|
|
|
55768
55770
|
|
|
@@ -57388,6 +57390,11 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57388
57390
|
HQData.APIIndex_MULTI_SVGICON(data, callback);
|
|
57389
57391
|
else if (request.Data.indexname=="API-DRAWTEXT_LINE")
|
|
57390
57392
|
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
57393
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
|
|
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
|
+
|
|
57391
57398
|
}
|
|
57392
57399
|
|
|
57393
57400
|
|
|
@@ -57792,8 +57799,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
57792
57799
|
DrawData:
|
|
57793
57800
|
{
|
|
57794
57801
|
Price:price,
|
|
57795
|
-
Text:
|
|
57796
|
-
|
|
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
|
+
},
|
|
57797
57815
|
}
|
|
57798
57816
|
}
|
|
57799
57817
|
};
|
|
@@ -57810,6 +57828,97 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
57810
57828
|
callback(apiData);
|
|
57811
57829
|
}
|
|
57812
57830
|
|
|
57831
|
+
HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
|
|
57832
|
+
{
|
|
57833
|
+
data.PreventDefault=true;
|
|
57834
|
+
var hqchart=data.HQChart;
|
|
57835
|
+
var kData=hqchart.GetKData();
|
|
57836
|
+
|
|
57837
|
+
var tableData=
|
|
57838
|
+
{
|
|
57839
|
+
name:'DRAW_SIMPLE_TABLE', type:1,
|
|
57840
|
+
Draw:
|
|
57841
|
+
{
|
|
57842
|
+
DrawType:'DRAW_SIMPLE_TABLE',
|
|
57843
|
+
DrawData:
|
|
57844
|
+
{
|
|
57845
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
57846
|
+
//BorderColor:"rgb(0,0,255)",
|
|
57847
|
+
//TextColor:"rgb(0,191,255)",
|
|
57848
|
+
TableData:
|
|
57849
|
+
[
|
|
57850
|
+
{ AryCell:[{ Text:"股票代码"}, { Text:"主营业务", TextAlign:'center'}, { Text:"每股收益(元)"}] },
|
|
57851
|
+
{ AryCell:[{ Text:"美丽生态"}, { Text:"园林绿化"}, { Text:"13.5", Color:"rgb(139,0,139)"}] },
|
|
57852
|
+
{ AryCell:[{ Text:"深物业A"}, { Text:"房地产及相关业务", BGColor:"rgb(200,200,200)"}, { Text:"0.12"}] },
|
|
57853
|
+
{ AryCell:[{ Text:"深科技"}, { Text:"计算机硬件、通讯设备等"}, { Text:"5.4"}] },
|
|
57854
|
+
],
|
|
57855
|
+
|
|
57856
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
57857
|
+
//XOffset:-10,
|
|
57858
|
+
//YOffset:-15,
|
|
57859
|
+
}
|
|
57860
|
+
}
|
|
57861
|
+
};
|
|
57862
|
+
|
|
57863
|
+
var apiData=
|
|
57864
|
+
{
|
|
57865
|
+
code:0,
|
|
57866
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57867
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
57868
|
+
};
|
|
57869
|
+
|
|
57870
|
+
|
|
57871
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_TABLE] apiData ', apiData);
|
|
57872
|
+
callback(apiData);
|
|
57873
|
+
}
|
|
57874
|
+
|
|
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
|
+
|
|
57813
57922
|
|
|
57814
57923
|
|
|
57815
57924
|
|
|
@@ -35730,6 +35730,174 @@ function ChartSimpleTable()
|
|
|
35730
35730
|
}
|
|
35731
35731
|
}
|
|
35732
35732
|
|
|
35733
|
+
|
|
35734
|
+
//饼图
|
|
35735
|
+
function ChartSimplePie()
|
|
35736
|
+
{
|
|
35737
|
+
this.newMethod=IChartPainting; //派生
|
|
35738
|
+
this.newMethod();
|
|
35739
|
+
delete this.newMethod;
|
|
35740
|
+
|
|
35741
|
+
this.ClassName='ChartSimplePie'; //类名
|
|
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);
|
|
35747
|
+
|
|
35748
|
+
this.RectClient={ };
|
|
35749
|
+
this.TotalValue=1;
|
|
35750
|
+
this.Radius = 50; //半径默认值
|
|
35751
|
+
this.TextFont;
|
|
35752
|
+
|
|
35753
|
+
|
|
35754
|
+
this.ReloadResource=function(resource)
|
|
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
|
+
}
|
|
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;
|
|
35767
|
+
|
|
35768
|
+
|
|
35769
|
+
this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
|
|
35770
|
+
|
|
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;
|
|
35785
|
+
}
|
|
35786
|
+
|
|
35787
|
+
this.TotalValue=totalValue;
|
|
35788
|
+
}
|
|
35789
|
+
|
|
35790
|
+
this.DrawPie=function()
|
|
35791
|
+
{
|
|
35792
|
+
this.Canvas.font=this.TextFont;
|
|
35793
|
+
this.Canvas.textBaseline='bottom';
|
|
35794
|
+
this.Canvas.textAlign = 'left';
|
|
35795
|
+
|
|
35796
|
+
var aryText=[];
|
|
35797
|
+
var maxTextWidth=0;
|
|
35798
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
35799
|
+
{
|
|
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;
|
|
35808
|
+
}
|
|
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)
|
|
35820
|
+
{
|
|
35821
|
+
var item=this.Data.Data[i];
|
|
35822
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35823
|
+
|
|
35824
|
+
var rate=item.Value/this.TotalValue;
|
|
35825
|
+
|
|
35826
|
+
// 绘制扇形
|
|
35827
|
+
this.Canvas.beginPath();
|
|
35828
|
+
this.Canvas.moveTo(x,y);
|
|
35829
|
+
|
|
35830
|
+
end += rate*2*Math.PI;//终止角度
|
|
35831
|
+
this.Canvas.strokeStyle = this.BorderColor;
|
|
35832
|
+
this.Canvas.fillStyle = item.Color;
|
|
35833
|
+
this.Canvas.arc(x,y,this.Radius,start,end);
|
|
35834
|
+
this.Canvas.fill();
|
|
35835
|
+
this.Canvas.closePath();
|
|
35836
|
+
this.Canvas.stroke();
|
|
35837
|
+
|
|
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
|
+
}
|
|
35869
|
+
|
|
35870
|
+
start += rate*2*Math.PI;//起始角度
|
|
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();
|
|
35885
|
+
|
|
35886
|
+
this.Canvas.restore();
|
|
35887
|
+
}
|
|
35888
|
+
|
|
35889
|
+
//空数据
|
|
35890
|
+
this.DrawEmptyData=function()
|
|
35891
|
+
{
|
|
35892
|
+
JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
|
|
35893
|
+
}
|
|
35894
|
+
|
|
35895
|
+
this.GetMaxMin=function()
|
|
35896
|
+
{
|
|
35897
|
+
return { Min:null, Max:null };
|
|
35898
|
+
}
|
|
35899
|
+
}
|
|
35900
|
+
|
|
35733
35901
|
//分钟成交量 支持横屏
|
|
35734
35902
|
function ChartMinuteVolumBar()
|
|
35735
35903
|
{
|
|
@@ -40287,6 +40455,7 @@ function ChartMinutePriceLine()
|
|
|
40287
40455
|
var pointCount=0;
|
|
40288
40456
|
|
|
40289
40457
|
this.Canvas.save();
|
|
40458
|
+
this.ClipClient(isHScreen);
|
|
40290
40459
|
if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
|
|
40291
40460
|
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
40292
40461
|
{
|
|
@@ -43792,8 +43961,8 @@ function ChartTextLine()
|
|
|
43792
43961
|
|
|
43793
43962
|
this.ClassName="ChartTextLine";
|
|
43794
43963
|
|
|
43795
|
-
this.Text; //
|
|
43796
|
-
this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
|
|
43964
|
+
this.Text; //{ Title:内容, Color: YOffset:, }
|
|
43965
|
+
this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
|
|
43797
43966
|
this.Price;
|
|
43798
43967
|
|
|
43799
43968
|
this.Draw=function()
|
|
@@ -43807,6 +43976,10 @@ function ChartTextLine()
|
|
|
43807
43976
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
43808
43977
|
var top=this.ChartBorder.GetTopEx();
|
|
43809
43978
|
var y=this.ChartFrame.GetYFromData(this.Price);
|
|
43979
|
+
|
|
43980
|
+
this.Canvas.save();
|
|
43981
|
+
this.ClipClient(this.IsHScreen);
|
|
43982
|
+
|
|
43810
43983
|
var textWidth=0;
|
|
43811
43984
|
if (this.Text.Title)
|
|
43812
43985
|
{
|
|
@@ -43836,23 +44009,22 @@ function ChartTextLine()
|
|
|
43836
44009
|
{
|
|
43837
44010
|
if (this.Line.Type==2) //虚线
|
|
43838
44011
|
{
|
|
43839
|
-
this.Canvas.
|
|
43840
|
-
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]); //虚线
|
|
43841
44014
|
}
|
|
43842
44015
|
|
|
44016
|
+
if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
|
|
44017
|
+
|
|
43843
44018
|
var x=left+textWidth;
|
|
43844
44019
|
this.Canvas.strokeStyle=this.Line.Color;
|
|
43845
44020
|
this.Canvas.beginPath();
|
|
43846
44021
|
this.Canvas.moveTo(x,ToFixedPoint(y));
|
|
43847
44022
|
this.Canvas.lineTo(right,ToFixedPoint(y));
|
|
43848
44023
|
this.Canvas.stroke();
|
|
43849
|
-
|
|
43850
|
-
if (this.Line.Type==2)
|
|
43851
|
-
{
|
|
43852
|
-
this.Canvas.restore();
|
|
43853
|
-
}
|
|
43854
44024
|
}
|
|
43855
44025
|
|
|
44026
|
+
|
|
44027
|
+
this.Canvas.restore();
|
|
43856
44028
|
}
|
|
43857
44029
|
|
|
43858
44030
|
this.GetMaxMin=function()
|
|
@@ -74341,6 +74513,13 @@ function JSChartResource()
|
|
|
74341
74513
|
BorderColor:"rgb(217,217,217)",
|
|
74342
74514
|
}
|
|
74343
74515
|
|
|
74516
|
+
this.ChartSimplePie=
|
|
74517
|
+
{
|
|
74518
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
74519
|
+
BorderColor:"rgb(169,169,169)",
|
|
74520
|
+
Offset:{ X:-5, Y:5 }
|
|
74521
|
+
}
|
|
74522
|
+
|
|
74344
74523
|
//手机端tooltip
|
|
74345
74524
|
this.TooltipPaint = {
|
|
74346
74525
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -75570,6 +75749,7 @@ function JSChartResource()
|
|
|
75570
75749
|
}
|
|
75571
75750
|
|
|
75572
75751
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
75752
|
+
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
75573
75753
|
|
|
75574
75754
|
if (style.DRAWICON)
|
|
75575
75755
|
{
|
|
@@ -76642,6 +76822,27 @@ function JSChartResource()
|
|
|
76642
76822
|
}
|
|
76643
76823
|
}
|
|
76644
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
|
+
|
|
76645
76846
|
}
|
|
76646
76847
|
|
|
76647
76848
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -86503,6 +86704,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86503
86704
|
if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
|
|
86504
86705
|
{
|
|
86505
86706
|
var index=parseInt(position.CursorIndex.toFixed(0));
|
|
86707
|
+
if (index>=kData.Data.length) index=kData.Data.length-1; //未开盘的时间,取最后一个数据的收盘价
|
|
86506
86708
|
var item=kData.Data[index];
|
|
86507
86709
|
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
86508
86710
|
{
|
|
@@ -111870,6 +112072,30 @@ function JSDraw(errorHandler,symbolData)
|
|
|
111870
112072
|
|
|
111871
112073
|
return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
|
|
111872
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
|
+
}
|
|
111873
112099
|
}
|
|
111874
112100
|
|
|
111875
112101
|
|
|
@@ -111924,7 +112150,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
111924
112150
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
111925
112151
|
"VERTLINE","HORLINE","TIPICON",
|
|
111926
112152
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
111927
|
-
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
|
|
112153
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
|
|
111928
112154
|
]);
|
|
111929
112155
|
if (setFunctionName.has(name)) return true;
|
|
111930
112156
|
|
|
@@ -118805,6 +119031,14 @@ function JSExecute(ast,option)
|
|
|
118805
119031
|
node.Draw=this.Draw.DRAWTABLE(args);
|
|
118806
119032
|
node.Out=[];
|
|
118807
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;
|
|
118808
119042
|
|
|
118809
119043
|
default:
|
|
118810
119044
|
node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
|
|
@@ -119703,6 +119937,10 @@ function JSExplainer(ast,option)
|
|
|
119703
119937
|
["L2_VOLNUM", { Name:"L2_VOLNUM", Param:{ Count:2 }, ToString:function(args) { return `单数分档`; } }],
|
|
119704
119938
|
["L2_VOL", { Name:"L2_VOL", Param:{ Count:2 }, ToString:function(args) { return `成交量分档`; } }],
|
|
119705
119939
|
["L2_AMO", { Name:"L2_AMO", Param:{ Count:2 }, ToString:function(args) { return `成交额分档`; } }],
|
|
119940
|
+
|
|
119941
|
+
["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
|
|
119942
|
+
["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
|
|
119943
|
+
["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
|
|
119706
119944
|
|
|
119707
119945
|
]
|
|
119708
119946
|
);
|
|
@@ -121794,6 +122032,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
121794
122032
|
hqChart.ChartPaint.push(chart);
|
|
121795
122033
|
}
|
|
121796
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
|
+
|
|
121797
122058
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
121798
122059
|
{
|
|
121799
122060
|
var chart=new ChartTradeIcon();
|
|
@@ -122662,6 +122923,8 @@ function ScriptIndex(name,script,args,option)
|
|
|
122662
122923
|
case "DRAW_SIMPLE_TABLE":
|
|
122663
122924
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122664
122925
|
break;
|
|
122926
|
+
case "DRAW_SIMPLE_PIE":
|
|
122927
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
122665
122928
|
case "BUY":
|
|
122666
122929
|
case "SELL":
|
|
122667
122930
|
case "SELLSHORT":
|
|
@@ -123012,6 +123275,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
123012
123275
|
case "DRAW_SIMPLE_TABLE":
|
|
123013
123276
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
123014
123277
|
break;
|
|
123278
|
+
case "DRAW_SIMPLE_PIE":
|
|
123279
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
123015
123280
|
|
|
123016
123281
|
case "KLINE_BG":
|
|
123017
123282
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
@@ -124049,6 +124314,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
124049
124314
|
frame.ChartPaint.push(chart);
|
|
124050
124315
|
}
|
|
124051
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
|
+
|
|
124052
124344
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
124053
124345
|
{
|
|
124054
124346
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -125251,6 +125543,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
125251
125543
|
outVarItem.Draw=drawItem;
|
|
125252
125544
|
result.push(outVarItem);
|
|
125253
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
|
+
}
|
|
125254
125557
|
else
|
|
125255
125558
|
{
|
|
125256
125559
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -126862,6 +127165,11 @@ function GetBlackStyle()
|
|
|
126862
127165
|
BorderColor:"rgb(90,90,90)",
|
|
126863
127166
|
},
|
|
126864
127167
|
|
|
127168
|
+
ChartSimplePie:
|
|
127169
|
+
{
|
|
127170
|
+
BorderColor:"rgb(220,220,220)",
|
|
127171
|
+
},
|
|
127172
|
+
|
|
126865
127173
|
ChartDrawVolProfile:
|
|
126866
127174
|
{
|
|
126867
127175
|
BGColor:"rgba(244,250,254,0.3)",
|
|
@@ -146633,7 +146941,7 @@ function JSPopKeyboard()
|
|
|
146633
146941
|
}
|
|
146634
146942
|
}
|
|
146635
146943
|
|
|
146636
|
-
if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=
|
|
146944
|
+
if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122) || code==8)
|
|
146637
146945
|
{
|
|
146638
146946
|
var strText=this.InputDOM.value;
|
|
146639
146947
|
strText=strText.toUpperCase();
|
|
@@ -146731,7 +147039,7 @@ function JSPopKeyboard()
|
|
|
146731
147039
|
var code=event.keyCode;
|
|
146732
147040
|
if (code==116) return; //F5不处理
|
|
146733
147041
|
|
|
146734
|
-
if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=
|
|
147042
|
+
if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122))
|
|
146735
147043
|
{
|
|
146736
147044
|
this.Show();
|
|
146737
147045
|
this.InputDOM.focus();
|
|
@@ -151001,7 +151309,7 @@ function HQChartScriptWorker()
|
|
|
151001
151309
|
|
|
151002
151310
|
|
|
151003
151311
|
|
|
151004
|
-
var HQCHART_VERSION="1.1.
|
|
151312
|
+
var HQCHART_VERSION="1.1.14304";
|
|
151005
151313
|
|
|
151006
151314
|
function PrintHQChartVersion()
|
|
151007
151315
|
{
|