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
|
@@ -231,6 +231,8 @@ HQData.Minute_RequestMinuteData=function(data, callback)
|
|
|
231
231
|
}
|
|
232
232
|
*/
|
|
233
233
|
|
|
234
|
+
//stockItem.minute.length=50;
|
|
235
|
+
|
|
234
236
|
var hqchartData={code:0, stock:[stockItem] };
|
|
235
237
|
|
|
236
238
|
|
|
@@ -1856,6 +1858,11 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
1856
1858
|
HQData.APIIndex_MULTI_SVGICON(data, callback);
|
|
1857
1859
|
else if (request.Data.indexname=="API-DRAWTEXT_LINE")
|
|
1858
1860
|
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
1861
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_TABLE")
|
|
1862
|
+
HQData.APIIndex_DRAW_SIMPLE_TABLE(data, callback);
|
|
1863
|
+
else if (request.Data.indexname=="API_DRAW_SIMPLE_PIE")
|
|
1864
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE(data, callback);
|
|
1865
|
+
|
|
1859
1866
|
}
|
|
1860
1867
|
|
|
1861
1868
|
|
|
@@ -2260,8 +2267,19 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
2260
2267
|
DrawData:
|
|
2261
2268
|
{
|
|
2262
2269
|
Price:price,
|
|
2263
|
-
Text:
|
|
2264
|
-
|
|
2270
|
+
Text:
|
|
2271
|
+
{
|
|
2272
|
+
Title:`价格:${price.toFixed(2)}`,
|
|
2273
|
+
Color:"rgb(255, 165, 0)",
|
|
2274
|
+
},
|
|
2275
|
+
|
|
2276
|
+
Line:
|
|
2277
|
+
{
|
|
2278
|
+
Type:1, //Type 0=不画 1=直线 2=虚线
|
|
2279
|
+
//LineDash:[10,10],
|
|
2280
|
+
Color:"rgb(200,200,0)",
|
|
2281
|
+
//Width:1,
|
|
2282
|
+
},
|
|
2265
2283
|
}
|
|
2266
2284
|
}
|
|
2267
2285
|
};
|
|
@@ -2278,4 +2296,95 @@ HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
|
2278
2296
|
callback(apiData);
|
|
2279
2297
|
}
|
|
2280
2298
|
|
|
2299
|
+
HQData.APIIndex_DRAW_SIMPLE_TABLE=function(data, callback)
|
|
2300
|
+
{
|
|
2301
|
+
data.PreventDefault=true;
|
|
2302
|
+
var hqchart=data.HQChart;
|
|
2303
|
+
var kData=hqchart.GetKData();
|
|
2304
|
+
|
|
2305
|
+
var tableData=
|
|
2306
|
+
{
|
|
2307
|
+
name:'DRAW_SIMPLE_TABLE', type:1,
|
|
2308
|
+
Draw:
|
|
2309
|
+
{
|
|
2310
|
+
DrawType:'DRAW_SIMPLE_TABLE',
|
|
2311
|
+
DrawData:
|
|
2312
|
+
{
|
|
2313
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
2314
|
+
//BorderColor:"rgb(0,0,255)",
|
|
2315
|
+
//TextColor:"rgb(0,191,255)",
|
|
2316
|
+
TableData:
|
|
2317
|
+
[
|
|
2318
|
+
{ AryCell:[{ Text:"股票代码"}, { Text:"主营业务", TextAlign:'center'}, { Text:"每股收益(元)"}] },
|
|
2319
|
+
{ AryCell:[{ Text:"美丽生态"}, { Text:"园林绿化"}, { Text:"13.5", Color:"rgb(139,0,139)"}] },
|
|
2320
|
+
{ AryCell:[{ Text:"深物业A"}, { Text:"房地产及相关业务", BGColor:"rgb(200,200,200)"}, { Text:"0.12"}] },
|
|
2321
|
+
{ AryCell:[{ Text:"深科技"}, { Text:"计算机硬件、通讯设备等"}, { Text:"5.4"}] },
|
|
2322
|
+
],
|
|
2323
|
+
|
|
2324
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
2325
|
+
//XOffset:-10,
|
|
2326
|
+
//YOffset:-15,
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
|
|
2331
|
+
var apiData=
|
|
2332
|
+
{
|
|
2333
|
+
code:0,
|
|
2334
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
2335
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
2336
|
+
};
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_TABLE] apiData ', apiData);
|
|
2340
|
+
callback(apiData);
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
HQData.APIIndex_DRAW_SIMPLE_PIE=function(data, callback)
|
|
2345
|
+
{
|
|
2346
|
+
data.PreventDefault=true;
|
|
2347
|
+
var hqchart=data.HQChart;
|
|
2348
|
+
var kData=hqchart.GetKData();
|
|
2349
|
+
|
|
2350
|
+
var tableData=
|
|
2351
|
+
{
|
|
2352
|
+
name:'DRAW_SIMPLE_PIE', type:1,
|
|
2353
|
+
Draw:
|
|
2354
|
+
{
|
|
2355
|
+
DrawType:'DRAW_SIMPLE_PIE',
|
|
2356
|
+
DrawData:
|
|
2357
|
+
{
|
|
2358
|
+
//BGColor:"rgba(250,250,210,0.8)",
|
|
2359
|
+
//BorderColor:"rgb(110,110,110)",
|
|
2360
|
+
//TextColor:"rgb(0,191,255)",
|
|
2361
|
+
Data:
|
|
2362
|
+
[
|
|
2363
|
+
{ Value:10, Text:"数据1:10", Color:"rgba(255,182,193,0.8)", TextColor:"rgb(250,250,250)", LineColor:"rgb(255,182,193)"},
|
|
2364
|
+
{ Value:70, Text:"数据2:70", Color:"rgba(255,0,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,0,255)"},
|
|
2365
|
+
{ Value:110, Text:"数据3:110", Color:"rgba(72,61,139,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(72,61,139)"},
|
|
2366
|
+
{ Value:210, Text:"数据4:210", Color:"rgba(0,191,255,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(0,191,255)"},
|
|
2367
|
+
{ Value:310, Text:"数据5:310", Color:"rgba(255,140,0,0.8)",TextColor:"rgb(250,250,250)", LineColor:"rgb(255,140,0)"},
|
|
2368
|
+
],
|
|
2369
|
+
|
|
2370
|
+
//TextFont:{ Size:16, Name:"微软雅黑"},
|
|
2371
|
+
//XOffset:-10,
|
|
2372
|
+
//YOffset:-15,
|
|
2373
|
+
Radius:80,
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
|
|
2378
|
+
var apiData=
|
|
2379
|
+
{
|
|
2380
|
+
code:0,
|
|
2381
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
2382
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime() , outvar:[tableData] }
|
|
2383
|
+
};
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
console.log('[HQData.APIIndex_DRAW_SIMPLE_PIE] apiData ', apiData);
|
|
2387
|
+
callback(apiData);
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2281
2390
|
|
|
@@ -35686,6 +35686,174 @@ function ChartSimpleTable()
|
|
|
35686
35686
|
}
|
|
35687
35687
|
}
|
|
35688
35688
|
|
|
35689
|
+
|
|
35690
|
+
//饼图
|
|
35691
|
+
function ChartSimplePie()
|
|
35692
|
+
{
|
|
35693
|
+
this.newMethod=IChartPainting; //派生
|
|
35694
|
+
this.newMethod();
|
|
35695
|
+
delete this.newMethod;
|
|
35696
|
+
|
|
35697
|
+
this.ClassName='ChartSimplePie'; //类名
|
|
35698
|
+
|
|
35699
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
35700
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
35701
|
+
this.LineExtendWidth=10;
|
|
35702
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
35703
|
+
|
|
35704
|
+
this.RectClient={ };
|
|
35705
|
+
this.TotalValue=1;
|
|
35706
|
+
this.Radius = 50; //半径默认值
|
|
35707
|
+
this.TextFont;
|
|
35708
|
+
|
|
35709
|
+
|
|
35710
|
+
this.ReloadResource=function(resource)
|
|
35711
|
+
{
|
|
35712
|
+
this.BorderColor=g_JSChartResource.ChartSimplePie.BorderColor;
|
|
35713
|
+
this.Offset=CloneData(g_JSChartResource.ChartSimplePie.Offset);
|
|
35714
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimplePie.TextFont);
|
|
35715
|
+
}
|
|
35716
|
+
|
|
35717
|
+
this.CalculateSize=function()
|
|
35718
|
+
{
|
|
35719
|
+
var border=this.ChartFrame.GetBorder();
|
|
35720
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
35721
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
35722
|
+
this.LineExtendWidth=this.GetFontHeight(this.TextFont,"擎")+1;
|
|
35723
|
+
|
|
35724
|
+
|
|
35725
|
+
this.RectClient={ Width:this.Radius*2*pixelRatio, Height:this.Radius*2*pixelRatio };
|
|
35726
|
+
|
|
35727
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
35728
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
35729
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
35730
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
35731
|
+
}
|
|
35732
|
+
|
|
35733
|
+
this.CalculateTotalValue=function()
|
|
35734
|
+
{
|
|
35735
|
+
var totalValue=0;
|
|
35736
|
+
for(var i=0; i<this.Data.Data.length; ++i)
|
|
35737
|
+
{
|
|
35738
|
+
var item=this.Data.Data[i];
|
|
35739
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35740
|
+
totalValue += item.Value;
|
|
35741
|
+
}
|
|
35742
|
+
|
|
35743
|
+
this.TotalValue=totalValue;
|
|
35744
|
+
}
|
|
35745
|
+
|
|
35746
|
+
this.DrawPie=function()
|
|
35747
|
+
{
|
|
35748
|
+
this.Canvas.font=this.TextFont;
|
|
35749
|
+
this.Canvas.textBaseline='bottom';
|
|
35750
|
+
this.Canvas.textAlign = 'left';
|
|
35751
|
+
|
|
35752
|
+
var aryText=[];
|
|
35753
|
+
var maxTextWidth=0;
|
|
35754
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
35755
|
+
{
|
|
35756
|
+
var item=this.Data.Data[i];
|
|
35757
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35758
|
+
if (!item.Text) continue;
|
|
35759
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35760
|
+
|
|
35761
|
+
aryText[i]={ Width:textWidth };
|
|
35762
|
+
|
|
35763
|
+
if (maxTextWidth<textWidth) maxTextWidth=textWidth;
|
|
35764
|
+
}
|
|
35765
|
+
|
|
35766
|
+
var xOffset=maxTextWidth+this.LineExtendWidth;
|
|
35767
|
+
this.RectClient.Left-=xOffset;
|
|
35768
|
+
this.RectClient.Right-=xOffset;
|
|
35769
|
+
|
|
35770
|
+
|
|
35771
|
+
var start=0, end=0;
|
|
35772
|
+
var x=this.RectClient.Left+this.Radius;
|
|
35773
|
+
var y=this.RectClient.Top+this.Radius;
|
|
35774
|
+
|
|
35775
|
+
for(var i=0;i<this.Data.Data.length;++i)
|
|
35776
|
+
{
|
|
35777
|
+
var item=this.Data.Data[i];
|
|
35778
|
+
if (!IFrameSplitOperator.IsPlusNumber(item.Value)) continue;
|
|
35779
|
+
|
|
35780
|
+
var rate=item.Value/this.TotalValue;
|
|
35781
|
+
|
|
35782
|
+
// 绘制扇形
|
|
35783
|
+
this.Canvas.beginPath();
|
|
35784
|
+
this.Canvas.moveTo(x,y);
|
|
35785
|
+
|
|
35786
|
+
end += rate*2*Math.PI;//终止角度
|
|
35787
|
+
this.Canvas.strokeStyle = this.BorderColor;
|
|
35788
|
+
this.Canvas.fillStyle = item.Color;
|
|
35789
|
+
this.Canvas.arc(x,y,this.Radius,start,end);
|
|
35790
|
+
this.Canvas.fill();
|
|
35791
|
+
this.Canvas.closePath();
|
|
35792
|
+
this.Canvas.stroke();
|
|
35793
|
+
|
|
35794
|
+
if (item.Text)
|
|
35795
|
+
{
|
|
35796
|
+
// 绘制直线
|
|
35797
|
+
var xLine=this.Radius*Math.cos(end- (end-start)/2)+x;
|
|
35798
|
+
var yLine=this.Radius*Math.sin(end - (end-start)/2)+y;
|
|
35799
|
+
var xEnd = (this.Radius + this.LineExtendWidth)*Math.cos(end- (end-start)/2)+x;
|
|
35800
|
+
var yEnd = (this.Radius + this.LineExtendWidth)*Math.sin(end - (end-start)/2)+y;
|
|
35801
|
+
|
|
35802
|
+
this.Canvas.beginPath();
|
|
35803
|
+
if (item.LineColor) this.Canvas.strokeStyle =item.LineColor;
|
|
35804
|
+
else this.Canvas.strokeStyle = item.Color;
|
|
35805
|
+
this.Canvas.moveTo(xLine,yLine);
|
|
35806
|
+
this.Canvas.lineTo(xEnd,yEnd);
|
|
35807
|
+
|
|
35808
|
+
var textWidth=aryText[i].Width;
|
|
35809
|
+
var yText=xEnd;
|
|
35810
|
+
if( end - (end-start)/2 < 1.5*Math.PI && end - (end-start)/2 > 0.5*Math.PI )
|
|
35811
|
+
{
|
|
35812
|
+
this.Canvas.lineTo( xEnd - textWidth, yEnd );
|
|
35813
|
+
yText=xEnd - textWidth;
|
|
35814
|
+
}
|
|
35815
|
+
else
|
|
35816
|
+
{
|
|
35817
|
+
this.Canvas.lineTo( xEnd + textWidth, yEnd );
|
|
35818
|
+
}
|
|
35819
|
+
this.Canvas.stroke();
|
|
35820
|
+
|
|
35821
|
+
if (item.TextColor) this.Canvas.fillStyle = item.TextColor;
|
|
35822
|
+
else this.Canvas.fillStyle=item.Color;
|
|
35823
|
+
this.Canvas.fillText(item.Text, yText, yEnd);
|
|
35824
|
+
}
|
|
35825
|
+
|
|
35826
|
+
start += rate*2*Math.PI;//起始角度
|
|
35827
|
+
}
|
|
35828
|
+
}
|
|
35829
|
+
|
|
35830
|
+
this.Draw=function()
|
|
35831
|
+
{
|
|
35832
|
+
if (!this.Data || !this.Data.Data || !(this.Data.Data.length>0)) return this.DrawEmptyData();
|
|
35833
|
+
|
|
35834
|
+
this.CalculateTotalValue();
|
|
35835
|
+
if (!IFrameSplitOperator.IsPlusNumber(this.TotalValue)) this.DrawEmptyData();
|
|
35836
|
+
this.CalculateSize();
|
|
35837
|
+
|
|
35838
|
+
this.Canvas.save();
|
|
35839
|
+
|
|
35840
|
+
this.DrawPie();
|
|
35841
|
+
|
|
35842
|
+
this.Canvas.restore();
|
|
35843
|
+
}
|
|
35844
|
+
|
|
35845
|
+
//空数据
|
|
35846
|
+
this.DrawEmptyData=function()
|
|
35847
|
+
{
|
|
35848
|
+
JSConsole.Chart.Log('[ChartSimplePie::DrawEmptyData]')
|
|
35849
|
+
}
|
|
35850
|
+
|
|
35851
|
+
this.GetMaxMin=function()
|
|
35852
|
+
{
|
|
35853
|
+
return { Min:null, Max:null };
|
|
35854
|
+
}
|
|
35855
|
+
}
|
|
35856
|
+
|
|
35689
35857
|
//分钟成交量 支持横屏
|
|
35690
35858
|
function ChartMinuteVolumBar()
|
|
35691
35859
|
{
|
|
@@ -40243,6 +40411,7 @@ function ChartMinutePriceLine()
|
|
|
40243
40411
|
var pointCount=0;
|
|
40244
40412
|
|
|
40245
40413
|
this.Canvas.save();
|
|
40414
|
+
this.ClipClient(isHScreen);
|
|
40246
40415
|
if (IFrameSplitOperator.IsPlusNumber(this.LineWidth>0)) this.Canvas.lineWidth=this.LineWidth;
|
|
40247
40416
|
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
40248
40417
|
{
|
|
@@ -43748,8 +43917,8 @@ function ChartTextLine()
|
|
|
43748
43917
|
|
|
43749
43918
|
this.ClassName="ChartTextLine";
|
|
43750
43919
|
|
|
43751
|
-
this.Text; //
|
|
43752
|
-
this.Line; //Type=线段类型 0=不画 1=直线 2=虚线, Color
|
|
43920
|
+
this.Text; //{ Title:内容, Color: YOffset:, }
|
|
43921
|
+
this.Line; //{ Type=线段类型 0=不画 1=直线 2=虚线, Color:, Width:, LineDash:[] }
|
|
43753
43922
|
this.Price;
|
|
43754
43923
|
|
|
43755
43924
|
this.Draw=function()
|
|
@@ -43763,6 +43932,10 @@ function ChartTextLine()
|
|
|
43763
43932
|
var bottom=this.ChartBorder.GetBottomEx();
|
|
43764
43933
|
var top=this.ChartBorder.GetTopEx();
|
|
43765
43934
|
var y=this.ChartFrame.GetYFromData(this.Price);
|
|
43935
|
+
|
|
43936
|
+
this.Canvas.save();
|
|
43937
|
+
this.ClipClient(this.IsHScreen);
|
|
43938
|
+
|
|
43766
43939
|
var textWidth=0;
|
|
43767
43940
|
if (this.Text.Title)
|
|
43768
43941
|
{
|
|
@@ -43792,23 +43965,22 @@ function ChartTextLine()
|
|
|
43792
43965
|
{
|
|
43793
43966
|
if (this.Line.Type==2) //虚线
|
|
43794
43967
|
{
|
|
43795
|
-
this.Canvas.
|
|
43796
|
-
this.Canvas.setLineDash([3,5]); //虚线
|
|
43968
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash)) this.Canvas.setLineDash(this.Line.LineDash)
|
|
43969
|
+
else this.Canvas.setLineDash([3,5]); //虚线
|
|
43797
43970
|
}
|
|
43798
43971
|
|
|
43972
|
+
if (IFrameSplitOperator.IsNumber(this.Line.Width)) this.Canvas.lineWidth=this.Line.Width;
|
|
43973
|
+
|
|
43799
43974
|
var x=left+textWidth;
|
|
43800
43975
|
this.Canvas.strokeStyle=this.Line.Color;
|
|
43801
43976
|
this.Canvas.beginPath();
|
|
43802
43977
|
this.Canvas.moveTo(x,ToFixedPoint(y));
|
|
43803
43978
|
this.Canvas.lineTo(right,ToFixedPoint(y));
|
|
43804
43979
|
this.Canvas.stroke();
|
|
43805
|
-
|
|
43806
|
-
if (this.Line.Type==2)
|
|
43807
|
-
{
|
|
43808
|
-
this.Canvas.restore();
|
|
43809
|
-
}
|
|
43810
43980
|
}
|
|
43811
43981
|
|
|
43982
|
+
|
|
43983
|
+
this.Canvas.restore();
|
|
43812
43984
|
}
|
|
43813
43985
|
|
|
43814
43986
|
this.GetMaxMin=function()
|
|
@@ -74297,6 +74469,13 @@ function JSChartResource()
|
|
|
74297
74469
|
BorderColor:"rgb(217,217,217)",
|
|
74298
74470
|
}
|
|
74299
74471
|
|
|
74472
|
+
this.ChartSimplePie=
|
|
74473
|
+
{
|
|
74474
|
+
TextFont:{ Family:'微软雅黑' , Size:12 },
|
|
74475
|
+
BorderColor:"rgb(169,169,169)",
|
|
74476
|
+
Offset:{ X:-5, Y:5 }
|
|
74477
|
+
}
|
|
74478
|
+
|
|
74300
74479
|
//手机端tooltip
|
|
74301
74480
|
this.TooltipPaint = {
|
|
74302
74481
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -75526,6 +75705,7 @@ function JSChartResource()
|
|
|
75526
75705
|
}
|
|
75527
75706
|
|
|
75528
75707
|
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
75708
|
+
if (style.ChartSimplePie) this.SetChartSimplePie(style.ChartSimplePie);
|
|
75529
75709
|
|
|
75530
75710
|
if (style.DRAWICON)
|
|
75531
75711
|
{
|
|
@@ -76598,6 +76778,27 @@ function JSChartResource()
|
|
|
76598
76778
|
}
|
|
76599
76779
|
}
|
|
76600
76780
|
|
|
76781
|
+
this.SetChartSimplePie=function(style)
|
|
76782
|
+
{
|
|
76783
|
+
var dest=this.ChartSimplePie;
|
|
76784
|
+
|
|
76785
|
+
if (style.TextFont)
|
|
76786
|
+
{
|
|
76787
|
+
var item=style.TextFont;
|
|
76788
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
76789
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
76790
|
+
}
|
|
76791
|
+
|
|
76792
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
76793
|
+
|
|
76794
|
+
if (style.Offset)
|
|
76795
|
+
{
|
|
76796
|
+
var item=style.Offset;
|
|
76797
|
+
if (IFrameSplitOperator.IsNumber(item.X)) dest.Offset.X=item.X;
|
|
76798
|
+
if (IFrameSplitOperator.IsNumber(item.Y)) dest.Offset.Y=item.Y;
|
|
76799
|
+
}
|
|
76800
|
+
}
|
|
76801
|
+
|
|
76601
76802
|
}
|
|
76602
76803
|
|
|
76603
76804
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -86459,6 +86660,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
|
|
|
86459
86660
|
if (kData && IFrameSplitOperator.IsNonEmptyArray(kData.Data))
|
|
86460
86661
|
{
|
|
86461
86662
|
var index=parseInt(position.CursorIndex.toFixed(0));
|
|
86663
|
+
if (index>=kData.Data.length) index=kData.Data.length-1; //未开盘的时间,取最后一个数据的收盘价
|
|
86462
86664
|
var item=kData.Data[index];
|
|
86463
86665
|
if (item && IFrameSplitOperator.IsNumber(item.Close))
|
|
86464
86666
|
{
|
|
@@ -111826,6 +112028,30 @@ function JSDraw(errorHandler,symbolData)
|
|
|
111826
112028
|
|
|
111827
112029
|
return result={ DrawData:{ TableData:tableData }, DrawType:'DRAW_SIMPLE_TABLE' };
|
|
111828
112030
|
}
|
|
112031
|
+
|
|
112032
|
+
//饼图
|
|
112033
|
+
this.PIE_CELL=function(value, color, text, textColor, lineColor)
|
|
112034
|
+
{
|
|
112035
|
+
var cellItem={ Value:value, Color:color };
|
|
112036
|
+
if (text) cellItem.Text=text;
|
|
112037
|
+
if (textColor) cellItem.TextColor=textColor;
|
|
112038
|
+
if (lineColor) cellItem.LineColor=lineColor;
|
|
112039
|
+
|
|
112040
|
+
return cellItem
|
|
112041
|
+
}
|
|
112042
|
+
|
|
112043
|
+
//0=Radius半径
|
|
112044
|
+
this.DRAWPIE=function(aryData)
|
|
112045
|
+
{
|
|
112046
|
+
var radius=aryData[0];
|
|
112047
|
+
var aryCell=[];
|
|
112048
|
+
for(var i=1;i<aryData.length;++i)
|
|
112049
|
+
{
|
|
112050
|
+
aryCell.push(aryData[i]);
|
|
112051
|
+
}
|
|
112052
|
+
|
|
112053
|
+
return result={ DrawData:{ Data:aryCell, Radius:radius }, DrawType:"DRAW_SIMPLE_PIE" };
|
|
112054
|
+
}
|
|
111829
112055
|
}
|
|
111830
112056
|
|
|
111831
112057
|
|
|
@@ -111880,7 +112106,7 @@ JSDraw.prototype.IsDrawFunction=function(name)
|
|
|
111880
112106
|
'DRAWOVERLAYLINE',"FILLRGN", "FILLRGN2","FILLTOPRGN", "FILLBOTTOMRGN", "FILLVERTICALRGN","FLOATRGN","DRAWSL", "DRAWGBK2","DRAWGBK_DIV",
|
|
111881
112107
|
"VERTLINE","HORLINE","TIPICON",
|
|
111882
112108
|
"BUY","SELL","SELLSHORT","BUYSHORT",
|
|
111883
|
-
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE",
|
|
112109
|
+
"DRAWLASTBARICON","DRAWLASTBARNUMBER", "DRAWLASTBARTEXT","DRAWTABLE","DRAWPIE",
|
|
111884
112110
|
]);
|
|
111885
112111
|
if (setFunctionName.has(name)) return true;
|
|
111886
112112
|
|
|
@@ -118761,6 +118987,14 @@ function JSExecute(ast,option)
|
|
|
118761
118987
|
node.Draw=this.Draw.DRAWTABLE(args);
|
|
118762
118988
|
node.Out=[];
|
|
118763
118989
|
break;
|
|
118990
|
+
//饼图
|
|
118991
|
+
case "PIE_CELL":
|
|
118992
|
+
node.Out=this.Draw.PIE_CELL(args[0],args[1],args[2],args[3],args[4]);
|
|
118993
|
+
break;
|
|
118994
|
+
case "DRAWPIE":
|
|
118995
|
+
node.Draw=this.Draw.DRAWPIE(args);
|
|
118996
|
+
node.Out=[];
|
|
118997
|
+
break;
|
|
118764
118998
|
|
|
118765
118999
|
default:
|
|
118766
119000
|
node.Out=this.Algorithm.CallFunction(funcName, args, node, this.SymbolData);
|
|
@@ -119659,6 +119893,10 @@ function JSExplainer(ast,option)
|
|
|
119659
119893
|
["L2_VOLNUM", { Name:"L2_VOLNUM", Param:{ Count:2 }, ToString:function(args) { return `单数分档`; } }],
|
|
119660
119894
|
["L2_VOL", { Name:"L2_VOL", Param:{ Count:2 }, ToString:function(args) { return `成交量分档`; } }],
|
|
119661
119895
|
["L2_AMO", { Name:"L2_AMO", Param:{ Count:2 }, ToString:function(args) { return `成交额分档`; } }],
|
|
119896
|
+
|
|
119897
|
+
["TABLE_CELL", { Name:"TABLE_CELL",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格单元格`; } }],
|
|
119898
|
+
["TABLE_ROW", { Name:"TABLE_ROW",Param:{ Dynamic:true }, ToString:function(args) { return `创建表格行`; } }],
|
|
119899
|
+
["DRAWTABLE", { Name:"DRAWTABLE",Param:{ Dynamic:true }, ToString:function(args) { return `绘制表格`; } }]
|
|
119662
119900
|
|
|
119663
119901
|
]
|
|
119664
119902
|
);
|
|
@@ -121750,6 +121988,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
121750
121988
|
hqChart.ChartPaint.push(chart);
|
|
121751
121989
|
}
|
|
121752
121990
|
|
|
121991
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
121992
|
+
{
|
|
121993
|
+
var chart=new ChartSimplePie();
|
|
121994
|
+
chart.Canvas=hqChart.Canvas;
|
|
121995
|
+
chart.Name=varItem.Name;
|
|
121996
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
121997
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
121998
|
+
|
|
121999
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
122000
|
+
{
|
|
122001
|
+
var drawData=varItem.Draw.DrawData;
|
|
122002
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
122003
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
122004
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
122005
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
122006
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
122007
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
122008
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
122009
|
+
}
|
|
122010
|
+
|
|
122011
|
+
hqChart.ChartPaint.push(chart);
|
|
122012
|
+
}
|
|
122013
|
+
|
|
121753
122014
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
121754
122015
|
{
|
|
121755
122016
|
var chart=new ChartTradeIcon();
|
|
@@ -122618,6 +122879,8 @@ function ScriptIndex(name,script,args,option)
|
|
|
122618
122879
|
case "DRAW_SIMPLE_TABLE":
|
|
122619
122880
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122620
122881
|
break;
|
|
122882
|
+
case "DRAW_SIMPLE_PIE":
|
|
122883
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
122621
122884
|
case "BUY":
|
|
122622
122885
|
case "SELL":
|
|
122623
122886
|
case "SELLSHORT":
|
|
@@ -122968,6 +123231,8 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
122968
123231
|
case "DRAW_SIMPLE_TABLE":
|
|
122969
123232
|
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122970
123233
|
break;
|
|
123234
|
+
case "DRAW_SIMPLE_PIE":
|
|
123235
|
+
this.CreateSimplePie(hqChart,windowIndex,item,i);
|
|
122971
123236
|
|
|
122972
123237
|
case "KLINE_BG":
|
|
122973
123238
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
@@ -124005,6 +124270,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
124005
124270
|
frame.ChartPaint.push(chart);
|
|
124006
124271
|
}
|
|
124007
124272
|
|
|
124273
|
+
this.CreateSimplePie=function(hqChart,windowIndex,varItem,id)
|
|
124274
|
+
{
|
|
124275
|
+
var overlayIndex=this.OverlayIndex;
|
|
124276
|
+
var frame=overlayIndex.Frame;
|
|
124277
|
+
var chart=new ChartSimplePie();
|
|
124278
|
+
chart.Canvas=hqChart.Canvas;
|
|
124279
|
+
chart.Name=varItem.Name;
|
|
124280
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
124281
|
+
chart.ChartFrame=frame.Frame;
|
|
124282
|
+
chart.Identify=overlayIndex.Identify;
|
|
124283
|
+
chart.HQChart=hqChart;
|
|
124284
|
+
|
|
124285
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
124286
|
+
{
|
|
124287
|
+
var drawData=varItem.Draw.DrawData;
|
|
124288
|
+
if (drawData.Data) chart.Data.Data=drawData.Data;
|
|
124289
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
124290
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
124291
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
124292
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
124293
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
124294
|
+
if (IFrameSplitOperator.IsPlusNumber(drawData.Radius)) chart.Radius=drawData.Radius;
|
|
124295
|
+
}
|
|
124296
|
+
|
|
124297
|
+
frame.ChartPaint.push(chart);
|
|
124298
|
+
}
|
|
124299
|
+
|
|
124008
124300
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
124009
124301
|
{
|
|
124010
124302
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -125207,6 +125499,17 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
125207
125499
|
outVarItem.Draw=drawItem;
|
|
125208
125500
|
result.push(outVarItem);
|
|
125209
125501
|
}
|
|
125502
|
+
else if (draw.DrawType=="DRAW_SIMPLE_PIE")
|
|
125503
|
+
{
|
|
125504
|
+
drawItem.Name=draw.Name;
|
|
125505
|
+
drawItem.Type=draw.Type;
|
|
125506
|
+
|
|
125507
|
+
drawItem.DrawType=draw.DrawType;
|
|
125508
|
+
drawItem.DrawData=draw.DrawData; //{ Data:[ {Value, Color, Text: }, ], BorderColor:, TextFont:{ Size:, Name: } };
|
|
125509
|
+
|
|
125510
|
+
outVarItem.Draw=drawItem;
|
|
125511
|
+
result.push(outVarItem);
|
|
125512
|
+
}
|
|
125210
125513
|
else
|
|
125211
125514
|
{
|
|
125212
125515
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -126818,6 +127121,11 @@ function GetBlackStyle()
|
|
|
126818
127121
|
BorderColor:"rgb(90,90,90)",
|
|
126819
127122
|
},
|
|
126820
127123
|
|
|
127124
|
+
ChartSimplePie:
|
|
127125
|
+
{
|
|
127126
|
+
BorderColor:"rgb(220,220,220)",
|
|
127127
|
+
},
|
|
127128
|
+
|
|
126821
127129
|
ChartDrawVolProfile:
|
|
126822
127130
|
{
|
|
126823
127131
|
BGColor:"rgba(244,250,254,0.3)",
|
|
@@ -141353,7 +141661,7 @@ function ScrollBarBGChart()
|
|
|
141353
141661
|
|
|
141354
141662
|
|
|
141355
141663
|
|
|
141356
|
-
var HQCHART_VERSION="1.1.
|
|
141664
|
+
var HQCHART_VERSION="1.1.14304";
|
|
141357
141665
|
|
|
141358
141666
|
function PrintHQChartVersion()
|
|
141359
141667
|
{
|