hqchart 1.1.14367 → 1.1.14372
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 +28 -18
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +48 -0
- package/src/jscommon/umychart.complier.js +76 -2
- package/src/jscommon/umychart.js +213 -11
- package/src/jscommon/umychart.style.js +5 -0
- package/src/jscommon/umychart.testdata.js +48 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +295 -14
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +48 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +295 -14
package/package.json
CHANGED
|
@@ -57376,6 +57376,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57376
57376
|
HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
|
|
57377
57377
|
else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
|
|
57378
57378
|
HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
|
|
57379
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_DOUGHNUT")
|
|
57380
|
+
HQData.APIIndex_DRAW_SIMPLE_DOUGHNUT(data, callback);
|
|
57379
57381
|
else if (request.Data.indexname=="API_DRAW_SIMPLE_RADAR")
|
|
57380
57382
|
HQData.APIIndex_DRAW_SIMPLE_RADAR(data, callback);
|
|
57381
57383
|
else if (request.Data.indexname=="API_MULTI_BAR")
|
|
@@ -57909,6 +57911,52 @@ HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
|
|
|
57909
57911
|
callback(apiData);
|
|
57910
57912
|
}
|
|
57911
57913
|
|
|
57914
|
+
HQData.APIIndex_DRAW_SIMPLE_DOUGHNUT=function(data, callback)
|
|
57915
|
+
{
|
|
57916
|
+
data.PreventDefault=true;
|
|
57917
|
+
var hqchart=data.HQChart;
|
|
57918
|
+
var kData=hqchart.GetKData();
|
|
57919
|
+
|
|
57920
|
+
var tableData=
|
|
57921
|
+
{
|
|
57922
|
+
name:'DRAW_SIMPLE_DOUGHNUT', type:1,
|
|
57923
|
+
Draw:
|
|
57924
|
+
{
|
|
57925
|
+
DrawType:'DRAW_SIMPLE_DOUGHNUT',
|
|
57926
|
+
DrawData:
|
|
57927
|
+
{
|
|
57928
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
57929
|
+
//BorderColor:"rgb(110,110,110)",
|
|
57930
|
+
//TextColor:"rgb(0,191,255)",
|
|
57931
|
+
Data:
|
|
57932
|
+
[
|
|
57933
|
+
{ Value:100, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
|
|
57934
|
+
{ Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
|
|
57935
|
+
{ Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
|
|
57936
|
+
{ Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
|
|
57937
|
+
{ Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
|
|
57938
|
+
],
|
|
57939
|
+
|
|
57940
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
57941
|
+
//XOffset:-10,
|
|
57942
|
+
//YOffset:-15,
|
|
57943
|
+
Radius:80,
|
|
57944
|
+
}
|
|
57945
|
+
}
|
|
57946
|
+
};
|
|
57947
|
+
|
|
57948
|
+
var apiData=
|
|
57949
|
+
{
|
|
57950
|
+
code:0,
|
|
57951
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57952
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
57953
|
+
};
|
|
57954
|
+
|
|
57955
|
+
|
|
57956
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
|
|
57957
|
+
callback(apiData);
|
|
57958
|
+
}
|
|
57959
|
+
|
|
57912
57960
|
|
|
57913
57961
|
HQData.APIIndex_DRAW_SIMPLE_RADAR=function(data, callback)
|
|
57914
57962
|
{
|
|
@@ -11622,6 +11622,18 @@ function JSDraw(errorHandler,symbolData)
|
|
|
11622
11622
|
|
|
11623
11623
|
return result={ DrawData:{ Data:aryData, AryIndex:aryIndex, Radius:radius, AryArea:[{ LineColor:color }] }, DrawType:"DRAW_SIMPLE_RADAR" };
|
|
11624
11624
|
}
|
|
11625
|
+
|
|
11626
|
+
this.DRAWDOUGHNUT=function(aryData)
|
|
11627
|
+
{
|
|
11628
|
+
var radius=aryData[0];
|
|
11629
|
+
var aryCell=[];
|
|
11630
|
+
for(var i=1;i<aryData.length;++i)
|
|
11631
|
+
{
|
|
11632
|
+
aryCell.push(aryData[i]);
|
|
11633
|
+
}
|
|
11634
|
+
|
|
11635
|
+
return result={ DrawData:{ Data:aryCell, Radius:radius , InnerRadius:radius/2 }, DrawType:"DRAW_SIMPLE_DOUGHNUT" };
|
|
11636
|
+
}
|
|
11625
11637
|
}
|
|
11626
11638
|
|
|
11627
11639
|
|
|
@@ -11676,7 +11688,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
11676
11688
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
11677
11689
|
"VERTLINE","HORLINE","TIPICON",
|
|
11678
11690
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
11679
|
-
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR",
|
|
11691
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE","DRAWRADAR","DRAWDOUGHNUT",
|
|
11680
11692
|
]);
|
|
11681
11693
|
if (setFunctionName.has(name)) return true;
|
|
11682
11694
|
|
|
@@ -18565,6 +18577,10 @@ function JSExecute(ast,option)
|
|
|
18565
18577
|
node.Draw=this.Draw.DRAWPIE(args);
|
|
18566
18578
|
node.Out=[];
|
|
18567
18579
|
break;
|
|
18580
|
+
case "DRAWDOUGHNUT":
|
|
18581
|
+
node.Draw=this.Draw.DRAWDOUGHNUT(args);
|
|
18582
|
+
node.Out=[];
|
|
18583
|
+
break;
|
|
18568
18584
|
//雷达图
|
|
18569
18585
|
case "RADAR_CELL":
|
|
18570
18586
|
node.Out=this.Draw.RADAR_CELL(args[0],args[1],args[2],args[3]);
|
|
@@ -21618,6 +21634,30 @@ function ScriptIndex(name,script,args,option)
|
|
|
21618
21634
|
hqChart.ChartPaint.push(chart);
|
|
21619
21635
|
}
|
|
21620
21636
|
|
|
21637
|
+
this.CreateSimpleDoughnut=function(hqChart,windowIndex,varItem,id)
|
|
21638
|
+
{
|
|
21639
|
+
var chart=new ChartSimpleDoughnut();
|
|
21640
|
+
chart.Canvas=hqChart.Canvas;
|
|
21641
|
+
chart.Name=varItem.Name;
|
|
21642
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
21643
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
21644
|
+
|
|
21645
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
21646
|
+
{
|
|
21647
|
+
var drawData=varItem.Draw.DrawData;
|
|
21648
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
21649
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
21650
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
21651
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
21652
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
21653
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
21654
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
21655
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.InnerRadius)) chart.InnerRadius=drawData.InnerRadius;
|
|
21656
|
+
}
|
|
21657
|
+
|
|
21658
|
+
hqChart.ChartPaint.push(chart);
|
|
21659
|
+
}
|
|
21660
|
+
|
|
21621
21661
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
21622
21662
|
{
|
|
21623
21663
|
var chart=new ChartTradeIcon();
|
|
@@ -22500,6 +22540,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
22500
22540
|
case "DRAW_SIMPLE_RADAR":
|
|
22501
22541
|
this.CreateSimpleRadar(hqChart,windowIndex,item,i);
|
|
22502
22542
|
break;
|
|
22543
|
+
case "DRAW_SIMPLE_DOUGHNUT":
|
|
22544
|
+
this.CreateSimpleDoughnut(hqChart,windowIndex,item,i);
|
|
22545
|
+
break;
|
|
22503
22546
|
case "BUY":
|
|
22504
22547
|
case "SELL":
|
|
22505
22548
|
case "SELLSHORT":
|
|
@@ -22853,6 +22896,9 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
22853
22896
|
case "DRAW_SIMPLE_PIE":
|
|
22854
22897
|
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
22855
22898
|
break;
|
|
22899
|
+
case "DRAW_SIMPLE_DOUGHNUT":
|
|
22900
|
+
this.CreateSimpleDoughnut(hqChart,windowIndex,item,i);
|
|
22901
|
+
break;
|
|
22856
22902
|
case "DRAW_SIMPLE_RADAR":
|
|
22857
22903
|
this.CreateSimpleRadar(hqChart,windowIndex,item,i);
|
|
22858
22904
|
break;
|
|
@@ -23931,6 +23977,34 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
23931
23977
|
frame.ChartPaint.push(chart);
|
|
23932
23978
|
}
|
|
23933
23979
|
|
|
23980
|
+
this.CreateSimpleDoughnut=function(hqChart,windowIndex,varItem,id)
|
|
23981
|
+
{
|
|
23982
|
+
var overlayIndex=this.OverlayIndex;
|
|
23983
|
+
var frame=overlayIndex.Frame;
|
|
23984
|
+
var chart=new ChartSimpleDoughnut();
|
|
23985
|
+
chart.Canvas=hqChart.Canvas;
|
|
23986
|
+
chart.Name=varItem.Name;
|
|
23987
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
23988
|
+
chart.ChartFrame=frame.Frame;
|
|
23989
|
+
chart.Identify=overlayIndex.Identify;
|
|
23990
|
+
chart.HQChart=hqChart;
|
|
23991
|
+
|
|
23992
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
23993
|
+
{
|
|
23994
|
+
var drawData=varItem.Draw.DrawData;
|
|
23995
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
23996
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
23997
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
23998
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
23999
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
24000
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
24001
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
24002
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.InnerRadius)) chart.InnerRadius=drawData.InnerRadius;
|
|
24003
|
+
}
|
|
24004
|
+
|
|
24005
|
+
frame.ChartPaint.push(chart);
|
|
24006
|
+
}
|
|
24007
|
+
|
|
23934
24008
|
this.CreateSimpleRadar=function(hqChart,windowIndex,varItem,id)
|
|
23935
24009
|
{
|
|
23936
24010
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -25158,7 +25232,7 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
25158
25232
|
outVarItem.Draw=drawItem;
|
|
25159
25233
|
result.push(outVarItem);
|
|
25160
25234
|
}
|
|
25161
|
-
else if (draw.DrawType=="DRAW_SIMPLE_PIE")
|
|
25235
|
+
else if (draw.DrawType=="DRAW_SIMPLE_PIE" || draw.DrawType=="DRAW_SIMPLE_DOUGHNUT")
|
|
25162
25236
|
{
|
|
25163
25237
|
drawItem.Name=draw.Name;
|
|
25164
25238
|
drawItem.Type=draw.Type;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -11118,7 +11118,7 @@ function ChartFrameFactory()
|
|
|
11118
11118
|
{
|
|
11119
11119
|
if (!this.DataMap.has(name))
|
|
11120
11120
|
{
|
|
11121
|
-
JSConsole.Warn(`[ChartFrameFactory::Create] can't find class=${name}.`);
|
|
11121
|
+
JSConsole.Chart.Warn(`[ChartFrameFactory::Create] can't find class=${name}.`);
|
|
11122
11122
|
return null;
|
|
11123
11123
|
}
|
|
11124
11124
|
|
|
@@ -24419,7 +24419,7 @@ function ChartPaintFactory()
|
|
|
24419
24419
|
{
|
|
24420
24420
|
if (!this.DataMap.has(name))
|
|
24421
24421
|
{
|
|
24422
|
-
JSConsole.Warn(`[ChartPaintFactory::Create] can't find class=${name}.`);
|
|
24422
|
+
JSConsole.Chart.Warn(`[ChartPaintFactory::Create] can't find class=${name}.`);
|
|
24423
24423
|
return null;
|
|
24424
24424
|
}
|
|
24425
24425
|
|
|
@@ -31870,10 +31870,11 @@ function ChartSimplePie()
|
|
|
31870
31870
|
this.RectClient.Left-=xOffset;
|
|
31871
31871
|
this.RectClient.Right-=xOffset;
|
|
31872
31872
|
|
|
31873
|
-
|
|
31873
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31874
|
+
var radius=this.Radius*pixelRatio;
|
|
31874
31875
|
var start=0, end=0;
|
|
31875
|
-
var x=this.RectClient.Left+
|
|
31876
|
-
var y=this.RectClient.Top+
|
|
31876
|
+
var x=this.RectClient.Left+radius;
|
|
31877
|
+
var y=this.RectClient.Top+radius;
|
|
31877
31878
|
|
|
31878
31879
|
for(var i=0;i<this.Data.Data.length;++i)
|
|
31879
31880
|
{
|
|
@@ -31889,7 +31890,178 @@ function ChartSimplePie()
|
|
|
31889
31890
|
end += rate*2*Math.PI;//终止角度
|
|
31890
31891
|
this.Canvas.strokeStyle = this.BorderColor;
|
|
31891
31892
|
this.Canvas.fillStyle = item.Color;
|
|
31892
|
-
this.Canvas.arc(x,y,
|
|
31893
|
+
this.Canvas.arc(x,y,radius,start,end);
|
|
31894
|
+
this.Canvas.fill();
|
|
31895
|
+
this.Canvas.closePath();
|
|
31896
|
+
this.Canvas.stroke();
|
|
31897
|
+
|
|
31898
|
+
if (item.Text)
|
|
31899
|
+
{
|
|
31900
|
+
// 绘制直线
|
|
31901
|
+
var xLine=radius*Math.cos(end- (end-start)/2)+x;
|
|
31902
|
+
var yLine=radius*Math.sin(end - (end-start)/2)+y;
|
|
31903
|
+
var xEnd = (radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
|
|
31904
|
+
var yEnd = (radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
|
|
31905
|
+
|
|
31906
|
+
this.Canvas.beginPath();
|
|
31907
|
+
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
31908
|
+
else this.Canvas.strokeStyle = item.Color;
|
|
31909
|
+
this.Canvas.moveTo(xLine,yLine);
|
|
31910
|
+
this.Canvas.lineTo(xEnd,yEnd);
|
|
31911
|
+
|
|
31912
|
+
var textWidth=aryText[i].Width;
|
|
31913
|
+
var yText=xEnd;
|
|
31914
|
+
if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
|
|
31915
|
+
{
|
|
31916
|
+
this.Canvas.lineTo( xEnd - textWidth, yEnd );
|
|
31917
|
+
yText=xEnd - textWidth;
|
|
31918
|
+
}
|
|
31919
|
+
else
|
|
31920
|
+
{
|
|
31921
|
+
this.Canvas.lineTo( xEnd + textWidth, yEnd );
|
|
31922
|
+
}
|
|
31923
|
+
this.Canvas.stroke();
|
|
31924
|
+
|
|
31925
|
+
if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
|
|
31926
|
+
else this.Canvas.fillStyle=item.Color;
|
|
31927
|
+
this.Canvas.fillText(item.Text, yText, yEnd);
|
|
31928
|
+
}
|
|
31929
|
+
|
|
31930
|
+
start += rate*2*Math.PI;//起始角度
|
|
31931
|
+
}
|
|
31932
|
+
}
|
|
31933
|
+
|
|
31934
|
+
this.Draw=function()
|
|
31935
|
+
{
|
|
31936
|
+
if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
|
|
31937
|
+
|
|
31938
|
+
this.CalculateTotalValue();
|
|
31939
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
|
|
31940
|
+
this.CalculateSize();
|
|
31941
|
+
|
|
31942
|
+
this.Canvas.save();
|
|
31943
|
+
|
|
31944
|
+
this.DrawPie();
|
|
31945
|
+
|
|
31946
|
+
this.Canvas.restore();
|
|
31947
|
+
}
|
|
31948
|
+
|
|
31949
|
+
//空数据
|
|
31950
|
+
this.DrawEmptyData=function()
|
|
31951
|
+
{
|
|
31952
|
+
JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
|
|
31953
|
+
}
|
|
31954
|
+
|
|
31955
|
+
this.GetMaxMin=function()
|
|
31956
|
+
{
|
|
31957
|
+
return { Min:null, Max:null };
|
|
31958
|
+
}
|
|
31959
|
+
}
|
|
31960
|
+
|
|
31961
|
+
|
|
31962
|
+
//圆环
|
|
31963
|
+
function ChartSimpleDoughnut()
|
|
31964
|
+
{
|
|
31965
|
+
this.newMethod=IChartPainting; //派生
|
|
31966
|
+
this.newMethod();
|
|
31967
|
+
delete this.newMethod;
|
|
31968
|
+
|
|
31969
|
+
this.ClassName='ChartSimpleDoughnut'; //类名
|
|
31970
|
+
|
|
31971
|
+
this.BorderColor=g_JSChartResource.ChartSimpleDoughnut.BorderColor;
|
|
31972
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimpleDoughnut.Offset);
|
|
31973
|
+
this.LineExtendWidth=10;
|
|
31974
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleDoughnut.TextFont);
|
|
31975
|
+
|
|
31976
|
+
this.RectClient={ };
|
|
31977
|
+
this.TotalValue=1;
|
|
31978
|
+
this.Radius = 50; //外圈半径默认值
|
|
31979
|
+
this.InnerRadius=30; //内圈半径
|
|
31980
|
+
this.TextFont;
|
|
31981
|
+
|
|
31982
|
+
|
|
31983
|
+
this.ReloadResource=function(resource)
|
|
31984
|
+
{
|
|
31985
|
+
this.BorderColor=g_JSChartResource.ChartSimpleDoughnut.BorderColor;
|
|
31986
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimpleDoughnut.Offset);
|
|
31987
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleDoughnut.TextFont);
|
|
31988
|
+
}
|
|
31989
|
+
|
|
31990
|
+
this.CalculateSize=function()
|
|
31991
|
+
{
|
|
31992
|
+
var border=this.ChartFrame.GetBorder();
|
|
31993
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31994
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
31995
|
+
this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
|
|
31996
|
+
|
|
31997
|
+
|
|
31998
|
+
this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
|
|
31999
|
+
|
|
32000
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
32001
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
32002
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
32003
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
32004
|
+
}
|
|
32005
|
+
|
|
32006
|
+
this.CalculateTotalValue=function()
|
|
32007
|
+
{
|
|
32008
|
+
var totalValue=0;
|
|
32009
|
+
for(var i=0; i<this.Data.Data.length; ++i)
|
|
32010
|
+
{
|
|
32011
|
+
var item=this.Data.Data[i];
|
|
32012
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
32013
|
+
totalValue += item.Value;
|
|
32014
|
+
}
|
|
32015
|
+
|
|
32016
|
+
this.TotalValue=totalValue;
|
|
32017
|
+
}
|
|
32018
|
+
|
|
32019
|
+
this.DrawPie=function()
|
|
32020
|
+
{
|
|
32021
|
+
this.Canvas.font=this.TextFont;
|
|
32022
|
+
this.Canvas.textBaseline='bottom';
|
|
32023
|
+
this.Canvas.textAlign = 'left';
|
|
32024
|
+
|
|
32025
|
+
var aryText=[];
|
|
32026
|
+
var maxTextWidth=0;
|
|
32027
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
32028
|
+
{
|
|
32029
|
+
var item=this.Data.Data[i];
|
|
32030
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
32031
|
+
if (!item.Text) continue;
|
|
32032
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
32033
|
+
|
|
32034
|
+
aryText[i]={ Width:textWidth };
|
|
32035
|
+
|
|
32036
|
+
if (maxTextWidth<textWidth) maxTextWidth=textWidth;
|
|
32037
|
+
}
|
|
32038
|
+
|
|
32039
|
+
var xOffset=maxTextWidth+this.LineExtendWidth;
|
|
32040
|
+
this.RectClient.Left-=xOffset;
|
|
32041
|
+
this.RectClient.Right-=xOffset;
|
|
32042
|
+
|
|
32043
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
32044
|
+
var radius=this.Radius*pixelRatio;
|
|
32045
|
+
var innerRadius=this.InnerRadius*pixelRatio;
|
|
32046
|
+
var start=0, end=0;
|
|
32047
|
+
var x=this.RectClient.Left+radius;
|
|
32048
|
+
var y=this.RectClient.Top+radius;
|
|
32049
|
+
|
|
32050
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
32051
|
+
{
|
|
32052
|
+
var item=this.Data.Data[i];
|
|
32053
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
32054
|
+
|
|
32055
|
+
var rate=item.Value/this.TotalValue;
|
|
32056
|
+
|
|
32057
|
+
// 绘制扇形
|
|
32058
|
+
this.Canvas.beginPath();
|
|
32059
|
+
|
|
32060
|
+
end += rate*2*Math.PI;//终止角度
|
|
32061
|
+
this.Canvas.strokeStyle = this.BorderColor;
|
|
32062
|
+
this.Canvas.fillStyle = item.Color;
|
|
32063
|
+
this.Canvas.arc(x,y,radius,start,end);
|
|
32064
|
+
this.Canvas.arc(x,y,innerRadius,end-2*Math.PI,start-2*Math.PI, true);
|
|
31893
32065
|
this.Canvas.fill();
|
|
31894
32066
|
this.Canvas.closePath();
|
|
31895
32067
|
this.Canvas.stroke();
|
|
@@ -31897,10 +32069,10 @@ function ChartSimplePie()
|
|
|
31897
32069
|
if (item.Text)
|
|
31898
32070
|
{
|
|
31899
32071
|
// 绘制直线
|
|
31900
|
-
var xLine=
|
|
31901
|
-
var yLine=
|
|
31902
|
-
var xEnd = (
|
|
31903
|
-
var yEnd = (
|
|
32072
|
+
var xLine=radius*Math.cos(end- (end-start)/2)+x;
|
|
32073
|
+
var yLine=radius*Math.sin(end - (end-start)/2)+y;
|
|
32074
|
+
var xEnd = (radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
|
|
32075
|
+
var yEnd = (radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
|
|
31904
32076
|
|
|
31905
32077
|
this.Canvas.beginPath();
|
|
31906
32078
|
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
@@ -71464,6 +71636,13 @@ function JSChartResource()
|
|
|
71464
71636
|
Offset:{ X:-5, Y:5 }
|
|
71465
71637
|
}
|
|
71466
71638
|
|
|
71639
|
+
this.ChartSimpleDoughnut=
|
|
71640
|
+
{
|
|
71641
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
71642
|
+
BorderColor:"rgb(169,169,169)",
|
|
71643
|
+
Offset:{ X:-5, Y:5 }
|
|
71644
|
+
}
|
|
71645
|
+
|
|
71467
71646
|
this.ChartSimpleRadar=
|
|
71468
71647
|
{
|
|
71469
71648
|
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
@@ -72709,6 +72888,8 @@ function JSChartResource()
|
|
|
72709
72888
|
|
|
72710
72889
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
72711
72890
|
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
72891
|
+
if (style.ChartSimpleDoughnut) this.SetChartSimpleDoughnut(style.ChartSimpleDoughnut);
|
|
72892
|
+
|
|
72712
72893
|
if (style.ChartSimpleRadar) this.SetChartSimpleRadar(style.ChartSimpleRadar);
|
|
72713
72894
|
|
|
72714
72895
|
if (style.DRAWICON)
|
|
@@ -73803,6 +73984,27 @@ function JSChartResource()
|
|
|
73803
73984
|
}
|
|
73804
73985
|
}
|
|
73805
73986
|
|
|
73987
|
+
this.SetChartSimpleDoughnut=function(style)
|
|
73988
|
+
{
|
|
73989
|
+
var dest=this.ChartSimpleDoughnut;
|
|
73990
|
+
|
|
73991
|
+
if (style.TextFont)
|
|
73992
|
+
{
|
|
73993
|
+
var item=style.TextFont;
|
|
73994
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
73995
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
73996
|
+
}
|
|
73997
|
+
|
|
73998
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
73999
|
+
|
|
74000
|
+
if (style.Offset)
|
|
74001
|
+
{
|
|
74002
|
+
var item=style.Offset;
|
|
74003
|
+
if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
|
|
74004
|
+
if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
|
|
74005
|
+
}
|
|
74006
|
+
}
|
|
74007
|
+
|
|
73806
74008
|
this.SetChartSimpleRadar=function(style)
|
|
73807
74009
|
{
|
|
73808
74010
|
var dest=this.ChartSimpleRadar;
|
|
@@ -92939,7 +93141,7 @@ function DialogFactory()
|
|
|
92939
93141
|
{
|
|
92940
93142
|
if (!this.DataMap.has(name))
|
|
92941
93143
|
{
|
|
92942
|
-
JSConsole.Warn(`[DialogFactory::Create] can't find class=${name}.`);
|
|
93144
|
+
JSConsole.Chart.Warn(`[DialogFactory::Create] can't find class=${name}.`);
|
|
92943
93145
|
return null;
|
|
92944
93146
|
}
|
|
92945
93147
|
|
|
@@ -1862,6 +1862,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
1862
1862
|
HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
|
|
1863
1863
|
else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
|
|
1864
1864
|
HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
|
|
1865
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_DOUGHNUT")
|
|
1866
|
+
HQData.APIIndex_DRAW_SIMPLE_DOUGHNUT(data, callback);
|
|
1865
1867
|
else if (request.Data.indexname=="API_DRAW_SIMPLE_RADAR")
|
|
1866
1868
|
HQData.APIIndex_DRAW_SIMPLE_RADAR(data, callback);
|
|
1867
1869
|
else if (request.Data.indexname=="API_MULTI_BAR")
|
|
@@ -2395,6 +2397,52 @@ HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
|
|
|
2395
2397
|
callback(apiData);
|
|
2396
2398
|
}
|
|
2397
2399
|
|
|
2400
|
+
HQData.APIIndex_DRAW_SIMPLE_DOUGHNUT=function(data, callback)
|
|
2401
|
+
{
|
|
2402
|
+
data.PreventDefault=true;
|
|
2403
|
+
var hqchart=data.HQChart;
|
|
2404
|
+
var kData=hqchart.GetKData();
|
|
2405
|
+
|
|
2406
|
+
var tableData=
|
|
2407
|
+
{
|
|
2408
|
+
name:'DRAW_SIMPLE_DOUGHNUT', type:1,
|
|
2409
|
+
Draw:
|
|
2410
|
+
{
|
|
2411
|
+
DrawType:'DRAW_SIMPLE_DOUGHNUT',
|
|
2412
|
+
DrawData:
|
|
2413
|
+
{
|
|
2414
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
2415
|
+
//BorderColor:"rgb(110,110,110)",
|
|
2416
|
+
//TextColor:"rgb(0,191,255)",
|
|
2417
|
+
Data:
|
|
2418
|
+
[
|
|
2419
|
+
{ Value:100, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
|
|
2420
|
+
{ Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
|
|
2421
|
+
{ Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
|
|
2422
|
+
{ Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
|
|
2423
|
+
{ Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
|
|
2424
|
+
],
|
|
2425
|
+
|
|
2426
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
2427
|
+
//XOffset:-10,
|
|
2428
|
+
//YOffset:-15,
|
|
2429
|
+
Radius:80,
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
};
|
|
2433
|
+
|
|
2434
|
+
var apiData=
|
|
2435
|
+
{
|
|
2436
|
+
code:0,
|
|
2437
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
2438
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
2439
|
+
};
|
|
2440
|
+
|
|
2441
|
+
|
|
2442
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
|
|
2443
|
+
callback(apiData);
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2398
2446
|
|
|
2399
2447
|
HQData.APIIndex_DRAW_SIMPLE_RADAR=function(data, callback)
|
|
2400
2448
|
{
|