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
package/package.json
CHANGED
|
@@ -55745,6 +55745,8 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
55745
55745
|
}
|
|
55746
55746
|
*/
|
|
55747
55747
|
|
|
55748
|
+
//stockItem.minute.length=50;
|
|
55749
|
+
|
|
55748
55750
|
var hqchartData={code:0, stock:[stockItem] };
|
|
55749
55751
|
|
|
55750
55752
|
|
|
@@ -57370,6 +57372,11 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57370
57372
|
HQData.APIIndex_MULTI_SVGICON(data, callback);
|
|
57371
57373
|
else if (request.Data.indexname=="API-DRAWTEXT_LINE")
|
|
57372
57374
|
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
57375
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
|
|
57376
|
+
HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
|
|
57377
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
|
|
57378
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
|
|
57379
|
+
|
|
57373
57380
|
}
|
|
57374
57381
|
|
|
57375
57382
|
|
|
@@ -57774,8 +57781,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
57774
57781
|
DrawData:
|
|
57775
57782
|
{
|
|
57776
57783
|
Price:price,
|
|
57777
|
-
Text:
|
|
57778
|
-
|
|
57784
|
+
Text:
|
|
57785
|
+
{
|
|
57786
|
+
Title:`价格:${price.toFixed(2)}`,
|
|
57787
|
+
Color:"rgb(255, 165, 0)",
|
|
57788
|
+
},
|
|
57789
|
+
|
|
57790
|
+
Line:
|
|
57791
|
+
{
|
|
57792
|
+
Type:1, //Type 0=不画 1=直线 2=虚线
|
|
57793
|
+
//LineDash:[10,10],
|
|
57794
|
+
Color:"rgb(200,200,0)",
|
|
57795
|
+
//Width:1,
|
|
57796
|
+
},
|
|
57779
57797
|
}
|
|
57780
57798
|
}
|
|
57781
57799
|
};
|
|
@@ -57792,4 +57810,95 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
57792
57810
|
callback(apiData);
|
|
57793
57811
|
}
|
|
57794
57812
|
|
|
57813
|
+
HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
|
|
57814
|
+
{
|
|
57815
|
+
data.PreventDefault=true;
|
|
57816
|
+
var hqchart=data.HQChart;
|
|
57817
|
+
var kData=hqchart.GetKData();
|
|
57818
|
+
|
|
57819
|
+
var tableData=
|
|
57820
|
+
{
|
|
57821
|
+
name:'DRAW_SIMPLE_TABLE', type:1,
|
|
57822
|
+
Draw:
|
|
57823
|
+
{
|
|
57824
|
+
DrawType:'DRAW_SIMPLE_TABLE',
|
|
57825
|
+
DrawData:
|
|
57826
|
+
{
|
|
57827
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
57828
|
+
//BorderColor:"rgb(0,0,255)",
|
|
57829
|
+
//TextColor:"rgb(0,191,255)",
|
|
57830
|
+
TableData:
|
|
57831
|
+
[
|
|
57832
|
+
{ AryCell:[{ Text:"股票代码"}, { Text:"主营业务", TextAlign:'center'}, { Text:"每股收益(元)"}] },
|
|
57833
|
+
{ AryCell:[{ Text:"美丽生态"}, { Text:"园林绿化"}, { Text:"13.5", Color:"rgb(139,0,139)"}] },
|
|
57834
|
+
{ AryCell:[{ Text:"深物业A"}, { Text:"房地产及相关业务", BGColor:"rgb(200,200,200)"}, { Text:"0.12"}] },
|
|
57835
|
+
{ AryCell:[{ Text:"深科技"}, { Text:"计算机硬件、通讯设备等"}, { Text:"5.4"}] },
|
|
57836
|
+
],
|
|
57837
|
+
|
|
57838
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
57839
|
+
//XOffset:-10,
|
|
57840
|
+
//YOffset:-15,
|
|
57841
|
+
}
|
|
57842
|
+
}
|
|
57843
|
+
};
|
|
57844
|
+
|
|
57845
|
+
var apiData=
|
|
57846
|
+
{
|
|
57847
|
+
code:0,
|
|
57848
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57849
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
57850
|
+
};
|
|
57851
|
+
|
|
57852
|
+
|
|
57853
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_TABLE] apiData ', apiData);
|
|
57854
|
+
callback(apiData);
|
|
57855
|
+
}
|
|
57856
|
+
|
|
57857
|
+
|
|
57858
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
|
|
57859
|
+
{
|
|
57860
|
+
data.PreventDefault=true;
|
|
57861
|
+
var hqchart=data.HQChart;
|
|
57862
|
+
var kData=hqchart.GetKData();
|
|
57863
|
+
|
|
57864
|
+
var tableData=
|
|
57865
|
+
{
|
|
57866
|
+
name:'DRAW_SIMPLE_PIE', type:1,
|
|
57867
|
+
Draw:
|
|
57868
|
+
{
|
|
57869
|
+
DrawType:'DRAW_SIMPLE_PIE',
|
|
57870
|
+
DrawData:
|
|
57871
|
+
{
|
|
57872
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
57873
|
+
//BorderColor:"rgb(110,110,110)",
|
|
57874
|
+
//TextColor:"rgb(0,191,255)",
|
|
57875
|
+
Data:
|
|
57876
|
+
[
|
|
57877
|
+
{ Value:10, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
|
|
57878
|
+
{ Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
|
|
57879
|
+
{ Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
|
|
57880
|
+
{ Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
|
|
57881
|
+
{ Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
|
|
57882
|
+
],
|
|
57883
|
+
|
|
57884
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
57885
|
+
//XOffset:-10,
|
|
57886
|
+
//YOffset:-15,
|
|
57887
|
+
Radius:80,
|
|
57888
|
+
}
|
|
57889
|
+
}
|
|
57890
|
+
};
|
|
57891
|
+
|
|
57892
|
+
var apiData=
|
|
57893
|
+
{
|
|
57894
|
+
code:0,
|
|
57895
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57896
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
57897
|
+
};
|
|
57898
|
+
|
|
57899
|
+
|
|
57900
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
|
|
57901
|
+
callback(apiData);
|
|
57902
|
+
}
|
|
57903
|
+
|
|
57795
57904
|
|
|
@@ -179,7 +179,7 @@ function JSPopKeyboard()
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=
|
|
182
|
+
if ((code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122) || code==8)
|
|
183
183
|
{
|
|
184
184
|
var strText=this.InputDOM.value;
|
|
185
185
|
strText=strText.toUpperCase();
|
|
@@ -277,7 +277,7 @@ function JSPopKeyboard()
|
|
|
277
277
|
var code=event.keyCode;
|
|
278
278
|
if (code==116) return; //F5不处理
|
|
279
279
|
|
|
280
|
-
if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=
|
|
280
|
+
if (!this.IsShow() && (code>=48 && code<=57) || (code>=65 && code<=90) || (code>=96 && code<=122))
|
|
281
281
|
{
|
|
282
282
|
this.Show();
|
|
283
283
|
this.InputDOM.focus();
|
|
@@ -11540,6 +11540,30 @@ function JSDraw(errorHandler,symbolData)
|
|
|
11540
11540
|
|
|
11541
11541
|
return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
|
|
11542
11542
|
}
|
|
11543
|
+
|
|
11544
|
+
//饼图
|
|
11545
|
+
this.PIE_CELL=function(value, color, text, textColor, lineColor)
|
|
11546
|
+
{
|
|
11547
|
+
var cellItem={ Value:value, Color:color };
|
|
11548
|
+
if (text) cellItem.Text=text;
|
|
11549
|
+
if (textColor) cellItem.TextColor=textColor;
|
|
11550
|
+
if (lineColor) cellItem.LineColor=lineColor;
|
|
11551
|
+
|
|
11552
|
+
return cellItem
|
|
11553
|
+
}
|
|
11554
|
+
|
|
11555
|
+
//0=Radius半径
|
|
11556
|
+
this.DRAWPIE=function(aryData)
|
|
11557
|
+
{
|
|
11558
|
+
var radius=aryData[0];
|
|
11559
|
+
var aryCell=[];
|
|
11560
|
+
for(var i=1;i<aryData.length;++i)
|
|
11561
|
+
{
|
|
11562
|
+
aryCell.push(aryData[i]);
|
|
11563
|
+
}
|
|
11564
|
+
|
|
11565
|
+
return result={ DrawData:{ Data:aryCell, Radius:radius }, DrawType:"DRAW_SIMPLE_PIE" };
|
|
11566
|
+
}
|
|
11543
11567
|
}
|
|
11544
11568
|
|
|
11545
11569
|
|
|
@@ -11594,7 +11618,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
11594
11618
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
11595
11619
|
"VERTLINE","HORLINE","TIPICON",
|
|
11596
11620
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
11597
|
-
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
|
|
11621
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
|
|
11598
11622
|
]);
|
|
11599
11623
|
if (setFunctionName.has(name)) return true;
|
|
11600
11624
|
|
|
@@ -18475,6 +18499,14 @@ function JSExecute(ast,option)
|
|
|
18475
18499
|
node.Draw=this.Draw.DRAWTABLE(args);
|
|
18476
18500
|
node.Out=[];
|
|
18477
18501
|
break;
|
|
18502
|
+
//饼图
|
|
18503
|
+
case "PIE_CELL":
|
|
18504
|
+
node.Out=this.Draw.PIE_CELL(args[0],args[1],args[2],args[3],args[4]);
|
|
18505
|
+
break;
|
|
18506
|
+
case "DRAWPIE":
|
|
18507
|
+
node.Draw=this.Draw.DRAWPIE(args);
|
|
18508
|
+
node.Out=[];
|
|
18509
|
+
break;
|
|
18478
18510
|
|
|
18479
18511
|
default:
|
|
18480
18512
|
node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
|
|
@@ -19373,6 +19405,10 @@ function JSExplainer(ast,option)
|
|
|
19373
19405
|
["L2_VOLNUM", { Name:"L2_VOLNUM", Param:{ Count:2 }, ToString:function(args) { return `单数分档`; } }],
|
|
19374
19406
|
["L2_VOL", { Name:"L2_VOL", Param:{ Count:2 }, ToString:function(args) { return `成交量分档`; } }],
|
|
19375
19407
|
["L2_AMO", { Name:"L2_AMO", Param:{ Count:2 }, ToString:function(args) { return `成交额分档`; } }],
|
|
19408
|
+
|
|
19409
|
+
["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
|
|
19410
|
+
["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
|
|
19411
|
+
["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
|
|
19376
19412
|
|
|
19377
19413
|
]
|
|
19378
19414
|
);
|
|
@@ -21464,6 +21500,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
21464
21500
|
hqChart.ChartPaint.push(chart);
|
|
21465
21501
|
}
|
|
21466
21502
|
|
|
21503
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
21504
|
+
{
|
|
21505
|
+
var chart=new ChartSimplePie();
|
|
21506
|
+
chart.Canvas=hqChart.Canvas;
|
|
21507
|
+
chart.Name=varItem.Name;
|
|
21508
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
21509
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
21510
|
+
|
|
21511
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
21512
|
+
{
|
|
21513
|
+
var drawData=varItem.Draw.DrawData;
|
|
21514
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
21515
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
21516
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
21517
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
21518
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
21519
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
21520
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
21521
|
+
}
|
|
21522
|
+
|
|
21523
|
+
hqChart.ChartPaint.push(chart);
|
|
21524
|
+
}
|
|
21525
|
+
|
|
21467
21526
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
21468
21527
|
{
|
|
21469
21528
|
var chart=new ChartTradeIcon();
|
|
@@ -22332,6 +22391,8 @@ function ScriptIndex(name,script,args,option)
|
|
|
22332
22391
|
case "DRAW_SIMPLE_TABLE":
|
|
22333
22392
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
22334
22393
|
break;
|
|
22394
|
+
case "DRAW_SIMPLE_PIE":
|
|
22395
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
22335
22396
|
case "BUY":
|
|
22336
22397
|
case "SELL":
|
|
22337
22398
|
case "SELLSHORT":
|
|
@@ -22682,6 +22743,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
22682
22743
|
case "DRAW_SIMPLE_TABLE":
|
|
22683
22744
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
22684
22745
|
break;
|
|
22746
|
+
case "DRAW_SIMPLE_PIE":
|
|
22747
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
22685
22748
|
|
|
22686
22749
|
case "KLINE_BG":
|
|
22687
22750
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
@@ -23719,6 +23782,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
23719
23782
|
frame.ChartPaint.push(chart);
|
|
23720
23783
|
}
|
|
23721
23784
|
|
|
23785
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
23786
|
+
{
|
|
23787
|
+
var overlayIndex=this.OverlayIndex;
|
|
23788
|
+
var frame=overlayIndex.Frame;
|
|
23789
|
+
var chart=new ChartSimplePie();
|
|
23790
|
+
chart.Canvas=hqChart.Canvas;
|
|
23791
|
+
chart.Name=varItem.Name;
|
|
23792
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
23793
|
+
chart.ChartFrame=frame.Frame;
|
|
23794
|
+
chart.Identify=overlayIndex.Identify;
|
|
23795
|
+
chart.HQChart=hqChart;
|
|
23796
|
+
|
|
23797
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
23798
|
+
{
|
|
23799
|
+
var drawData=varItem.Draw.DrawData;
|
|
23800
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
23801
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
23802
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
23803
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
23804
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
23805
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
23806
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
23807
|
+
}
|
|
23808
|
+
|
|
23809
|
+
frame.ChartPaint.push(chart);
|
|
23810
|
+
}
|
|
23811
|
+
|
|
23722
23812
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
23723
23813
|
{
|
|
23724
23814
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -24921,6 +25011,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
24921
25011
|
outVarItem.Draw=drawItem;
|
|
24922
25012
|
result.push(outVarItem);
|
|
24923
25013
|
}
|
|
25014
|
+
else if (draw.DrawType=="DRAW_SIMPLE_PIE")
|
|
25015
|
+
{
|
|
25016
|
+
drawItem.Name=draw.Name;
|
|
25017
|
+
drawItem.Type=draw.Type;
|
|
25018
|
+
|
|
25019
|
+
drawItem.DrawType=draw.DrawType;
|
|
25020
|
+
drawItem.DrawData=draw.DrawData; //{ Data:[ {Value, Color, Text: }, ], BorderColor:, TextFont:{ Size:, Name: } };
|
|
25021
|
+
|
|
25022
|
+
outVarItem.Draw=drawItem;
|
|
25023
|
+
result.push(outVarItem);
|
|
25024
|
+
}
|
|
24924
25025
|
else
|
|
24925
25026
|
{
|
|
24926
25027
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -31761,6 +31761,174 @@ function ChartSimpleTable()
|
|
|
31761
31761
|
}
|
|
31762
31762
|
}
|
|
31763
31763
|
|
|
31764
|
+
|
|
31765
|
+
//饼图
|
|
31766
|
+
function ChartSimplePie()
|
|
31767
|
+
{
|
|
31768
|
+
this.newMethod=IChartPainting; //派生
|
|
31769
|
+
this.newMethod();
|
|
31770
|
+
delete this.newMethod;
|
|
31771
|
+
|
|
31772
|
+
this.ClassName='ChartSimplePie'; //类名
|
|
31773
|
+
|
|
31774
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
31775
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
31776
|
+
this.LineExtendWidth=10;
|
|
31777
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
31778
|
+
|
|
31779
|
+
this.RectClient={ };
|
|
31780
|
+
this.TotalValue=1;
|
|
31781
|
+
this.Radius = 50; //半径默认值
|
|
31782
|
+
this.TextFont;
|
|
31783
|
+
|
|
31784
|
+
|
|
31785
|
+
this.ReloadResource=function(resource)
|
|
31786
|
+
{
|
|
31787
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
31788
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
31789
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
31790
|
+
}
|
|
31791
|
+
|
|
31792
|
+
this.CalculateSize=function()
|
|
31793
|
+
{
|
|
31794
|
+
var border=this.ChartFrame.GetBorder();
|
|
31795
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
31796
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
31797
|
+
this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
|
|
31798
|
+
|
|
31799
|
+
|
|
31800
|
+
this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
|
|
31801
|
+
|
|
31802
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
31803
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
31804
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
31805
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
31806
|
+
}
|
|
31807
|
+
|
|
31808
|
+
this.CalculateTotalValue=function()
|
|
31809
|
+
{
|
|
31810
|
+
var totalValue=0;
|
|
31811
|
+
for(var i=0; i<this.Data.Data.length; ++i)
|
|
31812
|
+
{
|
|
31813
|
+
var item=this.Data.Data[i];
|
|
31814
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
31815
|
+
totalValue += item.Value;
|
|
31816
|
+
}
|
|
31817
|
+
|
|
31818
|
+
this.TotalValue=totalValue;
|
|
31819
|
+
}
|
|
31820
|
+
|
|
31821
|
+
this.DrawPie=function()
|
|
31822
|
+
{
|
|
31823
|
+
this.Canvas.font=this.TextFont;
|
|
31824
|
+
this.Canvas.textBaseline='bottom';
|
|
31825
|
+
this.Canvas.textAlign = 'left';
|
|
31826
|
+
|
|
31827
|
+
var aryText=[];
|
|
31828
|
+
var maxTextWidth=0;
|
|
31829
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
31830
|
+
{
|
|
31831
|
+
var item=this.Data.Data[i];
|
|
31832
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
31833
|
+
if (!item.Text) continue;
|
|
31834
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
31835
|
+
|
|
31836
|
+
aryText[i]={ Width:textWidth };
|
|
31837
|
+
|
|
31838
|
+
if (maxTextWidth<textWidth) maxTextWidth=textWidth;
|
|
31839
|
+
}
|
|
31840
|
+
|
|
31841
|
+
var xOffset=maxTextWidth+this.LineExtendWidth;
|
|
31842
|
+
this.RectClient.Left-=xOffset;
|
|
31843
|
+
this.RectClient.Right-=xOffset;
|
|
31844
|
+
|
|
31845
|
+
|
|
31846
|
+
var start=0, end=0;
|
|
31847
|
+
var x=this.RectClient.Left+this.Radius;
|
|
31848
|
+
var y=this.RectClient.Top+this.Radius;
|
|
31849
|
+
|
|
31850
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
31851
|
+
{
|
|
31852
|
+
var item=this.Data.Data[i];
|
|
31853
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
31854
|
+
|
|
31855
|
+
var rate=item.Value/this.TotalValue;
|
|
31856
|
+
|
|
31857
|
+
// 绘制扇形
|
|
31858
|
+
this.Canvas.beginPath();
|
|
31859
|
+
this.Canvas.moveTo(x,y);
|
|
31860
|
+
|
|
31861
|
+
end += rate*2*Math.PI;//终止角度
|
|
31862
|
+
this.Canvas.strokeStyle = this.BorderColor;
|
|
31863
|
+
this.Canvas.fillStyle = item.Color;
|
|
31864
|
+
this.Canvas.arc(x,y,this.Radius,start,end);
|
|
31865
|
+
this.Canvas.fill();
|
|
31866
|
+
this.Canvas.closePath();
|
|
31867
|
+
this.Canvas.stroke();
|
|
31868
|
+
|
|
31869
|
+
if (item.Text)
|
|
31870
|
+
{
|
|
31871
|
+
// 绘制直线
|
|
31872
|
+
var xLine=this.Radius*Math.cos(end- (end-start)/2)+x;
|
|
31873
|
+
var yLine=this.Radius*Math.sin(end - (end-start)/2)+y;
|
|
31874
|
+
var xEnd = (this.Radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
|
|
31875
|
+
var yEnd = (this.Radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
|
|
31876
|
+
|
|
31877
|
+
this.Canvas.beginPath();
|
|
31878
|
+
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
31879
|
+
else this.Canvas.strokeStyle = item.Color;
|
|
31880
|
+
this.Canvas.moveTo(xLine,yLine);
|
|
31881
|
+
this.Canvas.lineTo(xEnd,yEnd);
|
|
31882
|
+
|
|
31883
|
+
var textWidth=aryText[i].Width;
|
|
31884
|
+
var yText=xEnd;
|
|
31885
|
+
if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
|
|
31886
|
+
{
|
|
31887
|
+
this.Canvas.lineTo( xEnd - textWidth, yEnd );
|
|
31888
|
+
yText=xEnd - textWidth;
|
|
31889
|
+
}
|
|
31890
|
+
else
|
|
31891
|
+
{
|
|
31892
|
+
this.Canvas.lineTo( xEnd + textWidth, yEnd );
|
|
31893
|
+
}
|
|
31894
|
+
this.Canvas.stroke();
|
|
31895
|
+
|
|
31896
|
+
if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
|
|
31897
|
+
else this.Canvas.fillStyle=item.Color;
|
|
31898
|
+
this.Canvas.fillText(item.Text, yText, yEnd);
|
|
31899
|
+
}
|
|
31900
|
+
|
|
31901
|
+
start += rate*2*Math.PI;//起始角度
|
|
31902
|
+
}
|
|
31903
|
+
}
|
|
31904
|
+
|
|
31905
|
+
this.Draw=function()
|
|
31906
|
+
{
|
|
31907
|
+
if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
|
|
31908
|
+
|
|
31909
|
+
this.CalculateTotalValue();
|
|
31910
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
|
|
31911
|
+
this.CalculateSize();
|
|
31912
|
+
|
|
31913
|
+
this.Canvas.save();
|
|
31914
|
+
|
|
31915
|
+
this.DrawPie();
|
|
31916
|
+
|
|
31917
|
+
this.Canvas.restore();
|
|
31918
|
+
}
|
|
31919
|
+
|
|
31920
|
+
//空数据
|
|
31921
|
+
this.DrawEmptyData=function()
|
|
31922
|
+
{
|
|
31923
|
+
JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
|
|
31924
|
+
}
|
|
31925
|
+
|
|
31926
|
+
this.GetMaxMin=function()
|
|
31927
|
+
{
|
|
31928
|
+
return { Min:null, Max:null };
|
|
31929
|
+
}
|
|
31930
|
+
}
|
|
31931
|
+
|
|
31764
31932
|
//分钟成交量 支持横屏
|
|
31765
31933
|
function ChartMinuteVolumBar()
|
|
31766
31934
|
{
|
|
@@ -36318,6 +36486,7 @@ function ChartMinutePriceLine()
|
|
|
36318
36486
|
var pointCount=0;
|
|
36319
36487
|
|
|
36320
36488
|
this.Canvas.save();
|
|
36489
|
+
this.ClipClient(isHScreen);
|
|
36321
36490
|
if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
|
|
36322
36491
|
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
36323
36492
|
{
|
|
@@ -39823,8 +39992,8 @@ function ChartTextLine()
|
|
|
39823
39992
|
|
|
39824
39993
|
this.ClassName="ChartTextLine";
|
|
39825
39994
|
|
|
39826
|
-
this.Text; //
|
|
39827
|
-
this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
|
|
39995
|
+
this.Text; //{ Title:内容, Color: YOffset:, }
|
|
39996
|
+
this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
|
|
39828
39997
|
this.Price;
|
|
39829
39998
|
|
|
39830
39999
|
this.Draw=function()
|
|
@@ -39838,6 +40007,10 @@ function ChartTextLine()
|
|
|
39838
40007
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
39839
40008
|
var top=this.ChartBorder.GetTopEx();
|
|
39840
40009
|
var y=this.ChartFrame.GetYFromData(this.Price);
|
|
40010
|
+
|
|
40011
|
+
this.Canvas.save();
|
|
40012
|
+
this.ClipClient(this.IsHScreen);
|
|
40013
|
+
|
|
39841
40014
|
var textWidth=0;
|
|
39842
40015
|
if (this.Text.Title)
|
|
39843
40016
|
{
|
|
@@ -39867,23 +40040,22 @@ function ChartTextLine()
|
|
|
39867
40040
|
{
|
|
39868
40041
|
if (this.Line.Type==2) //虚线
|
|
39869
40042
|
{
|
|
39870
|
-
this.Canvas.
|
|
39871
|
-
this.Canvas.setLineDash([3,5]); //虚线
|
|
40043
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash)) this.Canvas.setLineDash(this.Line.LineDash)
|
|
40044
|
+
else this.Canvas.setLineDash([3,5]); //虚线
|
|
39872
40045
|
}
|
|
39873
40046
|
|
|
40047
|
+
if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
|
|
40048
|
+
|
|
39874
40049
|
var x=left+textWidth;
|
|
39875
40050
|
this.Canvas.strokeStyle=this.Line.Color;
|
|
39876
40051
|
this.Canvas.beginPath();
|
|
39877
40052
|
this.Canvas.moveTo(x,ToFixedPoint(y));
|
|
39878
40053
|
this.Canvas.lineTo(right,ToFixedPoint(y));
|
|
39879
40054
|
this.Canvas.stroke();
|
|
39880
|
-
|
|
39881
|
-
if (this.Line.Type==2)
|
|
39882
|
-
{
|
|
39883
|
-
this.Canvas.restore();
|
|
39884
|
-
}
|
|
39885
40055
|
}
|
|
39886
40056
|
|
|
40057
|
+
|
|
40058
|
+
this.Canvas.restore();
|
|
39887
40059
|
}
|
|
39888
40060
|
|
|
39889
40061
|
this.GetMaxMin=function()
|
|
@@ -70372,6 +70544,13 @@ function JSChartResource()
|
|
|
70372
70544
|
BorderColor:"rgb(217,217,217)",
|
|
70373
70545
|
}
|
|
70374
70546
|
|
|
70547
|
+
this.ChartSimplePie=
|
|
70548
|
+
{
|
|
70549
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
70550
|
+
BorderColor:"rgb(169,169,169)",
|
|
70551
|
+
Offset:{ X:-5, Y:5 }
|
|
70552
|
+
}
|
|
70553
|
+
|
|
70375
70554
|
//手机端tooltip
|
|
70376
70555
|
this.TooltipPaint = {
|
|
70377
70556
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -71601,6 +71780,7 @@ function JSChartResource()
|
|
|
71601
71780
|
}
|
|
71602
71781
|
|
|
71603
71782
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
71783
|
+
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
71604
71784
|
|
|
71605
71785
|
if (style.DRAWICON)
|
|
71606
71786
|
{
|
|
@@ -72673,6 +72853,27 @@ function JSChartResource()
|
|
|
72673
72853
|
}
|
|
72674
72854
|
}
|
|
72675
72855
|
|
|
72856
|
+
this.SetChartSimplePie=function(style)
|
|
72857
|
+
{
|
|
72858
|
+
var dest=this.ChartSimplePie;
|
|
72859
|
+
|
|
72860
|
+
if (style.TextFont)
|
|
72861
|
+
{
|
|
72862
|
+
var item=style.TextFont;
|
|
72863
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
72864
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
72865
|
+
}
|
|
72866
|
+
|
|
72867
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
72868
|
+
|
|
72869
|
+
if (style.Offset)
|
|
72870
|
+
{
|
|
72871
|
+
var item=style.Offset;
|
|
72872
|
+
if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
|
|
72873
|
+
if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
|
|
72874
|
+
}
|
|
72875
|
+
}
|
|
72876
|
+
|
|
72676
72877
|
}
|
|
72677
72878
|
|
|
72678
72879
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -82534,6 +82735,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
82534
82735
|
if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
|
|
82535
82736
|
{
|
|
82536
82737
|
var index=parseInt(position.CursorIndex.toFixed(0));
|
|
82738
|
+
if (index>=kData.Data.length) index=kData.Data.length-1; //未开盘的时间,取最后一个数据的收盘价
|
|
82537
82739
|
var item=kData.Data[index];
|
|
82538
82740
|
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
82539
82741
|
{
|