hqchart 1.1.14363 → 1.1.14370
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 +34 -24
- package/package.json +1 -1
- package/src/jscommon/umychart.DialogTooltip.js +2 -2
- package/src/jscommon/umychart.NetworkFilterTest.js +48 -0
- package/src/jscommon/umychart.complier.js +76 -2
- package/src/jscommon/umychart.js +235 -22
- 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 +317 -25
- 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 +319 -27
package/package.json
CHANGED
|
@@ -543,7 +543,7 @@ function JSDialogTooltip()
|
|
|
543
543
|
|
|
544
544
|
|
|
545
545
|
//换手率
|
|
546
|
-
if (
|
|
546
|
+
if (IFrameSplitOperator.IsNumber(data.FlowCapital))
|
|
547
547
|
{
|
|
548
548
|
aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'DialogTooltip-Exchange' ));
|
|
549
549
|
}
|
|
@@ -1579,7 +1579,7 @@ function JSFloatTooltip()
|
|
|
1579
1579
|
if (overlayItem) aryText.unshift(overlayItem);
|
|
1580
1580
|
|
|
1581
1581
|
//换手率
|
|
1582
|
-
if (
|
|
1582
|
+
if (IFrameSplitOperator.IsNumber(data.FlowCapital))
|
|
1583
1583
|
{
|
|
1584
1584
|
aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'FloatTooltip-Exchange' ));
|
|
1585
1585
|
}
|
|
@@ -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
|
@@ -4587,11 +4587,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4587
4587
|
var y=(e.clientY-uielement.getBoundingClientRect().top)*pixelTatio;
|
|
4588
4588
|
var data= { X:e.clientX, Y:e.clientY, FrameID:-1 };
|
|
4589
4589
|
|
|
4590
|
-
var
|
|
4591
|
-
|
|
4592
|
-
this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());
|
|
4593
|
-
isInClient=this.Canvas.isPointInPath(x,y);
|
|
4594
|
-
if (isInClient)
|
|
4590
|
+
var clientPos=this.PtInClient(x,y);
|
|
4591
|
+
if (clientPos>0)
|
|
4595
4592
|
{
|
|
4596
4593
|
var yValueExtend={};
|
|
4597
4594
|
var yValue=this.Frame.GetYData(y,yValueExtend);
|
|
@@ -31873,10 +31870,11 @@ function ChartSimplePie()
|
|
|
31873
31870
|
this.RectClient.Left-=xOffset;
|
|
31874
31871
|
this.RectClient.Right-=xOffset;
|
|
31875
31872
|
|
|
31876
|
-
|
|
31873
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31874
|
+
var radius=this.Radius*pixelRatio;
|
|
31877
31875
|
var start=0, end=0;
|
|
31878
|
-
var x=this.RectClient.Left+
|
|
31879
|
-
var y=this.RectClient.Top+
|
|
31876
|
+
var x=this.RectClient.Left+radius;
|
|
31877
|
+
var y=this.RectClient.Top+radius;
|
|
31880
31878
|
|
|
31881
31879
|
for(var i=0;i<this.Data.Data.length;++i)
|
|
31882
31880
|
{
|
|
@@ -31892,7 +31890,7 @@ function ChartSimplePie()
|
|
|
31892
31890
|
end += rate*2*Math.PI;//终止角度
|
|
31893
31891
|
this.Canvas.strokeStyle = this.BorderColor;
|
|
31894
31892
|
this.Canvas.fillStyle = item.Color;
|
|
31895
|
-
this.Canvas.arc(x,y,
|
|
31893
|
+
this.Canvas.arc(x,y,radius,start,end);
|
|
31896
31894
|
this.Canvas.fill();
|
|
31897
31895
|
this.Canvas.closePath();
|
|
31898
31896
|
this.Canvas.stroke();
|
|
@@ -31900,10 +31898,181 @@ function ChartSimplePie()
|
|
|
31900
31898
|
if (item.Text)
|
|
31901
31899
|
{
|
|
31902
31900
|
// 绘制直线
|
|
31903
|
-
var xLine=
|
|
31904
|
-
var yLine=
|
|
31905
|
-
var xEnd = (
|
|
31906
|
-
var yEnd = (
|
|
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);
|
|
32065
|
+
this.Canvas.fill();
|
|
32066
|
+
this.Canvas.closePath();
|
|
32067
|
+
this.Canvas.stroke();
|
|
32068
|
+
|
|
32069
|
+
if (item.Text)
|
|
32070
|
+
{
|
|
32071
|
+
// 绘制直线
|
|
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;
|
|
31907
32076
|
|
|
31908
32077
|
this.Canvas.beginPath();
|
|
31909
32078
|
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
@@ -44373,11 +44542,15 @@ function KLineTooltipPaint()
|
|
|
44373
44542
|
}
|
|
44374
44543
|
|
|
44375
44544
|
//换手率
|
|
44376
|
-
if (
|
|
44545
|
+
if (IFrameSplitOperator.IsNumber(item.FlowCapital))
|
|
44377
44546
|
{
|
|
44547
|
+
var text="--.--"
|
|
44378
44548
|
title=g_JSChartLocalization.GetText('Tooltip-Exchange',this.LanguageID);
|
|
44379
|
-
|
|
44380
|
-
|
|
44549
|
+
if (item.FlowCapital!=0)
|
|
44550
|
+
{
|
|
44551
|
+
var value=item.Vol/item.FlowCapital*100;
|
|
44552
|
+
var text=value.toFixed(2)+'%';
|
|
44553
|
+
}
|
|
44381
44554
|
aryText.push({Title:title, TitleColor:this.TitleColor, Text:text, Color:this.TitleColor });
|
|
44382
44555
|
}
|
|
44383
44556
|
|
|
@@ -55569,13 +55742,19 @@ function HistoryDataStringFormat()
|
|
|
55569
55742
|
aryText.push(item);
|
|
55570
55743
|
}
|
|
55571
55744
|
|
|
55572
|
-
if(
|
|
55745
|
+
if(IFrameSplitOperator.IsNumber(data.FlowCapital)) //换手率
|
|
55573
55746
|
{
|
|
55574
|
-
var
|
|
55747
|
+
var text="--.--";
|
|
55748
|
+
if (data.FlowCapital!=0)
|
|
55749
|
+
{
|
|
55750
|
+
var value=data.Vol/data.FlowCapital*100;
|
|
55751
|
+
var text=`${value.toFixed(2)}%`;
|
|
55752
|
+
}
|
|
55753
|
+
|
|
55575
55754
|
var item=
|
|
55576
55755
|
{
|
|
55577
55756
|
Title:g_JSChartLocalization.GetText('DivTooltip-Exchange',this.LanguageID),
|
|
55578
|
-
Text
|
|
55757
|
+
Text:text,
|
|
55579
55758
|
Color:this.TurnoverRateColor
|
|
55580
55759
|
}
|
|
55581
55760
|
aryText.push(item);
|
|
@@ -56272,10 +56451,14 @@ function DynamicKLineTitlePainting()
|
|
|
56272
56451
|
aryText.push({ Text:text, Color:this.AmountColor});
|
|
56273
56452
|
}
|
|
56274
56453
|
|
|
56275
|
-
if (
|
|
56454
|
+
if (IFrameSplitOperator.IsNumber(item.FlowCapital)) //换手率
|
|
56276
56455
|
{
|
|
56277
|
-
var
|
|
56278
|
-
|
|
56456
|
+
var text="--.--";
|
|
56457
|
+
if (item.FlowCapital!=0)
|
|
56458
|
+
{
|
|
56459
|
+
var value=item.Vol/item.FlowCapital*100; //成交量/流通A股*100
|
|
56460
|
+
var text=g_JSChartLocalization.GetText('KTitle-Exchange',this.LanguageID)+IFrameSplitOperator.FormatValueString(value,2,this.LanguageID)+'%';
|
|
56461
|
+
}
|
|
56279
56462
|
aryText.push({ Text:text, Color:this.TurnoverRateColor});
|
|
56280
56463
|
}
|
|
56281
56464
|
|
|
@@ -71453,6 +71636,13 @@ function JSChartResource()
|
|
|
71453
71636
|
Offset:{ X:-5, Y:5 }
|
|
71454
71637
|
}
|
|
71455
71638
|
|
|
71639
|
+
this.ChartSimpleDoughnut=
|
|
71640
|
+
{
|
|
71641
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
71642
|
+
BorderColor:"rgb(169,169,169)",
|
|
71643
|
+
Offset:{ X:-5, Y:5 }
|
|
71644
|
+
}
|
|
71645
|
+
|
|
71456
71646
|
this.ChartSimpleRadar=
|
|
71457
71647
|
{
|
|
71458
71648
|
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
@@ -72698,6 +72888,8 @@ function JSChartResource()
|
|
|
72698
72888
|
|
|
72699
72889
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
72700
72890
|
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
72891
|
+
if (style.ChartSimpleDoughnut) this.SetChartSimpleDoughnut(style.ChartSimpleDoughnut);
|
|
72892
|
+
|
|
72701
72893
|
if (style.ChartSimpleRadar) this.SetChartSimpleRadar(style.ChartSimpleRadar);
|
|
72702
72894
|
|
|
72703
72895
|
if (style.DRAWICON)
|
|
@@ -73792,6 +73984,27 @@ function JSChartResource()
|
|
|
73792
73984
|
}
|
|
73793
73985
|
}
|
|
73794
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
|
+
|
|
73795
74008
|
this.SetChartSimpleRadar=function(style)
|
|
73796
74009
|
{
|
|
73797
74010
|
var dest=this.ChartSimpleRadar;
|
|
@@ -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
|
{
|