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
|
@@ -1854,6 +1854,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
1854
1854
|
HQData.APIIndex_MULTI_LINE(data, callback);
|
|
1855
1855
|
else if (request.Data.indexname=="API-MULTI_SVGICON")
|
|
1856
1856
|
HQData.APIIndex_MULTI_SVGICON(data, callback);
|
|
1857
|
+
else if (request.Data.indexname=="API-DRAWTEXT_LINE")
|
|
1858
|
+
HQData.APIIndex_DRAWTEXT_LINE(data, callback);
|
|
1857
1859
|
}
|
|
1858
1860
|
|
|
1859
1861
|
|
|
@@ -2240,3 +2242,40 @@ HQData.APIIndex_MULTI_SVGICON=function(data, callback)
|
|
|
2240
2242
|
}
|
|
2241
2243
|
|
|
2242
2244
|
|
|
2245
|
+
HQData.APIIndex_DRAWTEXT_LINE=function(data, callback)
|
|
2246
|
+
{
|
|
2247
|
+
data.PreventDefault=true;
|
|
2248
|
+
var hqchart=data.HQChart;
|
|
2249
|
+
var kData=hqchart.GetKData();
|
|
2250
|
+
|
|
2251
|
+
var lastItem=kData.Data[kData.Data.length-1];
|
|
2252
|
+
var price=(lastItem.High+lastItem.Low)/2;
|
|
2253
|
+
|
|
2254
|
+
var lineData=
|
|
2255
|
+
{
|
|
2256
|
+
name:'DRAWTEXT_LINE', type:1,
|
|
2257
|
+
Draw:
|
|
2258
|
+
{
|
|
2259
|
+
DrawType:'DRAWTEXT_LINE',
|
|
2260
|
+
DrawData:
|
|
2261
|
+
{
|
|
2262
|
+
Price:price,
|
|
2263
|
+
Text:{ Title:`价格:${price.toFixed(2)}`, Color:"rgb(255, 165, 0)" },
|
|
2264
|
+
Line:{ Type:1, Color:"rgb(200,200,0)" }, //Type 0=不画 1=直线 2=虚线
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
var apiData=
|
|
2270
|
+
{
|
|
2271
|
+
code:0,
|
|
2272
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
2273
|
+
outdata: { date:kData.GetDate() , outvar:[lineData] }
|
|
2274
|
+
};
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
console.log('[HQData.APIIndex_DRAWTEXT_LINE] apiData ', apiData);
|
|
2278
|
+
callback(apiData);
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
|
|
@@ -35426,6 +35426,225 @@ function ChartKLineTable()
|
|
|
35426
35426
|
}
|
|
35427
35427
|
}
|
|
35428
35428
|
|
|
35429
|
+
//表格
|
|
35430
|
+
function ChartSimpleTable()
|
|
35431
|
+
{
|
|
35432
|
+
this.newMethod=IChartPainting; //派生
|
|
35433
|
+
this.newMethod();
|
|
35434
|
+
delete this.newMethod;
|
|
35435
|
+
|
|
35436
|
+
this.ClassName='ChartSimpleTable'; //类名
|
|
35437
|
+
//this.Data;
|
|
35438
|
+
|
|
35439
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
|
|
35440
|
+
this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
|
|
35441
|
+
this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
|
|
35442
|
+
this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
|
|
35443
|
+
this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
|
|
35444
|
+
this.Offset={ X:-3, Y:0 }, //位置偏移
|
|
35445
|
+
|
|
35446
|
+
|
|
35447
|
+
this.DefaultCellWidth=30;
|
|
35448
|
+
|
|
35449
|
+
this.RectClient={ };
|
|
35450
|
+
this.AryColumnCache=[]; //列缓存
|
|
35451
|
+
this.TextFontHeight;
|
|
35452
|
+
this.TextFont;
|
|
35453
|
+
this.RowHeight; //行高
|
|
35454
|
+
|
|
35455
|
+
this.ReloadResource=function(resource)
|
|
35456
|
+
{
|
|
35457
|
+
this.TextFontConfig=CloneData(g_JSChartResource.ChartSimpleTable.TextFont);
|
|
35458
|
+
this.ItemMargin=CloneData(g_JSChartResource.ChartSimpleTable.ItemMargin);
|
|
35459
|
+
this.TextColor=g_JSChartResource.ChartSimpleTable.TextColor; //默认颜色
|
|
35460
|
+
this.BGColor=g_JSChartResource.ChartSimpleTable.BGColor; //背景色
|
|
35461
|
+
this.BorderColor=g_JSChartResource.ChartSimpleTable.BorderColor; //边框颜色
|
|
35462
|
+
}
|
|
35463
|
+
|
|
35464
|
+
this.CalculateSize=function()
|
|
35465
|
+
{
|
|
35466
|
+
this.AryColumnCache=[];
|
|
35467
|
+
|
|
35468
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
35469
|
+
this.TextFont=`${this.TextFontConfig.Size*pixelRatio}px ${ this.TextFontConfig.Name}`;
|
|
35470
|
+
this.TextFontHeight=this.GetFontHeight(this.TextFont,"擎");
|
|
35471
|
+
this.RowHeight=this.TextFontHeight+this.ItemMargin.Top+this.ItemMargin.Bottom;
|
|
35472
|
+
|
|
35473
|
+
var rowCount=this.Data.Data.length;
|
|
35474
|
+
for(var i=0, j=0;i<rowCount;++i)
|
|
35475
|
+
{
|
|
35476
|
+
var rowItem=this.Data.Data[i];
|
|
35477
|
+
for(j=0;j<rowItem.AryCell.length;++j)
|
|
35478
|
+
{
|
|
35479
|
+
if (!this.AryColumnCache[j]) this.AryColumnCache[j]={ Width:this.DefaultCellWidth };
|
|
35480
|
+
var colItem=this.AryColumnCache[j];
|
|
35481
|
+
|
|
35482
|
+
var cellItem=rowItem.AryCell[j];
|
|
35483
|
+
var textWidth=this.Canvas.measureText(cellItem.Text).width;
|
|
35484
|
+
if (colItem.Width<textWidth) colItem.Width=textWidth;
|
|
35485
|
+
}
|
|
35486
|
+
}
|
|
35487
|
+
|
|
35488
|
+
var tableWidth=0;
|
|
35489
|
+
for(var i=0;i<this.AryColumnCache.length;++i)
|
|
35490
|
+
{
|
|
35491
|
+
var item=this.AryColumnCache[i];
|
|
35492
|
+
item.Width+=(this.ItemMargin.Left+this.ItemMargin.Right); //增加左右间距
|
|
35493
|
+
|
|
35494
|
+
tableWidth+=item.Width;
|
|
35495
|
+
}
|
|
35496
|
+
|
|
35497
|
+
this.RectClient={ Width:tableWidth, Height:this.RowHeight*rowCount };
|
|
35498
|
+
|
|
35499
|
+
var border=this.ChartFrame.GetBorder();
|
|
35500
|
+
this.RectClient.Right=border.Right+this.Offset.X;
|
|
35501
|
+
this.RectClient.Top=border.TopEx+this.Offset.Y;
|
|
35502
|
+
this.RectClient.Left=this.RectClient.Right-this.RectClient.Width;
|
|
35503
|
+
this.RectClient.Bottom=this.RectClient.Top+this.RectClient.Height;
|
|
35504
|
+
}
|
|
35505
|
+
|
|
35506
|
+
this.Draw=function()
|
|
35507
|
+
{
|
|
35508
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
35509
|
+
if (!this.Data || !IFrameSplitOperator.IsNonEmptyArray(this.Data.Data)) return;
|
|
35510
|
+
|
|
35511
|
+
var isHScreen=(this.ChartFrame.IsHScreen===true);
|
|
35512
|
+
if (isHScreen) return;
|
|
35513
|
+
|
|
35514
|
+
this.CalculateSize();
|
|
35515
|
+
|
|
35516
|
+
if (this.BGColor)
|
|
35517
|
+
{
|
|
35518
|
+
this.Canvas.fillStyle=this.BGColor;
|
|
35519
|
+
this.Canvas.fillRect(this.RectClient.Left, this.RectClient.Top, this.RectClient.Width, this.RectClient.Height);
|
|
35520
|
+
}
|
|
35521
|
+
|
|
35522
|
+
var itemHeight=this.RowHeight;
|
|
35523
|
+
this.Canvas.font=this.TextFont;
|
|
35524
|
+
this.Canvas.textBaseline='bottom';
|
|
35525
|
+
this.Canvas.textAlign='left';
|
|
35526
|
+
var rtRow={ Left:this.RectClient.Left, Top:this.RectClient.Top, Width:this.RectClient.Width, Height:itemHeight };
|
|
35527
|
+
rtRow.Right=rtRow.Left+rtRow.Width;
|
|
35528
|
+
rtRow.Bottom=rtRow.Top+rtRow.Height;
|
|
35529
|
+
var rowCount=this.Data.Data.length;
|
|
35530
|
+
for(var i=0;i<rowCount;++i)
|
|
35531
|
+
{
|
|
35532
|
+
var rowItem=this.Data.Data[i];
|
|
35533
|
+
this.DrawRow(rowItem, rtRow);
|
|
35534
|
+
|
|
35535
|
+
rtRow.Top+=itemHeight;
|
|
35536
|
+
rtRow.Bottom+=itemHeight;
|
|
35537
|
+
}
|
|
35538
|
+
|
|
35539
|
+
this.DrawBorder();
|
|
35540
|
+
}
|
|
35541
|
+
|
|
35542
|
+
this.DrawBorder=function()
|
|
35543
|
+
{
|
|
35544
|
+
if (!this.BorderColor) return;
|
|
35545
|
+
|
|
35546
|
+
var rowCount=this.Data.Data.length;
|
|
35547
|
+
var colCount=this.AryColumnCache.length;
|
|
35548
|
+
this.Canvas.strokeStyle=this.BorderColor;
|
|
35549
|
+
this.Canvas.beginPath();
|
|
35550
|
+
|
|
35551
|
+
//横线
|
|
35552
|
+
var rowTop=this.RectClient.Top;
|
|
35553
|
+
var left=this.RectClient.Left, right=this.RectClient.Right;
|
|
35554
|
+
var bottom=this.RectClient.Bottom, top=this.RectClient.Top;
|
|
35555
|
+
for(var i=0;i<rowCount;++i)
|
|
35556
|
+
{
|
|
35557
|
+
if (i==0)
|
|
35558
|
+
{
|
|
35559
|
+
var drawTop=ToFixedPoint(rowTop);
|
|
35560
|
+
this.Canvas.moveTo(left,drawTop);
|
|
35561
|
+
this.Canvas.lineTo(right,drawTop);
|
|
35562
|
+
}
|
|
35563
|
+
|
|
35564
|
+
var drawTop=ToFixedPoint(rowTop+this.RowHeight);
|
|
35565
|
+
this.Canvas.moveTo(left,drawTop);
|
|
35566
|
+
this.Canvas.lineTo(right,drawTop);
|
|
35567
|
+
|
|
35568
|
+
rowTop+=this.RowHeight;
|
|
35569
|
+
}
|
|
35570
|
+
|
|
35571
|
+
//竖线
|
|
35572
|
+
var columnLeft=this.RectClient.Left;
|
|
35573
|
+
for(var i=0;i<colCount; ++i)
|
|
35574
|
+
{
|
|
35575
|
+
var item=this.AryColumnCache[i];
|
|
35576
|
+
|
|
35577
|
+
if (i==0)
|
|
35578
|
+
{
|
|
35579
|
+
var drawLeft=ToFixedPoint(columnLeft);
|
|
35580
|
+
this.Canvas.moveTo(drawLeft,top);
|
|
35581
|
+
this.Canvas.lineTo(drawLeft,bottom);
|
|
35582
|
+
}
|
|
35583
|
+
|
|
35584
|
+
var drawLeft=ToFixedPoint(columnLeft+item.Width);
|
|
35585
|
+
this.Canvas.moveTo(drawLeft,top);
|
|
35586
|
+
this.Canvas.lineTo(drawLeft,bottom);
|
|
35587
|
+
|
|
35588
|
+
columnLeft+=item.Width;
|
|
35589
|
+
}
|
|
35590
|
+
|
|
35591
|
+
this.Canvas.stroke();
|
|
35592
|
+
}
|
|
35593
|
+
|
|
35594
|
+
this.DrawRow=function(data, rtRow)
|
|
35595
|
+
{
|
|
35596
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(data.AryCell)) return;
|
|
35597
|
+
|
|
35598
|
+
var x=rtRow.Left,y=rtRow.Top, width=rtRow.Width;
|
|
35599
|
+
for(var i=0;i<data.AryCell.length;++i)
|
|
35600
|
+
{
|
|
35601
|
+
var item=data.AryCell[i];
|
|
35602
|
+
var colItem=this.AryColumnCache[i];
|
|
35603
|
+
|
|
35604
|
+
var rtBG={Left:x, Top:rtRow.Top, Bottom:rtRow.Bottom, Height:this.RowHeight, Width:colItem.Width };
|
|
35605
|
+
rtBG.Right=rtBG.Top+rtBG.Height;
|
|
35606
|
+
|
|
35607
|
+
if (item)
|
|
35608
|
+
{
|
|
35609
|
+
if (item.BGColor)
|
|
35610
|
+
{
|
|
35611
|
+
this.Canvas.fillStyle=item.BGColor;
|
|
35612
|
+
this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
|
|
35613
|
+
}
|
|
35614
|
+
|
|
35615
|
+
if (item.Text && rtBG.Width>10)
|
|
35616
|
+
{
|
|
35617
|
+
if (item.Color) this.Canvas.fillStyle=item.Color;
|
|
35618
|
+
else this.Canvas.fillStyle=this.TextColor
|
|
35619
|
+
|
|
35620
|
+
var xText=x+this.ItemMargin.Left;
|
|
35621
|
+
var yText=rtBG.Bottom-this.ItemMargin.Bottom;
|
|
35622
|
+
|
|
35623
|
+
if (item.TextAlign=='right')
|
|
35624
|
+
{
|
|
35625
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35626
|
+
xText=rtBG.Right-this.ItemMargin.Right-textWidth;
|
|
35627
|
+
}
|
|
35628
|
+
else if (item.TextAlign=='center')
|
|
35629
|
+
{
|
|
35630
|
+
var textWidth=this.Canvas.measureText(item.Text).width;
|
|
35631
|
+
xText=rtBG.Left+rtBG.Width/2-textWidth/2;
|
|
35632
|
+
}
|
|
35633
|
+
|
|
35634
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
35635
|
+
}
|
|
35636
|
+
}
|
|
35637
|
+
|
|
35638
|
+
x+=rtBG.Width;
|
|
35639
|
+
}
|
|
35640
|
+
}
|
|
35641
|
+
|
|
35642
|
+
this.GetMaxMin=function()
|
|
35643
|
+
{
|
|
35644
|
+
return { Min:null, Max:null };
|
|
35645
|
+
}
|
|
35646
|
+
}
|
|
35647
|
+
|
|
35429
35648
|
//分钟成交量 支持横屏
|
|
35430
35649
|
function ChartMinuteVolumBar()
|
|
35431
35650
|
{
|
|
@@ -74022,6 +74241,15 @@ function JSChartResource()
|
|
|
74022
74241
|
ItemMergin:{ Left:5, Right:5, Top:4, Bottom:2 },
|
|
74023
74242
|
};
|
|
74024
74243
|
|
|
74244
|
+
this.ChartSimpleTable=
|
|
74245
|
+
{
|
|
74246
|
+
TextFont:{ Family:'微软雅黑' , Size:14 },
|
|
74247
|
+
ItemMargin:{ Left:5, Right:5, Top:4, Bottom:2 },
|
|
74248
|
+
TextColor:"rgb(0,0,0)",
|
|
74249
|
+
BGColor:"rgba(255,255,255,0.95)",
|
|
74250
|
+
BorderColor:"rgb(217,217,217)",
|
|
74251
|
+
}
|
|
74252
|
+
|
|
74025
74253
|
//手机端tooltip
|
|
74026
74254
|
this.TooltipPaint = {
|
|
74027
74255
|
BGColor:'rgba(250,250,250,0.8)', //背景色
|
|
@@ -75250,6 +75478,8 @@ function JSChartResource()
|
|
|
75250
75478
|
if (style.Title.PositionColor) this.Title.PositionColor=style.Title.PositionColor;
|
|
75251
75479
|
}
|
|
75252
75480
|
|
|
75481
|
+
if (style.ChartSimpleTable) this.SetChartSimpleTable(style.ChartSimpleTable);
|
|
75482
|
+
|
|
75253
75483
|
if (style.DRAWICON)
|
|
75254
75484
|
{
|
|
75255
75485
|
if (style.DRAWICON.Icon)
|
|
@@ -75509,7 +75739,7 @@ function JSChartResource()
|
|
|
75509
75739
|
{
|
|
75510
75740
|
var mergin=header.Mergin;
|
|
75511
75741
|
if (IFrameSplitOperator.IsNumber(mergin.Left)) this.DealList.Header.Mergin.Left=mergin.Left;
|
|
75512
|
-
if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.
|
|
75742
|
+
if (IFrameSplitOperator.IsNumber(mergin.Right)) this.DealList.Header.Mergin.Right=mergin.Right;
|
|
75513
75743
|
if (IFrameSplitOperator.IsNumber(mergin.Top)) this.DealList.Header.Mergin.Top=mergin.Top;
|
|
75514
75744
|
if (IFrameSplitOperator.IsNumber(mergin.Bottom)) this.DealList.Header.Mergin.Bottom=mergin.Bottom;
|
|
75515
75745
|
}
|
|
@@ -76295,6 +76525,32 @@ function JSChartResource()
|
|
|
76295
76525
|
if (IFrameSplitOperator.IsBool(style.AddIndexWindow)) dest.AddIndexWindow=style.AddIndexWindow;
|
|
76296
76526
|
}
|
|
76297
76527
|
|
|
76528
|
+
|
|
76529
|
+
this.SetChartSimpleTable=function(style)
|
|
76530
|
+
{
|
|
76531
|
+
var dest=this.ChartSimpleTable;
|
|
76532
|
+
|
|
76533
|
+
if (style.TextColor) dest.TextColor=style.TextColor;
|
|
76534
|
+
if (style.BGColor) dest.BGColor=style.BGColor;
|
|
76535
|
+
if (style.BorderColor) dest.BorderColor=style.BorderColor;
|
|
76536
|
+
|
|
76537
|
+
if (style.TextFont)
|
|
76538
|
+
{
|
|
76539
|
+
var item=style.TextFont;
|
|
76540
|
+
if (item.Name) dest.TextFont.Name=item.Name;
|
|
76541
|
+
if (IFrameSplitOperator.IsNumber(item.Size)) dest.TextFont.Size=item.Size;
|
|
76542
|
+
}
|
|
76543
|
+
|
|
76544
|
+
if (style.ItemMargin)
|
|
76545
|
+
{
|
|
76546
|
+
var margin=style.ItemMargin;
|
|
76547
|
+
if (IFrameSplitOperator.IsNumber(margin.Left)) dest.ItemMargin.Left=margin.Left;
|
|
76548
|
+
if (IFrameSplitOperator.IsNumber(margin.Right)) dest.ItemMargin.Right=margin.Right;
|
|
76549
|
+
if (IFrameSplitOperator.IsNumber(margin.Top)) dest.ItemMargin.Top=margin.Top;
|
|
76550
|
+
if (IFrameSplitOperator.IsNumber(margin.Bottom)) dest.ItemMargin.Bottom=margin.Bottom;
|
|
76551
|
+
}
|
|
76552
|
+
}
|
|
76553
|
+
|
|
76298
76554
|
}
|
|
76299
76555
|
|
|
76300
76556
|
var g_JSChartResource=new JSChartResource();
|
|
@@ -121169,6 +121425,29 @@ function ScriptIndex(name,script,args,option)
|
|
|
121169
121425
|
hqChart.ChartPaint.push(chart);
|
|
121170
121426
|
}
|
|
121171
121427
|
|
|
121428
|
+
this.CreateSimpleTable=function(hqChart,windowIndex,varItem,id)
|
|
121429
|
+
{
|
|
121430
|
+
var chart=new ChartSimpleTable();
|
|
121431
|
+
chart.Canvas=hqChart.Canvas;
|
|
121432
|
+
chart.Name=varItem.Name;
|
|
121433
|
+
chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
|
|
121434
|
+
chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
|
|
121435
|
+
|
|
121436
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
121437
|
+
{
|
|
121438
|
+
var drawData=varItem.Draw.DrawData;
|
|
121439
|
+
if (drawData.TableData) chart.Data.Data=drawData.TableData;
|
|
121440
|
+
if (drawData.BGColor) chart.BGColor=drawData.BGColor;
|
|
121441
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
121442
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
121443
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
121444
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
121445
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
121446
|
+
}
|
|
121447
|
+
|
|
121448
|
+
hqChart.ChartPaint.push(chart);
|
|
121449
|
+
}
|
|
121450
|
+
|
|
121172
121451
|
this.CreateTradeIcon=function(hqChart,windowIndex,varItem,id)
|
|
121173
121452
|
{
|
|
121174
121453
|
var chart=new ChartTradeIcon();
|
|
@@ -122034,6 +122313,9 @@ function ScriptIndex(name,script,args,option)
|
|
|
122034
122313
|
case "MULTI_POINT_LINE":
|
|
122035
122314
|
this.CreateLineMultiData(hqChart,windowIndex,item,i);
|
|
122036
122315
|
break;
|
|
122316
|
+
case "DRAW_SIMPLE_TABLE":
|
|
122317
|
+
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122318
|
+
break;
|
|
122037
122319
|
case "BUY":
|
|
122038
122320
|
case "SELL":
|
|
122039
122321
|
case "SELLSHORT":
|
|
@@ -122381,6 +122663,10 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
122381
122663
|
this.CreateMulitHtmlDom(hqChart,windowIndex,item,i);
|
|
122382
122664
|
break;
|
|
122383
122665
|
|
|
122666
|
+
case "DRAW_SIMPLE_TABLE":
|
|
122667
|
+
this.CreateSimpleTable(hqChart,windowIndex,item,i);
|
|
122668
|
+
break;
|
|
122669
|
+
|
|
122384
122670
|
case "KLINE_BG":
|
|
122385
122671
|
this.CreateBackgroud(hqChart,windowIndex,item,i);
|
|
122386
122672
|
break;
|
|
@@ -123390,6 +123676,33 @@ function OverlayScriptIndex(name,script,args,option)
|
|
|
123390
123676
|
frame.ChartPaint.push(chart);
|
|
123391
123677
|
}
|
|
123392
123678
|
|
|
123679
|
+
this.CreateSimpleTable=function(hqChart,windowIndex,varItem,i)
|
|
123680
|
+
{
|
|
123681
|
+
var overlayIndex=this.OverlayIndex;
|
|
123682
|
+
var frame=overlayIndex.Frame;
|
|
123683
|
+
var chart=new ChartSimpleTable();
|
|
123684
|
+
chart.Canvas=hqChart.Canvas;
|
|
123685
|
+
chart.Name=varItem.Name;
|
|
123686
|
+
chart.ChartBorder=frame.Frame.ChartBorder;
|
|
123687
|
+
chart.ChartFrame=frame.Frame;
|
|
123688
|
+
chart.Identify=overlayIndex.Identify;
|
|
123689
|
+
chart.HQChart=hqChart;
|
|
123690
|
+
|
|
123691
|
+
if (varItem.Draw && varItem.Draw.DrawData)
|
|
123692
|
+
{
|
|
123693
|
+
var drawData=varItem.Draw.DrawData;
|
|
123694
|
+
if (drawData.TableData) chart.Data.Data=drawData.TableData;
|
|
123695
|
+
if (drawData.BGColor) chart.BGColor=drawData.BGColor;
|
|
123696
|
+
if (drawData.BorderColor) chart.BorderColor=drawData.BorderColor;
|
|
123697
|
+
if (drawData.TextFont) chart.TextFontConfig=drawData.TextFont;
|
|
123698
|
+
if (drawData.TextColor) chart.TextColor=drawData.TextColor;
|
|
123699
|
+
if (IFrameSplitOperator.IsNumber(drawData.XOffset)) chart.Offset.X=drawData.XOffset;
|
|
123700
|
+
if (IFrameSplitOperator.IsNumber(drawData.YOffset)) chart.Offset.Y=drawData.YOffset;
|
|
123701
|
+
}
|
|
123702
|
+
|
|
123703
|
+
frame.ChartPaint.push(chart);
|
|
123704
|
+
}
|
|
123705
|
+
|
|
123393
123706
|
this.CreateChartVericaltLine=function(hqChart,windowIndex,varItem,id)
|
|
123394
123707
|
{
|
|
123395
123708
|
var overlayIndex=this.OverlayIndex;
|
|
@@ -124568,6 +124881,30 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
124568
124881
|
|
|
124569
124882
|
result.push(outVarItem);
|
|
124570
124883
|
}
|
|
124884
|
+
else if (draw.DrawType=="DRAWTEXT_LINE")
|
|
124885
|
+
{
|
|
124886
|
+
drawItem.Name=draw.Name;
|
|
124887
|
+
drawItem.Type=draw.Type;
|
|
124888
|
+
|
|
124889
|
+
drawItem.DrawType=draw.DrawType;
|
|
124890
|
+
drawItem.DrawData=draw.DrawData; //{ Price:, Text:{ Title:text, Color:textcolor }, Line:{ Type:linetype, Color:linecolor } };
|
|
124891
|
+
|
|
124892
|
+
outVarItem.Draw=drawItem;
|
|
124893
|
+
if (draw.Font) outVarItem.Font=draw.Font;
|
|
124894
|
+
|
|
124895
|
+
result.push(outVarItem);
|
|
124896
|
+
}
|
|
124897
|
+
else if (draw.DrawType=="DRAW_SIMPLE_TABLE")
|
|
124898
|
+
{
|
|
124899
|
+
drawItem.Name=draw.Name;
|
|
124900
|
+
drawItem.Type=draw.Type;
|
|
124901
|
+
|
|
124902
|
+
drawItem.DrawType=draw.DrawType;
|
|
124903
|
+
drawItem.DrawData=draw.DrawData; //{ TableData:[ [ {AryCell:[{Text:, Color: }]}, ], ], BGColor:, TextFont:{ Size:, Name: } };
|
|
124904
|
+
|
|
124905
|
+
outVarItem.Draw=drawItem;
|
|
124906
|
+
result.push(outVarItem);
|
|
124907
|
+
}
|
|
124571
124908
|
else
|
|
124572
124909
|
{
|
|
124573
124910
|
var find=g_ScriptIndexChartFactory.Get(draw.DrawType); //外部挂接
|
|
@@ -126172,6 +126509,13 @@ function GetBlackStyle()
|
|
|
126172
126509
|
}
|
|
126173
126510
|
},
|
|
126174
126511
|
|
|
126512
|
+
ChartSimpleTable:
|
|
126513
|
+
{
|
|
126514
|
+
TextColor:"rgb(250,250,250)",
|
|
126515
|
+
BGColor:"rgba(0,0,0,0.85)",
|
|
126516
|
+
BorderColor:"rgb(90,90,90)",
|
|
126517
|
+
},
|
|
126518
|
+
|
|
126175
126519
|
ChartDrawVolProfile:
|
|
126176
126520
|
{
|
|
126177
126521
|
BGColor:"rgba(244,250,254,0.3)",
|
|
@@ -132391,6 +132735,8 @@ var REPORT_COLUMN_ID=
|
|
|
132391
132735
|
CUSTOM_PROGRESS_ID:106, //进度条
|
|
132392
132736
|
CUSTOM_LINK_ID:107, //链接
|
|
132393
132737
|
|
|
132738
|
+
MULTI_LINE_CONTAINER:108, //多行组合输出
|
|
132739
|
+
|
|
132394
132740
|
|
|
132395
132741
|
//预留数值类型 10个
|
|
132396
132742
|
RESERVE_NUMBER1_ID:201, //ReserveNumber1:
|
|
@@ -132952,6 +133298,10 @@ function ChartReport()
|
|
|
132952
133298
|
{
|
|
132953
133299
|
if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType;
|
|
132954
133300
|
}
|
|
133301
|
+
else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
133302
|
+
{
|
|
133303
|
+
if (IFrameSplitOperator.IsNonEmptyArray(item.AryField)) colItem.AryField=item.AryField.slice();
|
|
133304
|
+
}
|
|
132955
133305
|
|
|
132956
133306
|
return colItem;
|
|
132957
133307
|
}
|
|
@@ -133104,6 +133454,12 @@ function ChartReport()
|
|
|
133104
133454
|
{ Type:REPORT_COLUMN_ID.RISING_SPEED_10M_ID, Title:"10分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
|
|
133105
133455
|
{ Type:REPORT_COLUMN_ID.RISING_SPEED_15M_ID, Title:"15分涨速%", TextAlign:"right", Width:null, MaxText:"-888.88" },
|
|
133106
133456
|
|
|
133457
|
+
//组合多行字段
|
|
133458
|
+
{
|
|
133459
|
+
Type:REPORT_COLUMN_ID.MULTI_LINE_CONTAINER, Title:"涨幅",TextAlign:"right", MaxText:"1000.00%",
|
|
133460
|
+
AryField:[ { Type:REPORT_COLUMN_ID.PRICE_ID},{ Type:REPORT_COLUMN_ID.INCREASE_ID, DynamicFormat:"{Value}%"} ]
|
|
133461
|
+
},
|
|
133462
|
+
|
|
133107
133463
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER1_ID, Title:"数值1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
133108
133464
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER2_ID, Title:"数值2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
133109
133465
|
{ Type:REPORT_COLUMN_ID.RESERVE_NUMBER3_ID, Title:"数值3", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
|
|
@@ -133315,6 +133671,17 @@ function ChartReport()
|
|
|
133315
133671
|
if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
|
|
133316
133672
|
if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
|
|
133317
133673
|
}
|
|
133674
|
+
else if (item.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
133675
|
+
{
|
|
133676
|
+
if (IFrameSplitOperator.IsNumber(item.FixedWidth)) itemWidth=item.FixedWidth;
|
|
133677
|
+
else itemWidth=this.Canvas.measureText(item.MaxText).width;
|
|
133678
|
+
|
|
133679
|
+
item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
|
|
133680
|
+
this.ItemTextLines=item.AryField.length;
|
|
133681
|
+
var rowHeight=(this.ItemFontHeight*item.AryField.length)+this.ItemMergin.Top+ this.ItemMergin.Bottom;
|
|
133682
|
+
if (rowHeight>this.RowHeight) this.RowHeight=rowHeight;
|
|
133683
|
+
if (rowHeight>this.FixedRowHeight) this.FixedRowHeight=rowHeight;
|
|
133684
|
+
}
|
|
133318
133685
|
else if (item.Type==REPORT_COLUMN_ID.SYMBOL_NAME_V2_ID) //单行显示
|
|
133319
133686
|
{
|
|
133320
133687
|
this.Canvas.font==this.NameSymbolFont.Name;
|
|
@@ -133908,6 +134275,87 @@ function ChartReport()
|
|
|
133908
134275
|
}
|
|
133909
134276
|
}
|
|
133910
134277
|
|
|
134278
|
+
this.BuildSubCellTextData=function(subItem, column, stock, drawInfo, data, option)
|
|
134279
|
+
{
|
|
134280
|
+
switch(subItem.Type)
|
|
134281
|
+
{
|
|
134282
|
+
case REPORT_COLUMN_ID.NAME_ID:
|
|
134283
|
+
if (stock && stock.Name) drawInfo.Text=stock.Name;
|
|
134284
|
+
else drawInfo.Text=data.Name;
|
|
134285
|
+
break;
|
|
134286
|
+
case REPORT_COLUMN_ID.SYMBOL_ID:
|
|
134287
|
+
if (stock && stock.Symbol) drawInfo.Text=stock.Symbol;
|
|
134288
|
+
else drawInfo.Text=data.Symbol;
|
|
134289
|
+
break;
|
|
134290
|
+
|
|
134291
|
+
case REPORT_COLUMN_ID.PRICE_ID:
|
|
134292
|
+
case REPORT_COLUMN_ID.OPEN_ID:
|
|
134293
|
+
case REPORT_COLUMN_ID.HIGH_ID:
|
|
134294
|
+
case REPORT_COLUMN_ID.LOW_ID:
|
|
134295
|
+
case REPORT_COLUMN_ID.YCLOSE_ID:
|
|
134296
|
+
case REPORT_COLUMN_ID.BUY_PRICE_ID:
|
|
134297
|
+
case REPORT_COLUMN_ID.SELL_PRICE_ID:
|
|
134298
|
+
case REPORT_COLUMN_ID.AVERAGE_PRICE_ID:
|
|
134299
|
+
case REPORT_COLUMN_ID.FUTURES_CLOSE_ID:
|
|
134300
|
+
case REPORT_COLUMN_ID.FUTURES_YCLOSE_ID:
|
|
134301
|
+
var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
|
|
134302
|
+
if (stock && IFrameSplitOperator.IsNumber(stock[fieldName])) this.GetPriceDrawInfo(stock[fieldName], stock, data, drawInfo, option);
|
|
134303
|
+
break;
|
|
134304
|
+
|
|
134305
|
+
case REPORT_COLUMN_ID.INCREASE_ID:
|
|
134306
|
+
case REPORT_COLUMN_ID.AMPLITUDE_ID:
|
|
134307
|
+
case REPORT_COLUMN_ID.UPDOWN_ID:
|
|
134308
|
+
case REPORT_COLUMN_ID.RISING_SPEED_1M_ID:
|
|
134309
|
+
case REPORT_COLUMN_ID.RISING_SPEED_3M_ID:
|
|
134310
|
+
case REPORT_COLUMN_ID.RISING_SPEED_5M_ID:
|
|
134311
|
+
case REPORT_COLUMN_ID.RISING_SPEED_10M_ID:
|
|
134312
|
+
case REPORT_COLUMN_ID.RISING_SPEED_15M_ID:
|
|
134313
|
+
var fieldName=MAP_COLUMN_FIELD.get(subItem.Type);
|
|
134314
|
+
if (stock && IFrameSplitOperator.IsNumber(stock[fieldName]))
|
|
134315
|
+
{
|
|
134316
|
+
var value=stock[fieldName];
|
|
134317
|
+
var text=value.toFixed(2);
|
|
134318
|
+
if (subItem.DynamicFormat)
|
|
134319
|
+
text=subItem.DynamicFormat.replace('{Value}',text);
|
|
134320
|
+
|
|
134321
|
+
drawInfo.Text=text
|
|
134322
|
+
drawInfo.TextColor=this.GetUpDownColor(value,0);
|
|
134323
|
+
}
|
|
134324
|
+
break;
|
|
134325
|
+
}
|
|
134326
|
+
}
|
|
134327
|
+
|
|
134328
|
+
this.DrawSubCellText=function(drawInfo, column, rtText)
|
|
134329
|
+
{
|
|
134330
|
+
if (!drawInfo.Text) return;
|
|
134331
|
+
|
|
134332
|
+
var text=drawInfo.Text;
|
|
134333
|
+
var x=rtText.Left;
|
|
134334
|
+
if (drawInfo.TextAlign=='center')
|
|
134335
|
+
{
|
|
134336
|
+
x=rtText.Left+rtText.Width/2;
|
|
134337
|
+
this.Canvas.textAlign="center";
|
|
134338
|
+
}
|
|
134339
|
+
else if (drawInfo.TextAlign=='right')
|
|
134340
|
+
{
|
|
134341
|
+
x=rtText.Left+rtText.Width-2;
|
|
134342
|
+
this.Canvas.textAlign="right";
|
|
134343
|
+
}
|
|
134344
|
+
else
|
|
134345
|
+
{
|
|
134346
|
+
x+=2;
|
|
134347
|
+
this.Canvas.textAlign="left";
|
|
134348
|
+
}
|
|
134349
|
+
|
|
134350
|
+
var bClip=false;
|
|
134351
|
+
|
|
134352
|
+
this.Canvas.textBaseline="bottom";
|
|
134353
|
+
this.Canvas.fillStyle=drawInfo.TextColor;
|
|
134354
|
+
this.Canvas.fillText(text,x,rtText.Bottom);
|
|
134355
|
+
|
|
134356
|
+
if (bClip) this.Canvas.restore();
|
|
134357
|
+
}
|
|
134358
|
+
|
|
133911
134359
|
this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
|
|
133912
134360
|
{
|
|
133913
134361
|
var itemWidth=column.Width;
|
|
@@ -134233,6 +134681,26 @@ function ChartReport()
|
|
|
134233
134681
|
{
|
|
134234
134682
|
this.FormatReserveButton(column, stock, drawInfo);
|
|
134235
134683
|
}
|
|
134684
|
+
else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
134685
|
+
{
|
|
134686
|
+
if (IFrameSplitOperator.IsNonEmptyArray(column.AryField))
|
|
134687
|
+
{
|
|
134688
|
+
var yBottom=rtItem.Bottom-this.ItemMergin.Bottom-(column.AryField.length-1)*this.ItemFontHeight;
|
|
134689
|
+
var rtText={ Left:left+this.ItemMergin.Left, Width:textWidth, Height:this.ItemFontHeight, Bottom:yBottom };
|
|
134690
|
+
rtText.Right=rtText.Left+rtText.Width;
|
|
134691
|
+
rtText.Top=rtText.Bottom-rtText.Height;
|
|
134692
|
+
for(var k=0;k<column.AryField.length;++k)
|
|
134693
|
+
{
|
|
134694
|
+
drawInfo.Text=null;
|
|
134695
|
+
var subItem=column.AryField[k];
|
|
134696
|
+
this.BuildSubCellTextData(subItem, column, stock, drawInfo, data);
|
|
134697
|
+
this.DrawSubCellText(drawInfo, column, rtText);
|
|
134698
|
+
|
|
134699
|
+
rtText.Bottom+=this.ItemFontHeight;
|
|
134700
|
+
rtText.Top+=this.ItemFontHeight;
|
|
134701
|
+
}
|
|
134702
|
+
}
|
|
134703
|
+
}
|
|
134236
134704
|
|
|
134237
134705
|
|
|
134238
134706
|
//拖拽行颜色
|
|
@@ -134262,6 +134730,10 @@ function ChartReport()
|
|
|
134262
134730
|
else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
|
|
134263
134731
|
{
|
|
134264
134732
|
this.DrawLinkText(drawInfo, x, top, textWidth);
|
|
134733
|
+
}
|
|
134734
|
+
else if (column.Type==REPORT_COLUMN_ID.MULTI_LINE_CONTAINER)
|
|
134735
|
+
{
|
|
134736
|
+
|
|
134265
134737
|
}
|
|
134266
134738
|
else
|
|
134267
134739
|
{
|
|
@@ -140579,7 +141051,7 @@ function ScrollBarBGChart()
|
|
|
140579
141051
|
|
|
140580
141052
|
|
|
140581
141053
|
|
|
140582
|
-
var HQCHART_VERSION="1.1.
|
|
141054
|
+
var HQCHART_VERSION="1.1.14282";
|
|
140583
141055
|
|
|
140584
141056
|
function PrintHQChartVersion()
|
|
140585
141057
|
{
|