hqchart 1.1.14276 → 1.1.14283
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 +37 -17
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +39 -0
- package/src/jscommon/umychart.complier.js +81 -0
- package/src/jscommon/umychart.js +257 -1
- package/src/jscommon/umychart.report.js +128 -0
- package/src/jscommon/umychart.style.js +7 -0
- package/src/jscommon/umychart.testdata.js +39 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +474 -2
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +39 -0
- package/src/jscommon/umychart.vue/umychart.vue.js +474 -2
|
@@ -57386,6 +57386,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57386
57386
|
HQData.APIIndex_MULTI_LINE(data, callback);
|
|
57387
57387
|
else if (request.Data.indexname=="API-MULTI_SVGICON")
|
|
57388
57388
|
HQData.APIIndex_MULTI_SVGICON(data, callback);
|
|
57389
|
+
else if (request.Data.indexname=="API-DRAWTEXT_LINE")
|
|
57390
|
+
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
57389
57391
|
}
|
|
57390
57392
|
|
|
57391
57393
|
|
|
@@ -57772,6 +57774,43 @@ HQData.APIIndex_MULTI_SVGICON=function(data, callback)
|
|
|
57772
57774
|
}
|
|
57773
57775
|
|
|
57774
57776
|
|
|
57777
|
+
HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
57778
|
+
{
|
|
57779
|
+
data.PreventDefault=true;
|
|
57780
|
+
var hqchart=data.HQChart;
|
|
57781
|
+
var kData=hqchart.GetKData();
|
|
57782
|
+
|
|
57783
|
+
var lastItem=kData.Data[kData.Data.length-1];
|
|
57784
|
+
var price=(lastItem.High+lastItem.Low)/2;
|
|
57785
|
+
|
|
57786
|
+
var lineData=
|
|
57787
|
+
{
|
|
57788
|
+
name:'DRAWTEXT_LINE', type:1,
|
|
57789
|
+
Draw:
|
|
57790
|
+
{
|
|
57791
|
+
DrawType:'DRAWTEXT_LINE',
|
|
57792
|
+
DrawData:
|
|
57793
|
+
{
|
|
57794
|
+
Price:price,
|
|
57795
|
+
Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
|
|
57796
|
+
Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
|
|
57797
|
+
}
|
|
57798
|
+
}
|
|
57799
|
+
};
|
|
57800
|
+
|
|
57801
|
+
var apiData=
|
|
57802
|
+
{
|
|
57803
|
+
code:0,
|
|
57804
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
57805
|
+
outdata: { date:kData.GetDate() , outvar:[lineData] }
|
|
57806
|
+
};
|
|
57807
|
+
|
|
57808
|
+
|
|
57809
|
+
console.log('[HQData.APIIndex_DRAWTEXT_LINE] apiData ', apiData);
|
|
57810
|
+
callback(apiData);
|
|
57811
|
+
}
|
|
57812
|
+
|
|
57813
|
+
|
|
57775
57814
|
|
|
57776
57815
|
|
|
57777
57816
|
/*暴露外部用的方法*/
|
|
@@ -35470,6 +35470,225 @@ function ChartKLineTable()
|
|
|
35470
35470
|
}
|
|
35471
35471
|
}
|
|
35472
35472
|
|
|
35473
|
+
//表格
|
|
35474
|
+
function ChartSimpleTable()
|
|
35475
|
+
{
|
|
35476
|
+
this.newMethod=IChartPainting; //派生
|
|
35477
|
+
this.newMethod();
|
|
35478
|
+
delete this.newMethod;
|
|
35479
|
+
|
|
35480
|
+
this.ClassName='ChartSimpleTable'; //类名
|
|
35481
|
+
//this.Data;
|
|
35482
|
+
|
|
35483
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
|
|
35484
|
+
this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
|
|
35485
|
+
this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
|
|
35486
|
+
this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
|
|
35487
|
+
this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
|
|
35488
|
+
this.Offset={ X:-3, Y:0 }, //位置偏移
|
|
35489
|
+
|
|
35490
|
+
|
|
35491
|
+
this.DefaultCellWidth=30;
|
|
35492
|
+
|
|
35493
|
+
this.RectClient={ };
|
|
35494
|
+
this.AryColumnCache=[]; //列缓存
|
|
35495
|
+
this.TextFontHeight;
|
|
35496
|
+
this.TextFont;
|
|
35497
|
+
this.RowHeight; //行高
|
|
35498
|
+
|
|
35499
|
+
this.ReloadResource=function(resource)
|
|
35500
|
+
{
|
|
35501
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
|
|
35502
|
+
this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
|
|
35503
|
+
this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
|
|
35504
|
+
this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
|
|
35505
|
+
this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
|
|
35506
|
+
}
|
|
35507
|
+
|
|
35508
|
+
this.CalculateSize=function()
|
|
35509
|
+
{
|
|
35510
|
+
this.AryColumnCache=[];
|
|
35511
|
+
|
|
35512
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
35513
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
35514
|
+
this.TextFontHeight=this.GetFontHeight(this.TextFont,"擎");
|
|
35515
|
+
this.RowHeight=this.TextFontHeight+this.ItemMargin.Top+this.ItemMargin.Bottom;
|
|
35516
|
+
|
|
35517
|
+
var rowCount=this.Data.Data.length;
|
|
35518
|
+
for(var i=0, j=0;i<rowCount;++i)
|
|
35519
|
+
{
|
|
35520
|
+
var rowItem=this.Data.Data[i];
|
|
35521
|
+
for(j=0;j<rowItem.AryCell.length;++j)
|
|
35522
|
+
{
|
|
35523
|
+
if (!this.AryColumnCache[j]) this.AryColumnCache[j]={ Width:this.DefaultCellWidth };
|
|
35524
|
+
var colItem=this.AryColumnCache[j];
|
|
35525
|
+
|
|
35526
|
+
var cellItem=rowItem.AryCell[j];
|
|
35527
|
+
var textWidth=this.Canvas.measureText(cellItem.Text).width;
|
|
35528
|
+
if (colItem.Width<textWidth) colItem.Width=textWidth;
|
|
35529
|
+
}
|
|
35530
|
+
}
|
|
35531
|
+
|
|
35532
|
+
var tableWidth=0;
|
|
35533
|
+
for(var i=0;i<this.AryColumnCache.length;++i)
|
|
35534
|
+
{
|
|
35535
|
+
var item=this.AryColumnCache[i];
|
|
35536
|
+
item.Width+=(this.ItemMargin.Left+this.ItemMargin.Right); //增加左右间距
|
|
35537
|
+
|
|
35538
|
+
tableWidth+=item.Width;
|
|
35539
|
+
}
|
|
35540
|
+
|
|
35541
|
+
this.RectClient={ Width:tableWidth, Height:this.RowHeight*rowCount };
|
|
35542
|
+
|
|
35543
|
+
var border=this.ChartFrame.GetBorder();
|
|
35544
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
35545
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
35546
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
35547
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
35548
|
+
}
|
|
35549
|
+
|
|
35550
|
+
this.Draw=function()
|
|
35551
|
+
{
|
|
35552
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
35553
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
35554
|
+
|
|
35555
|
+
var isHScreen=(this.ChartFrame.IsHScreen===true);
|
|
35556
|
+
if (isHScreen) return;
|
|
35557
|
+
|
|
35558
|
+
this.CalculateSize();
|
|
35559
|
+
|
|
35560
|
+
if (this.BGColor)
|
|
35561
|
+
{
|
|
35562
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
35563
|
+
this.Canvas.fillRect(this.RectClient.Left, this.RectClient.Top, this.RectClient.Width, this.RectClient.Height);
|
|
35564
|
+
}
|
|
35565
|
+
|
|
35566
|
+
var itemHeight=this.RowHeight;
|
|
35567
|
+
this.Canvas.font=this.TextFont;
|
|
35568
|
+
this.Canvas.textBaseline='bottom';
|
|
35569
|
+
this.Canvas.textAlign='left';
|
|
35570
|
+
var rtRow={ Left:this.RectClient.Left, Top:this.RectClient.Top, Width:this.RectClient.Width, Height:itemHeight };
|
|
35571
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
35572
|
+
rtRow.Bottom=rtRow.Top+rtRow.Height;
|
|
35573
|
+
var rowCount=this.Data.Data.length;
|
|
35574
|
+
for(var i=0;i<rowCount;++i)
|
|
35575
|
+
{
|
|
35576
|
+
var rowItem=this.Data.Data[i];
|
|
35577
|
+
this.DrawRow(rowItem, rtRow);
|
|
35578
|
+
|
|
35579
|
+
rtRow.Top+=itemHeight;
|
|
35580
|
+
rtRow.Bottom+=itemHeight;
|
|
35581
|
+
}
|
|
35582
|
+
|
|
35583
|
+
this.DrawBorder();
|
|
35584
|
+
}
|
|
35585
|
+
|
|
35586
|
+
this.DrawBorder=function()
|
|
35587
|
+
{
|
|
35588
|
+
if (!this.BorderColor) return;
|
|
35589
|
+
|
|
35590
|
+
var rowCount=this.Data.Data.length;
|
|
35591
|
+
var colCount=this.AryColumnCache.length;
|
|
35592
|
+
this.Canvas.strokeStyle=this.BorderColor;
|
|
35593
|
+
this.Canvas.beginPath();
|
|
35594
|
+
|
|
35595
|
+
//横线
|
|
35596
|
+
var rowTop=this.RectClient.Top;
|
|
35597
|
+
var left=this.RectClient.Left, right=this.RectClient.Right;
|
|
35598
|
+
var bottom=this.RectClient.Bottom, top=this.RectClient.Top;
|
|
35599
|
+
for(var i=0;i<rowCount;++i)
|
|
35600
|
+
{
|
|
35601
|
+
if (i==0)
|
|
35602
|
+
{
|
|
35603
|
+
var drawTop=ToFixedPoint(rowTop);
|
|
35604
|
+
this.Canvas.moveTo(left,drawTop);
|
|
35605
|
+
this.Canvas.lineTo(right,drawTop);
|
|
35606
|
+
}
|
|
35607
|
+
|
|
35608
|
+
var drawTop=ToFixedPoint(rowTop+this.RowHeight);
|
|
35609
|
+
this.Canvas.moveTo(left,drawTop);
|
|
35610
|
+
this.Canvas.lineTo(right,drawTop);
|
|
35611
|
+
|
|
35612
|
+
rowTop+=this.RowHeight;
|
|
35613
|
+
}
|
|
35614
|
+
|
|
35615
|
+
//竖线
|
|
35616
|
+
var columnLeft=this.RectClient.Left;
|
|
35617
|
+
for(var i=0;i<colCount; ++i)
|
|
35618
|
+
{
|
|
35619
|
+
var item=this.AryColumnCache[i];
|
|
35620
|
+
|
|
35621
|
+
if (i==0)
|
|
35622
|
+
{
|
|
35623
|
+
var drawLeft=ToFixedPoint(columnLeft);
|
|
35624
|
+
this.Canvas.moveTo(drawLeft,top);
|
|
35625
|
+
this.Canvas.lineTo(drawLeft,bottom);
|
|
35626
|
+
}
|
|
35627
|
+
|
|
35628
|
+
var drawLeft=ToFixedPoint(columnLeft+item.Width);
|
|
35629
|
+
this.Canvas.moveTo(drawLeft,top);
|
|
35630
|
+
this.Canvas.lineTo(drawLeft,bottom);
|
|
35631
|
+
|
|
35632
|
+
columnLeft+=item.Width;
|
|
35633
|
+
}
|
|
35634
|
+
|
|
35635
|
+
this.Canvas.stroke();
|
|
35636
|
+
}
|
|
35637
|
+
|
|
35638
|
+
this.DrawRow=function(data, rtRow)
|
|
35639
|
+
{
|
|
35640
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.AryCell)) return;
|
|
35641
|
+
|
|
35642
|
+
var x=rtRow.Left,y=rtRow.Top, width=rtRow.Width;
|
|
35643
|
+
for(var i=0;i<data.AryCell.length;++i)
|
|
35644
|
+
{
|
|
35645
|
+
var item=data.AryCell[i];
|
|
35646
|
+
var colItem=this.AryColumnCache[i];
|
|
35647
|
+
|
|
35648
|
+
var rtBG={Left:x, Top:rtRow.Top, Bottom:rtRow.Bottom, Height:this.RowHeight, Width:colItem.Width };
|
|
35649
|
+
rtBG.Right=rtBG.Top+rtBG.Height;
|
|
35650
|
+
|
|
35651
|
+
if (item)
|
|
35652
|
+
{
|
|
35653
|
+
if (item.BGColor)
|
|
35654
|
+
{
|
|
35655
|
+
this.Canvas.fillStyle=item.BGColor;
|
|
35656
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
35657
|
+
}
|
|
35658
|
+
|
|
35659
|
+
if (item.Text && rtBG.Width>10)
|
|
35660
|
+
{
|
|
35661
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
35662
|
+
else this.Canvas.fillStyle=this.TextColor
|
|
35663
|
+
|
|
35664
|
+
var xText=x+this.ItemMargin.Left;
|
|
35665
|
+
var yText=rtBG.Bottom-this.ItemMargin.Bottom;
|
|
35666
|
+
|
|
35667
|
+
if (item.TextAlign=='right')
|
|
35668
|
+
{
|
|
35669
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35670
|
+
xText=rtBG.Right-this.ItemMargin.Right-textWidth;
|
|
35671
|
+
}
|
|
35672
|
+
else if (item.TextAlign=='center')
|
|
35673
|
+
{
|
|
35674
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35675
|
+
xText=rtBG.Left+rtBG.Width/2-textWidth/2;
|
|
35676
|
+
}
|
|
35677
|
+
|
|
35678
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
35679
|
+
}
|
|
35680
|
+
}
|
|
35681
|
+
|
|
35682
|
+
x+=rtBG.Width;
|
|
35683
|
+
}
|
|
35684
|
+
}
|
|
35685
|
+
|
|
35686
|
+
this.GetMaxMin=function()
|
|
35687
|
+
{
|
|
35688
|
+
return { Min:null, Max:null };
|
|
35689
|
+
}
|
|
35690
|
+
}
|
|
35691
|
+
|
|
35473
35692
|
//分钟成交量 支持横屏
|
|
35474
35693
|
function ChartMinuteVolumBar()
|
|
35475
35694
|
{
|
|
@@ -74066,6 +74285,15 @@ function JSChartResource()
|
|
|
74066
74285
|
ItemMergin:{ Left:5, Right:5, Top:4, Bottom:2 },
|
|
74067
74286
|
};
|
|
74068
74287
|
|
|
74288
|
+
this.ChartSimpleTable=
|
|
74289
|
+
{
|
|
74290
|
+
TextFont:{ Family:'微软雅黑' , Size:14 },
|
|
74291
|
+
ItemMargin:{ Left:5, Right:5, Top:4, Bottom:2 },
|
|
74292
|
+
TextColor:"rgb(0,0,0)",
|
|
74293
|
+
BGColor:"rgba(255,255,255,0.95)",
|
|
74294
|
+
BorderColor:"rgb(217,217,217)",
|
|
74295
|
+
}
|
|
74296
|
+
|
|
74069
74297
|
//手机端tooltip
|
|
74070
74298
|
this.TooltipPaint = {
|
|
74071
74299
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -75294,6 +75522,8 @@ function JSChartResource()
|
|
|
75294
75522
|
if (style.Title.PositionColor) this.Title.PositionColor=style.Title.PositionColor;
|
|
75295
75523
|
}
|
|
75296
75524
|
|
|
75525
|
+
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
75526
|
+
|
|
75297
75527
|
if (style.DRAWICON)
|
|
75298
75528
|
{
|
|
75299
75529
|
if (style.DRAWICON.Icon)
|
|
@@ -75553,7 +75783,7 @@ function JSChartResource()
|
|
|
75553
75783
|
{
|
|
75554
75784
|
var mergin=header.Mergin;
|
|
75555
75785
|
if (IFrameSplitOperator.IsNumber(mergin.Left)) this.DealList.Header.Mergin.Left=mergin.Left;
|
|
75556
|
-
if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.
|
|
75786
|
+
if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.Right=mergin.Right;
|
|
75557
75787
|
if (IFrameSplitOperator.IsNumber(mergin.Top)) this.DealList.Header.Mergin.Top=mergin.Top;
|
|
75558
75788
|
if (IFrameSplitOperator.IsNumber(mergin.Bottom)) this.DealList.Header.Mergin.Bottom=mergin.Bottom;
|
|
75559
75789
|
}
|
|
@@ -76339,6 +76569,32 @@ function JSChartResource()
|
|
|
76339
76569
|
if (IFrameSplitOperator.IsBool(style.AddIndexWindow)) dest.AddIndexWindow=style.AddIndexWindow;
|
|
76340
76570
|
}
|
|
76341
76571
|
|
|
76572
|
+
|
|
76573
|
+
this.SetChartSimpleTable=function(style)
|
|
76574
|
+
{
|
|
76575
|
+
var dest=this.ChartSimpleTable;
|
|
76576
|
+
|
|
76577
|
+
if (style.TextColor) dest.TextColor=style.TextColor;
|
|
76578
|
+
if (style.BGColor) dest.BGColor=style.BGColor;
|
|
76579
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
76580
|
+
|
|
76581
|
+
if (style.TextFont)
|
|
76582
|
+
{
|
|
76583
|
+
var item=style.TextFont;
|
|
76584
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
76585
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
76586
|
+
}
|
|
76587
|
+
|
|
76588
|
+
if (style.ItemMargin)
|
|
76589
|
+
{
|
|
76590
|
+
var margin=style.ItemMargin;
|
|
76591
|
+
if (IFrameSplitOperator.IsNumber(margin.Left)) dest.ItemMargin.Left=margin.Left;
|
|
76592
|
+
if (IFrameSplitOperator.IsNumber(margin.Right)) dest.ItemMargin.Right=margin.Right;
|
|
76593
|
+
if (IFrameSplitOperator.IsNumber(margin.Top)) dest.ItemMargin.Top=margin.Top;
|
|
76594
|
+
if (IFrameSplitOperator.IsNumber(margin.Bottom)) dest.ItemMargin.Bottom=margin.Bottom;
|
|
76595
|
+
}
|
|
76596
|
+
}
|
|
76597
|
+
|
|
76342
76598
|
}
|
|
76343
76599
|
|
|
76344
76600
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -121213,6 +121469,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
121213
121469
|
hqChart.ChartPaint.push(chart);
|
|
121214
121470
|
}
|
|
121215
121471
|
|
|
121472
|
+
this.CreateSimpleTable=function(hqChart,windowIndex,varItem,id)
|
|
121473
|
+
{
|
|
121474
|
+
var chart=new ChartSimpleTable();
|
|
121475
|
+
chart.Canvas=hqChart.Canvas;
|
|
121476
|
+
chart.Name=varItem.Name;
|
|
121477
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
121478
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
121479
|
+
|
|
121480
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
121481
|
+
{
|
|
121482
|
+
var drawData=varItem.Draw.DrawData;
|
|
121483
|
+
if (drawData.TableData) chart.Data.Data=drawData.TableData;
|
|
121484
|
+
if (drawData.BGColor) chart.BGColor=drawData.BGColor;
|
|
121485
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
121486
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
121487
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
121488
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
121489
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
121490
|
+
}
|
|
121491
|
+
|
|
121492
|
+
hqChart.ChartPaint.push(chart);
|
|
121493
|
+
}
|
|
121494
|
+
|
|
121216
121495
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
121217
121496
|
{
|
|
121218
121497
|
var chart=new ChartTradeIcon();
|
|
@@ -122078,6 +122357,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
122078
122357
|
case "MULTI_POINT_LINE":
|
|
122079
122358
|
this.CreateLineMultiData(hqChart,windowIndex,item,i);
|
|
122080
122359
|
break;
|
|
122360
|
+
case "DRAW_SIMPLE_TABLE":
|
|
122361
|
+
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122362
|
+
break;
|
|
122081
122363
|
case "BUY":
|
|
122082
122364
|
case "SELL":
|
|
122083
122365
|
case "SELLSHORT":
|
|
@@ -122425,6 +122707,10 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
122425
122707
|
this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
|
|
122426
122708
|
break;
|
|
122427
122709
|
|
|
122710
|
+
case "DRAW_SIMPLE_TABLE":
|
|
122711
|
+
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122712
|
+
break;
|
|
122713
|
+
|
|
122428
122714
|
case "KLINE_BG":
|
|
122429
122715
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
122430
122716
|
break;
|
|
@@ -123434,6 +123720,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
123434
123720
|
frame.ChartPaint.push(chart);
|
|
123435
123721
|
}
|
|
123436
123722
|
|
|
123723
|
+
this.CreateSimpleTable=function(hqChart,windowIndex,varItem,i)
|
|
123724
|
+
{
|
|
123725
|
+
var overlayIndex=this.OverlayIndex;
|
|
123726
|
+
var frame=overlayIndex.Frame;
|
|
123727
|
+
var chart=new ChartSimpleTable();
|
|
123728
|
+
chart.Canvas=hqChart.Canvas;
|
|
123729
|
+
chart.Name=varItem.Name;
|
|
123730
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
123731
|
+
chart.ChartFrame=frame.Frame;
|
|
123732
|
+
chart.Identify=overlayIndex.Identify;
|
|
123733
|
+
chart.HQChart=hqChart;
|
|
123734
|
+
|
|
123735
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
123736
|
+
{
|
|
123737
|
+
var drawData=varItem.Draw.DrawData;
|
|
123738
|
+
if (drawData.TableData) chart.Data.Data=drawData.TableData;
|
|
123739
|
+
if (drawData.BGColor) chart.BGColor=drawData.BGColor;
|
|
123740
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
123741
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
123742
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
123743
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
123744
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
123745
|
+
}
|
|
123746
|
+
|
|
123747
|
+
frame.ChartPaint.push(chart);
|
|
123748
|
+
}
|
|
123749
|
+
|
|
123437
123750
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
123438
123751
|
{
|
|
123439
123752
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -124612,6 +124925,30 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
124612
124925
|
|
|
124613
124926
|
result.push(outVarItem);
|
|
124614
124927
|
}
|
|
124928
|
+
else if (draw.DrawType=="DRAWTEXT_LINE")
|
|
124929
|
+
{
|
|
124930
|
+
drawItem.Name=draw.Name;
|
|
124931
|
+
drawItem.Type=draw.Type;
|
|
124932
|
+
|
|
124933
|
+
drawItem.DrawType=draw.DrawType;
|
|
124934
|
+
drawItem.DrawData=draw.DrawData; //{ Price:, Text:{ Title:text, Color:textcolor }, Line:{ Type:linetype, Color:linecolor } };
|
|
124935
|
+
|
|
124936
|
+
outVarItem.Draw=drawItem;
|
|
124937
|
+
if (draw.Font) outVarItem.Font=draw.Font;
|
|
124938
|
+
|
|
124939
|
+
result.push(outVarItem);
|
|
124940
|
+
}
|
|
124941
|
+
else if (draw.DrawType=="DRAW_SIMPLE_TABLE")
|
|
124942
|
+
{
|
|
124943
|
+
drawItem.Name=draw.Name;
|
|
124944
|
+
drawItem.Type=draw.Type;
|
|
124945
|
+
|
|
124946
|
+
drawItem.DrawType=draw.DrawType;
|
|
124947
|
+
drawItem.DrawData=draw.DrawData; //{ TableData:[ [ {AryCell:[{Text:, Color: }]}, ], ], BGColor:, TextFont:{ Size:, Name: } };
|
|
124948
|
+
|
|
124949
|
+
outVarItem.Draw=drawItem;
|
|
124950
|
+
result.push(outVarItem);
|
|
124951
|
+
}
|
|
124615
124952
|
else
|
|
124616
124953
|
{
|
|
124617
124954
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -126216,6 +126553,13 @@ function GetBlackStyle()
|
|
|
126216
126553
|
}
|
|
126217
126554
|
},
|
|
126218
126555
|
|
|
126556
|
+
ChartSimpleTable:
|
|
126557
|
+
{
|
|
126558
|
+
TextColor:"rgb(250,250,250)",
|
|
126559
|
+
BGColor:"rgba(0,0,0,0.85)",
|
|
126560
|
+
BorderColor:"rgb(90,90,90)",
|
|
126561
|
+
},
|
|
126562
|
+
|
|
126219
126563
|
ChartDrawVolProfile:
|
|
126220
126564
|
{
|
|
126221
126565
|
BGColor:"rgba(244,250,254,0.3)",
|
|
@@ -132435,6 +132779,8 @@ var REPORT_COLUMN_ID=
|
|
|
132435
132779
|
CUSTOM_PROGRESS_ID:106, //进度条
|
|
132436
132780
|
CUSTOM_LINK_ID:107, //链接
|
|
132437
132781
|
|
|
132782
|
+
MULTI_LINE_CONTAINER:108, //多行组合输出
|
|
132783
|
+
|
|
132438
132784
|
|
|
132439
132785
|
//预留数值类型 10个
|
|
132440
132786
|
RESERVE_NUMBER1_ID:201, //ReserveNumber1:
|
|
@@ -132996,6 +133342,10 @@ function ChartReport()
|
|
|
132996
133342
|
{
|
|
132997
133343
|
if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
|
|
132998
133344
|
}
|
|
133345
|
+
else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
133346
|
+
{
|
|
133347
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryField)) colItem.AryField=item.AryField.slice();
|
|
133348
|
+
}
|
|
132999
133349
|
|
|
133000
133350
|
return colItem;
|
|
133001
133351
|
}
|
|
@@ -133148,6 +133498,12 @@ function ChartReport()
|
|
|
133148
133498
|
{ Type:REPORT_COLUMN_ID.RISING_SPEED_10M_ID, Title:"10分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
|
|
133149
133499
|
{ Type:REPORT_COLUMN_ID.RISING_SPEED_15M_ID, Title:"15分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
|
|
133150
133500
|
|
|
133501
|
+
//组合多行字段
|
|
133502
|
+
{
|
|
133503
|
+
Type:REPORT_COLUMN_ID.MULTI_LINE_CONTAINER, Title:"涨幅",TextAlign:"right", MaxText:"1000.00%",
|
|
133504
|
+
AryField:[ { Type:REPORT_COLUMN_ID.PRICE_ID},{ Type:REPORT_COLUMN_ID.INCREASE_ID, DynamicFormat:"{Value}%"} ]
|
|
133505
|
+
},
|
|
133506
|
+
|
|
133151
133507
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER1_ID, Title:"数值1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
133152
133508
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER2_ID, Title:"数值2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
133153
133509
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER3_ID, Title:"数值3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
@@ -133359,6 +133715,17 @@ function ChartReport()
|
|
|
133359
133715
|
if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
|
|
133360
133716
|
if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
|
|
133361
133717
|
}
|
|
133718
|
+
else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
133719
|
+
{
|
|
133720
|
+
if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
|
|
133721
|
+
else itemWidth=this.Canvas.measureText(item.MaxText).width;
|
|
133722
|
+
|
|
133723
|
+
item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
|
|
133724
|
+
this.ItemTextLines=item.AryField.length;
|
|
133725
|
+
var rowHeight=(this.ItemFontHeight*item.AryField.length)+this.ItemMergin.Top+ this.ItemMergin.Bottom;
|
|
133726
|
+
if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
|
|
133727
|
+
if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
|
|
133728
|
+
}
|
|
133362
133729
|
else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
|
|
133363
133730
|
{
|
|
133364
133731
|
this.Canvas.font==this.NameSymbolFont.Name;
|
|
@@ -133952,6 +134319,87 @@ function ChartReport()
|
|
|
133952
134319
|
}
|
|
133953
134320
|
}
|
|
133954
134321
|
|
|
134322
|
+
this.BuildSubCellTextData=function(subItem, column, stock, drawInfo, data, option)
|
|
134323
|
+
{
|
|
134324
|
+
switch(subItem.Type)
|
|
134325
|
+
{
|
|
134326
|
+
case REPORT_COLUMN_ID.NAME_ID:
|
|
134327
|
+
if (stock && stock.Name) drawInfo.Text=stock.Name;
|
|
134328
|
+
else drawInfo.Text=data.Name;
|
|
134329
|
+
break;
|
|
134330
|
+
case REPORT_COLUMN_ID.SYMBOL_ID:
|
|
134331
|
+
if (stock && stock.Symbol) drawInfo.Text=stock.Symbol;
|
|
134332
|
+
else drawInfo.Text=data.Symbol;
|
|
134333
|
+
break;
|
|
134334
|
+
|
|
134335
|
+
case REPORT_COLUMN_ID.PRICE_ID:
|
|
134336
|
+
case REPORT_COLUMN_ID.OPEN_ID:
|
|
134337
|
+
case REPORT_COLUMN_ID.HIGH_ID:
|
|
134338
|
+
case REPORT_COLUMN_ID.LOW_ID:
|
|
134339
|
+
case REPORT_COLUMN_ID.YCLOSE_ID:
|
|
134340
|
+
case REPORT_COLUMN_ID.BUY_PRICE_ID:
|
|
134341
|
+
case REPORT_COLUMN_ID.SELL_PRICE_ID:
|
|
134342
|
+
case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:
|
|
134343
|
+
case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:
|
|
134344
|
+
case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:
|
|
134345
|
+
var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
|
|
134346
|
+
if (stock && IFrameSplitOperator.IsNumber(stock[fieldName])) this.GetPriceDrawInfo(stock[fieldName], stock, data, drawInfo, option);
|
|
134347
|
+
break;
|
|
134348
|
+
|
|
134349
|
+
case REPORT_COLUMN_ID.INCREASE_ID:
|
|
134350
|
+
case REPORT_COLUMN_ID.AMPLITUDE_ID:
|
|
134351
|
+
case REPORT_COLUMN_ID.UPDOWN_ID:
|
|
134352
|
+
case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:
|
|
134353
|
+
case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:
|
|
134354
|
+
case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:
|
|
134355
|
+
case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:
|
|
134356
|
+
case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:
|
|
134357
|
+
var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
|
|
134358
|
+
if (stock && IFrameSplitOperator.IsNumber(stock[fieldName]))
|
|
134359
|
+
{
|
|
134360
|
+
var value=stock[fieldName];
|
|
134361
|
+
var text=value.toFixed(2);
|
|
134362
|
+
if (subItem.DynamicFormat)
|
|
134363
|
+
text=subItem.DynamicFormat.replace('{Value}',text);
|
|
134364
|
+
|
|
134365
|
+
drawInfo.Text=text
|
|
134366
|
+
drawInfo.TextColor=this.GetUpDownColor(value,0);
|
|
134367
|
+
}
|
|
134368
|
+
break;
|
|
134369
|
+
}
|
|
134370
|
+
}
|
|
134371
|
+
|
|
134372
|
+
this.DrawSubCellText=function(drawInfo, column, rtText)
|
|
134373
|
+
{
|
|
134374
|
+
if (!drawInfo.Text) return;
|
|
134375
|
+
|
|
134376
|
+
var text=drawInfo.Text;
|
|
134377
|
+
var x=rtText.Left;
|
|
134378
|
+
if (drawInfo.TextAlign=='center')
|
|
134379
|
+
{
|
|
134380
|
+
x=rtText.Left+rtText.Width/2;
|
|
134381
|
+
this.Canvas.textAlign="center";
|
|
134382
|
+
}
|
|
134383
|
+
else if (drawInfo.TextAlign=='right')
|
|
134384
|
+
{
|
|
134385
|
+
x=rtText.Left+rtText.Width-2;
|
|
134386
|
+
this.Canvas.textAlign="right";
|
|
134387
|
+
}
|
|
134388
|
+
else
|
|
134389
|
+
{
|
|
134390
|
+
x+=2;
|
|
134391
|
+
this.Canvas.textAlign="left";
|
|
134392
|
+
}
|
|
134393
|
+
|
|
134394
|
+
var bClip=false;
|
|
134395
|
+
|
|
134396
|
+
this.Canvas.textBaseline="bottom";
|
|
134397
|
+
this.Canvas.fillStyle=drawInfo.TextColor;
|
|
134398
|
+
this.Canvas.fillText(text,x,rtText.Bottom);
|
|
134399
|
+
|
|
134400
|
+
if (bClip) this.Canvas.restore();
|
|
134401
|
+
}
|
|
134402
|
+
|
|
133955
134403
|
this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
|
|
133956
134404
|
{
|
|
133957
134405
|
var itemWidth=column.Width;
|
|
@@ -134277,6 +134725,26 @@ function ChartReport()
|
|
|
134277
134725
|
{
|
|
134278
134726
|
this.FormatReserveButton(column, stock, drawInfo);
|
|
134279
134727
|
}
|
|
134728
|
+
else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
134729
|
+
{
|
|
134730
|
+
if (IFrameSplitOperator.IsNonEmptyArray(column.AryField))
|
|
134731
|
+
{
|
|
134732
|
+
var yBottom=rtItem.Bottom-this.ItemMergin.Bottom-(column.AryField.length-1)*this.ItemFontHeight;
|
|
134733
|
+
var rtText={ Left:left+this.ItemMergin.Left, Width:textWidth, Height:this.ItemFontHeight, Bottom:yBottom };
|
|
134734
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
134735
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
134736
|
+
for(var k=0;k<column.AryField.length;++k)
|
|
134737
|
+
{
|
|
134738
|
+
drawInfo.Text=null;
|
|
134739
|
+
var subItem=column.AryField[k];
|
|
134740
|
+
this.BuildSubCellTextData(subItem, column, stock, drawInfo, data);
|
|
134741
|
+
this.DrawSubCellText(drawInfo, column, rtText);
|
|
134742
|
+
|
|
134743
|
+
rtText.Bottom+=this.ItemFontHeight;
|
|
134744
|
+
rtText.Top+=this.ItemFontHeight;
|
|
134745
|
+
}
|
|
134746
|
+
}
|
|
134747
|
+
}
|
|
134280
134748
|
|
|
134281
134749
|
|
|
134282
134750
|
//拖拽行颜色
|
|
@@ -134306,6 +134774,10 @@ function ChartReport()
|
|
|
134306
134774
|
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
134307
134775
|
{
|
|
134308
134776
|
this.DrawLinkText(drawInfo, x, top, textWidth);
|
|
134777
|
+
}
|
|
134778
|
+
else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
134779
|
+
{
|
|
134780
|
+
|
|
134309
134781
|
}
|
|
134310
134782
|
else
|
|
134311
134783
|
{
|
|
@@ -150227,7 +150699,7 @@ function HQChartScriptWorker()
|
|
|
150227
150699
|
|
|
150228
150700
|
|
|
150229
150701
|
|
|
150230
|
-
var HQCHART_VERSION="1.1.
|
|
150702
|
+
var HQCHART_VERSION="1.1.14282";
|
|
150231
150703
|
|
|
150232
150704
|
function PrintHQChartVersion()
|
|
150233
150705
|
{
|