hqchart 1.1.14172 → 1.1.14179
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 -23
- package/package.json +1 -1
- package/src/jscommon/umychart.js +458 -70
- package/src/jscommon/umychart.report.js +4 -0
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +463 -71
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +463 -71
|
@@ -5955,16 +5955,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
5955
5955
|
}
|
|
5956
5956
|
}
|
|
5957
5957
|
|
|
5958
|
-
//历史分钟数据 更改日期
|
|
5959
|
-
this.ChangeTradeDate=function(tradeDate)
|
|
5960
|
-
{
|
|
5961
|
-
if(this.JSChartContainer && typeof(this.JSChartContainer.ChangeTradeDate)=='function')
|
|
5962
|
-
{
|
|
5963
|
-
JSConsole.Chart.Log('[JSChart:ChangeTradeDate] date', tradeDate);
|
|
5964
|
-
this.JSChartContainer.ChangeTradeDate(tradeDate);
|
|
5965
|
-
}
|
|
5966
|
-
}
|
|
5967
|
-
|
|
5968
5958
|
//多日走势图
|
|
5969
5959
|
this.ChangeDayCount=function(count, option)
|
|
5970
5960
|
{
|
|
@@ -6167,6 +6157,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
6167
6157
|
return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
|
|
6168
6158
|
}
|
|
6169
6159
|
}
|
|
6160
|
+
|
|
6161
|
+
this.ExecuteMenuCommand=function(cmdID, aryArgs)
|
|
6162
|
+
{
|
|
6163
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.ExecuteMenuCommand)=='function')
|
|
6164
|
+
{
|
|
6165
|
+
JSConsole.Chart.Log('[JSChart:ExecuteMenuCommand] ');
|
|
6166
|
+
return this.JSChartContainer.ExecuteMenuCommand(cmdID, aryArgs);
|
|
6167
|
+
}
|
|
6168
|
+
}
|
|
6170
6169
|
}
|
|
6171
6170
|
|
|
6172
6171
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -13841,22 +13840,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
13841
13840
|
this.ShowDrawToolDialog();
|
|
13842
13841
|
break;
|
|
13843
13842
|
case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:
|
|
13844
|
-
var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
13845
|
-
var
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
break;
|
|
13849
|
-
case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
|
|
13850
|
-
var StockChip=this.GetExtendChartByClassName('StockChip');
|
|
13851
|
-
if (StockChip)
|
|
13843
|
+
//var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
13844
|
+
var stockChip=this.GetStockChipChart();
|
|
13845
|
+
if (stockChip) return;
|
|
13846
|
+
if (srcParam)
|
|
13852
13847
|
{
|
|
13853
|
-
var
|
|
13854
|
-
this.DeleteExtendChart(StockChip);
|
|
13855
|
-
this.Frame.ChartBorder.Right-=chipWidth;
|
|
13848
|
+
var extendChart=this.CreateExtendChart(srcParam, aryArgs[1]); //创建扩展图形
|
|
13856
13849
|
this.SetSizeChange(true);
|
|
13857
13850
|
this.Draw();
|
|
13858
13851
|
}
|
|
13859
13852
|
break;
|
|
13853
|
+
case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
|
|
13854
|
+
if (this.DeleteStockChipChart) this.DeleteStockChipChart();
|
|
13855
|
+
break;
|
|
13860
13856
|
case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:
|
|
13861
13857
|
if (IFrameSplitOperator.IsBool(srcParam))
|
|
13862
13858
|
this.EnableSelectRect=srcParam;
|
|
@@ -17787,7 +17783,8 @@ function AverageWidthFrame()
|
|
|
17787
17783
|
var borderTop=this.ChartBorder.Top;
|
|
17788
17784
|
var borderBottom=this.ChartBorder.Bottom;
|
|
17789
17785
|
var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
17790
|
-
var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
17786
|
+
//var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
17787
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
17791
17788
|
}
|
|
17792
17789
|
else
|
|
17793
17790
|
{
|
|
@@ -17795,7 +17792,7 @@ function AverageWidthFrame()
|
|
|
17795
17792
|
var borderLeft=this.ChartBorder.Left;
|
|
17796
17793
|
var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
17797
17794
|
//var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
17798
|
-
isDrawRight=this.IsShowRightHorizontal();
|
|
17795
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
17799
17796
|
}
|
|
17800
17797
|
|
|
17801
17798
|
if (!isDrawRight && !isDrawLeft) return null;
|
|
@@ -22485,6 +22482,25 @@ function KLineHScreenFrame()
|
|
|
22485
22482
|
}
|
|
22486
22483
|
}
|
|
22487
22484
|
|
|
22485
|
+
this.IsShowRightHorizontal=function()
|
|
22486
|
+
{
|
|
22487
|
+
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
22488
|
+
var borderBottom=this.ChartBorder.Bottom;
|
|
22489
|
+
if (borderBottom<=10*pixelTatio) return false;
|
|
22490
|
+
|
|
22491
|
+
if (this.YTextPosition[1]==2) return false;
|
|
22492
|
+
if (this.IsShowYText[1]===false) return false;
|
|
22493
|
+
|
|
22494
|
+
if (this.GlobalOption && this.GlobalOption.RightHorizontal)
|
|
22495
|
+
{
|
|
22496
|
+
var item=this.GlobalOption.RightHorizontal;
|
|
22497
|
+
if (item.Show===false) return false;
|
|
22498
|
+
}
|
|
22499
|
+
|
|
22500
|
+
return true;
|
|
22501
|
+
}
|
|
22502
|
+
|
|
22503
|
+
|
|
22488
22504
|
//画Y轴
|
|
22489
22505
|
this.DrawHorizontal=function()
|
|
22490
22506
|
{
|
|
@@ -22500,7 +22516,8 @@ function KLineHScreenFrame()
|
|
|
22500
22516
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
22501
22517
|
|
|
22502
22518
|
var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
22503
|
-
var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
22519
|
+
//var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
22520
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
22504
22521
|
|
|
22505
22522
|
for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从左往右画分割线
|
|
22506
22523
|
{
|
|
@@ -48485,18 +48502,35 @@ function StockChipPhone()
|
|
|
48485
48502
|
this.ClassName='StockChipPhone';
|
|
48486
48503
|
this.ShowType=0; //0=所有筹码 手机版只支持0
|
|
48487
48504
|
|
|
48505
|
+
//手机端没有按钮
|
|
48506
|
+
this.DrawToolbar=function(moveonPoint, mouseStatus) { }
|
|
48507
|
+
|
|
48488
48508
|
this.Draw=function()
|
|
48489
48509
|
{
|
|
48490
|
-
this.
|
|
48510
|
+
this.IsHScreen=this.ChartFrame.IsHScreen==true;
|
|
48491
48511
|
this.PixelRatio=GetDevicePixelRatio();
|
|
48492
|
-
|
|
48493
|
-
|
|
48494
|
-
|
|
48495
|
-
|
|
48496
|
-
|
|
48497
|
-
|
|
48498
|
-
|
|
48499
|
-
|
|
48512
|
+
if (this.IsHScreen)
|
|
48513
|
+
{
|
|
48514
|
+
var border=this.ChartBorder.GetHScreenBorder();
|
|
48515
|
+
var left=ToFixedPoint(border.Left);
|
|
48516
|
+
var right=ToFixedPoint(border.Right);
|
|
48517
|
+
var top=ToFixedPoint(border.Bottom+this.Left);
|
|
48518
|
+
var bottom=ToFixedPoint(border.ChartHeight-2*this.PixelRatio);
|
|
48519
|
+
this.ClientRect={Left:left,Top:top, Right:right, Bottom:bottom};
|
|
48520
|
+
this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
|
|
48521
|
+
this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
|
|
48522
|
+
}
|
|
48523
|
+
else
|
|
48524
|
+
{
|
|
48525
|
+
var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
|
|
48526
|
+
var top=ToFixedPoint(this.ChartBorder.GetTop());
|
|
48527
|
+
var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
|
|
48528
|
+
var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
|
|
48529
|
+
this.ClientRect={Left:left,Top:top,Right:right, Bottom:bottom};
|
|
48530
|
+
this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
|
|
48531
|
+
this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
|
|
48532
|
+
}
|
|
48533
|
+
|
|
48500
48534
|
if (ChartData.IsTickPeriod(this.HQChart.Period))
|
|
48501
48535
|
{
|
|
48502
48536
|
|
|
@@ -48505,11 +48539,12 @@ function StockChipPhone()
|
|
|
48505
48539
|
{
|
|
48506
48540
|
if (this.CalculateChip())
|
|
48507
48541
|
{
|
|
48508
|
-
this.DrawFrame();
|
|
48509
48542
|
this.DrawAllChip();
|
|
48510
|
-
|
|
48511
|
-
|
|
48512
|
-
this.
|
|
48543
|
+
if (this.ShowType==1|| this.ShowType==2) this.DrawDayChip();
|
|
48544
|
+
|
|
48545
|
+
this.CalculateCast(); //计算成本
|
|
48546
|
+
if (this.IsHScreen) this.DrawHScreenChipInfo();
|
|
48547
|
+
else this.DrawChipInfo();
|
|
48513
48548
|
}
|
|
48514
48549
|
}
|
|
48515
48550
|
|
|
@@ -48517,17 +48552,170 @@ function StockChipPhone()
|
|
|
48517
48552
|
this.SizeChange=false;
|
|
48518
48553
|
}
|
|
48519
48554
|
|
|
48520
|
-
this.
|
|
48555
|
+
this.DrawAllChip=function()
|
|
48521
48556
|
{
|
|
48557
|
+
var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
|
|
48558
|
+
var selectPrice=this.Data.SelectData.Close;
|
|
48559
|
+
var aryProfitPoint=[];
|
|
48560
|
+
var aryNoProfitPoint=[];
|
|
48561
|
+
var totalVol=0,totalAmount=0,totalProfitVol=0, totalYProfitVol=0; //总的成交量, 总的成交金额, 总的盈利的成交量
|
|
48562
|
+
var yPrice=this.Data.YPrice;
|
|
48563
|
+
|
|
48564
|
+
var maxPrice=KLineFrame.HorizontalMax;
|
|
48565
|
+
var minPrice=KLineFrame.HorizontalMin;
|
|
48566
|
+
|
|
48567
|
+
var MaxVol=1;
|
|
48568
|
+
for(var i=0;i<this.Data.AllChip.length;++i)
|
|
48569
|
+
{
|
|
48570
|
+
var vol=this.Data.AllChip[i];
|
|
48571
|
+
if(!vol) continue;
|
|
48572
|
+
var price=(i+this.Data.MinPrice)/this.PriceZoom;
|
|
48573
|
+
totalVol+=vol;
|
|
48574
|
+
totalAmount+=price*vol;
|
|
48575
|
+
|
|
48576
|
+
if (price<yPrice) totalYProfitVol+=vol; //获利的成交量
|
|
48577
|
+
if (price<selectPrice) totalProfitVol+=vol; //鼠标当前位置 获利的成交量
|
|
48522
48578
|
|
|
48579
|
+
if (price<=maxPrice && price>=minPrice)
|
|
48580
|
+
{
|
|
48581
|
+
if (MaxVol<vol) MaxVol=vol;
|
|
48582
|
+
}
|
|
48583
|
+
}
|
|
48584
|
+
this.Data.MaxVol=MaxVol; //把成交量最大值替换成 当前屏成交量最大值
|
|
48585
|
+
|
|
48586
|
+
for(var i=0;i<this.Data.AllChip.length;++i)
|
|
48587
|
+
{
|
|
48588
|
+
var vol=this.Data.AllChip[i];
|
|
48589
|
+
if(!vol) continue;
|
|
48590
|
+
var price=(i+this.Data.MinPrice)/this.PriceZoom;
|
|
48591
|
+
if (price>maxPrice || price<minPrice) continue;
|
|
48592
|
+
|
|
48593
|
+
if (this.IsHScreen)
|
|
48594
|
+
{
|
|
48595
|
+
var y=KLineFrame.GetYFromData(price,false);
|
|
48596
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
|
|
48597
|
+
}
|
|
48598
|
+
else
|
|
48599
|
+
{
|
|
48600
|
+
var y=KLineFrame.GetYFromData(price,false);
|
|
48601
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
|
|
48602
|
+
}
|
|
48603
|
+
|
|
48604
|
+
if (price<selectPrice) aryProfitPoint.push({X:x,Y:y});
|
|
48605
|
+
else aryNoProfitPoint.push({X:x,Y:y});
|
|
48606
|
+
}
|
|
48607
|
+
|
|
48608
|
+
this.Data.ChipInfo=
|
|
48609
|
+
{
|
|
48610
|
+
Vol:totalVol, AveragePrice:totalAmount/totalVol, ProfitVol:totalProfitVol,
|
|
48611
|
+
ProfitRate:totalVol>0?totalProfitVol/totalVol*100:0,
|
|
48612
|
+
YProfitRate:totalVol>0?totalYProfitVol/totalVol*100:0
|
|
48613
|
+
};
|
|
48614
|
+
|
|
48615
|
+
if (this.ShowType==0)
|
|
48616
|
+
{
|
|
48617
|
+
this.DrawLines(aryProfitPoint,this.ColorProfit);
|
|
48618
|
+
this.DrawLines(aryNoProfitPoint,this.ColorNoProfit);
|
|
48619
|
+
var averagePrice=this.Data.ChipInfo.AveragePrice;
|
|
48620
|
+
if (averagePrice>0 && averagePrice<=maxPrice && averagePrice>=minPrice)
|
|
48621
|
+
{
|
|
48622
|
+
averagePrice=averagePrice.toFixed(2);
|
|
48623
|
+
this.DrawAveragePriceLine(aryProfitPoint,aryNoProfitPoint,KLineFrame.GetYFromData(averagePrice),this.ColorAveragePrice);
|
|
48624
|
+
}
|
|
48625
|
+
}
|
|
48626
|
+
else //在火焰山模式下, 筹码用一个颜色
|
|
48627
|
+
{
|
|
48628
|
+
this.DrawLines(aryProfitPoint,this.ColorBG);
|
|
48629
|
+
this.DrawLines(aryNoProfitPoint,this.ColorBG);
|
|
48630
|
+
}
|
|
48631
|
+
}
|
|
48632
|
+
|
|
48633
|
+
this.DrawLines=function(aryPoint,color)
|
|
48634
|
+
{
|
|
48635
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
|
|
48636
|
+
|
|
48637
|
+
this.Canvas.strokeStyle=color;
|
|
48638
|
+
this.Canvas.beginPath();
|
|
48639
|
+
for(var i =0; i<aryPoint.length; ++i)
|
|
48640
|
+
{
|
|
48641
|
+
var item=aryPoint[i];
|
|
48642
|
+
if (this.IsHScreen)
|
|
48643
|
+
{
|
|
48644
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
48645
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
48646
|
+
}
|
|
48647
|
+
else
|
|
48648
|
+
{
|
|
48649
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
48650
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
48651
|
+
}
|
|
48652
|
+
|
|
48653
|
+
}
|
|
48654
|
+
this.Canvas.stroke();
|
|
48655
|
+
}
|
|
48656
|
+
|
|
48657
|
+
this.DrawAveragePriceLine=function(aryProfitPoint,aryNoProfitPoint,y,color)
|
|
48658
|
+
{
|
|
48659
|
+
for(var i=0; i<aryProfitPoint.length; ++i)
|
|
48660
|
+
{
|
|
48661
|
+
var item=aryProfitPoint[i];
|
|
48662
|
+
if (item.Y==y)
|
|
48663
|
+
{
|
|
48664
|
+
this.Canvas.strokeStyle=color;
|
|
48665
|
+
this.Canvas.beginPath();
|
|
48666
|
+
if (this.IsHScreen)
|
|
48667
|
+
{
|
|
48668
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
48669
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
48670
|
+
}
|
|
48671
|
+
else
|
|
48672
|
+
{
|
|
48673
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
48674
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
48675
|
+
}
|
|
48676
|
+
|
|
48677
|
+
this.Canvas.stroke();
|
|
48678
|
+
return;
|
|
48679
|
+
}
|
|
48680
|
+
}
|
|
48681
|
+
|
|
48682
|
+
for(var i=0; i<aryNoProfitPoint.length; ++i)
|
|
48683
|
+
{
|
|
48684
|
+
var item=aryNoProfitPoint[i];
|
|
48685
|
+
if (item.Y==y)
|
|
48686
|
+
{
|
|
48687
|
+
this.Canvas.strokeStyle=color;
|
|
48688
|
+
this.Canvas.beginPath();
|
|
48689
|
+
if (this.IsHScreen)
|
|
48690
|
+
{
|
|
48691
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
48692
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
48693
|
+
}
|
|
48694
|
+
else
|
|
48695
|
+
{
|
|
48696
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
48697
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
48698
|
+
}
|
|
48699
|
+
this.Canvas.stroke();
|
|
48700
|
+
return;
|
|
48701
|
+
}
|
|
48702
|
+
}
|
|
48523
48703
|
}
|
|
48524
48704
|
|
|
48525
48705
|
this.GetChipInfoTitle=function()
|
|
48526
48706
|
{
|
|
48527
48707
|
var aryText=[]; //从底部往上
|
|
48528
48708
|
|
|
48529
|
-
|
|
48530
|
-
|
|
48709
|
+
if (ChartData.IsDayPeriod(this.HQChart.Period, true))
|
|
48710
|
+
{
|
|
48711
|
+
var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
|
|
48712
|
+
aryText.push(item);
|
|
48713
|
+
}
|
|
48714
|
+
else if (ChartData.IsMinutePeriod(this.HQChart.Period, true))
|
|
48715
|
+
{
|
|
48716
|
+
var item={ Title:`${IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date)} ${IFrameSplitOperator.FormatTimeString(this.Data.SelectData.Time, "HH:MM")}` };
|
|
48717
|
+
aryText.push(item);
|
|
48718
|
+
}
|
|
48531
48719
|
|
|
48532
48720
|
var item={ Title:"集中度:", Text:"--.--%", };
|
|
48533
48721
|
if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
|
|
@@ -48547,9 +48735,66 @@ function StockChipPhone()
|
|
|
48547
48735
|
aryText.push(item);
|
|
48548
48736
|
}
|
|
48549
48737
|
|
|
48738
|
+
if (this.IsHScreen) //横屏直接就显示数值 画进度条太麻烦了
|
|
48739
|
+
{
|
|
48740
|
+
var item={ Title:"获利比例:", Text: `${this.Data.ChipInfo.ProfitRate.toFixed(2)}%`};
|
|
48741
|
+
aryText.push(item);
|
|
48742
|
+
}
|
|
48743
|
+
else
|
|
48744
|
+
{
|
|
48745
|
+
var item={ Title:"获利比例:", Type:1 };
|
|
48746
|
+
aryText.push(item);
|
|
48747
|
+
}
|
|
48748
|
+
|
|
48550
48749
|
return aryText;
|
|
48551
48750
|
}
|
|
48552
48751
|
|
|
48752
|
+
this.DrawHScreenChipInfo=function()
|
|
48753
|
+
{
|
|
48754
|
+
var aryText=this.GetChipInfoTitle();
|
|
48755
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
|
|
48756
|
+
|
|
48757
|
+
this.Canvas.font=this.Font;
|
|
48758
|
+
this.Canvas.fillStyle=this.InfoColor;
|
|
48759
|
+
this.Canvas.textBaseline='bottom';
|
|
48760
|
+
this.Canvas.textAlign='left';
|
|
48761
|
+
|
|
48762
|
+
var top=this.ClientRect.Top+2*this.PixelRatio;
|
|
48763
|
+
var left=this.ClientRect.Left+2*this.PixelRatio;
|
|
48764
|
+
var bottom=this.ClientRect.Bottom;
|
|
48765
|
+
var lineHeight=this.LineHeight*GetDevicePixelRatio();
|
|
48766
|
+
|
|
48767
|
+
this.Canvas.save();
|
|
48768
|
+
this.Canvas.translate(left, top);
|
|
48769
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
48770
|
+
|
|
48771
|
+
var yText=0, xText=0;
|
|
48772
|
+
for(var i=0;i<aryText.length;++i)
|
|
48773
|
+
{
|
|
48774
|
+
var item=aryText[i];
|
|
48775
|
+
yText=0;
|
|
48776
|
+
var textColor=item.TitleColor;
|
|
48777
|
+
if (item.TitleColor) textColor=item.TitleColor;
|
|
48778
|
+
this.Canvas.fillStyle=textColor;
|
|
48779
|
+
this.Canvas.fillText(item.Title,yText,xText);
|
|
48780
|
+
var textWidth=this.Canvas.measureText(item.Title).width+4*this.PixelRatio;
|
|
48781
|
+
var yText=textWidth;
|
|
48782
|
+
|
|
48783
|
+
if (item.Text)
|
|
48784
|
+
{
|
|
48785
|
+
var textColor=item.TitleColor;
|
|
48786
|
+
if (item.TextColor) textColor=item.TextColor;
|
|
48787
|
+
this.Canvas.fillStyle=textColor;
|
|
48788
|
+
this.Canvas.fillText(item.Text,yText,xText);
|
|
48789
|
+
}
|
|
48790
|
+
|
|
48791
|
+
xText-=lineHeight;
|
|
48792
|
+
}
|
|
48793
|
+
|
|
48794
|
+
|
|
48795
|
+
this.Canvas.restore();
|
|
48796
|
+
}
|
|
48797
|
+
|
|
48553
48798
|
this.DrawChipInfo=function()
|
|
48554
48799
|
{
|
|
48555
48800
|
var aryText=this.GetChipInfoTitle();
|
|
@@ -48577,27 +48822,94 @@ function StockChipPhone()
|
|
|
48577
48822
|
var textWidth=this.Canvas.measureText(item.Title).width+4;
|
|
48578
48823
|
var xText=left+textWidth;
|
|
48579
48824
|
|
|
48580
|
-
|
|
48581
|
-
|
|
48582
|
-
|
|
48583
|
-
|
|
48825
|
+
if (item.Text)
|
|
48826
|
+
{
|
|
48827
|
+
var textColor=item.TitleColor;
|
|
48828
|
+
if (item.TextColor) textColor=item.TextColor;
|
|
48829
|
+
this.Canvas.fillStyle=textColor;
|
|
48830
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
48831
|
+
}
|
|
48832
|
+
|
|
48833
|
+
if (item.Type==1)
|
|
48834
|
+
{
|
|
48835
|
+
var barLeft=left+textWidth+2;
|
|
48836
|
+
var barWidth=(right-5-barLeft);
|
|
48837
|
+
this.Canvas.strokeStyle=this.ColorNoProfit;
|
|
48838
|
+
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
|
|
48839
|
+
this.Canvas.strokeStyle=this.ColorProfit;
|
|
48840
|
+
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
|
|
48841
|
+
var text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
|
|
48842
|
+
this.Canvas.textAlign='center';
|
|
48843
|
+
this.Canvas.fillText(text,barLeft+barWidth/2,yText);
|
|
48844
|
+
}
|
|
48584
48845
|
|
|
48585
48846
|
yText-=lineHeight;
|
|
48586
48847
|
}
|
|
48848
|
+
}
|
|
48849
|
+
|
|
48850
|
+
this.DrawDayChip=function()
|
|
48851
|
+
{
|
|
48852
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.DayChip)) return;
|
|
48853
|
+
|
|
48854
|
+
var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
|
|
48855
|
+
for(var i=0;i<this.Data.DayChip.length;++i)
|
|
48856
|
+
{
|
|
48857
|
+
var aryPoint=[];
|
|
48858
|
+
var chipData=this.Data.DayChip[i].Chip;
|
|
48859
|
+
if (!chipData) continue;
|
|
48860
|
+
var totalVol=0;
|
|
48861
|
+
for(var j=0;j<chipData.length;++j)
|
|
48862
|
+
{
|
|
48863
|
+
var vol=chipData[j];
|
|
48864
|
+
if(!vol) continue;
|
|
48865
|
+
totalVol+=vol;
|
|
48866
|
+
var price=(j+this.Data.MinPrice)/100;
|
|
48867
|
+
if (this.IsHScreen)
|
|
48868
|
+
{
|
|
48869
|
+
var y=KLineFrame.GetYFromData(price);
|
|
48870
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
|
|
48871
|
+
}
|
|
48872
|
+
else
|
|
48873
|
+
{
|
|
48874
|
+
var y=KLineFrame.GetYFromData(price);
|
|
48875
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
|
|
48876
|
+
}
|
|
48877
|
+
|
|
48878
|
+
aryPoint.push({X:x,Y:y});
|
|
48879
|
+
}
|
|
48880
|
+
this.Data.DayChip[i].Vol=totalVol;
|
|
48881
|
+
this.DrawArea(aryPoint,this.Data.DayChip[i].Color);
|
|
48882
|
+
}
|
|
48883
|
+
}
|
|
48884
|
+
|
|
48885
|
+
this.DrawArea=function(aryPoint,color)
|
|
48886
|
+
{
|
|
48887
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
|
|
48888
|
+
|
|
48889
|
+
this.Canvas.fillStyle=color;
|
|
48890
|
+
this.Canvas.beginPath();
|
|
48891
|
+
if (this.IsHScreen)
|
|
48892
|
+
{
|
|
48893
|
+
this.Canvas.moveTo(aryPoint[0].Y,this.ClientRect.Top);
|
|
48894
|
+
for(var i=0; i<aryPoint.length; ++i)
|
|
48895
|
+
{
|
|
48896
|
+
var item=aryPoint[i];
|
|
48897
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
48898
|
+
}
|
|
48899
|
+
this.Canvas.lineTo(aryPoint[aryPoint.length-1].Y,this.ClientRect.Top);
|
|
48900
|
+
}
|
|
48901
|
+
else
|
|
48902
|
+
{
|
|
48903
|
+
this.Canvas.moveTo(this.ClientRect.Left,aryPoint[0].Y);
|
|
48904
|
+
for(var i=0; i<aryPoint.length; ++i)
|
|
48905
|
+
{
|
|
48906
|
+
var item=aryPoint[i];
|
|
48907
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
48908
|
+
}
|
|
48909
|
+
this.Canvas.lineTo(this.ClientRect.Left,aryPoint[aryPoint.length-1].Y);
|
|
48910
|
+
}
|
|
48587
48911
|
|
|
48588
|
-
|
|
48589
|
-
this.Canvas.fillText(text,left,yText);
|
|
48590
|
-
var textWidth=this.Canvas.measureText(text).width+2;
|
|
48591
|
-
var barLeft=left+textWidth;
|
|
48592
|
-
var barWidth=(right-5-barLeft);
|
|
48593
|
-
this.Canvas.strokeStyle=this.ColorNoProfit;
|
|
48594
|
-
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
|
|
48595
|
-
this.Canvas.strokeStyle=this.ColorProfit;
|
|
48596
|
-
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
|
|
48597
|
-
text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
|
|
48598
|
-
this.Canvas.textAlign='center';
|
|
48599
|
-
this.Canvas.fillText(text,barLeft+barWidth/2,yText);
|
|
48600
|
-
yText-=lineHeight;
|
|
48912
|
+
this.Canvas.fill();
|
|
48601
48913
|
}
|
|
48602
48914
|
}
|
|
48603
48915
|
|
|
@@ -81131,6 +81443,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81131
81443
|
this.Draw();
|
|
81132
81444
|
}
|
|
81133
81445
|
|
|
81446
|
+
//获取筹码图 className=指定筹码类名 否则就查询所有
|
|
81447
|
+
this.GetStockChipChart=function(className)
|
|
81448
|
+
{
|
|
81449
|
+
if (className)
|
|
81450
|
+
return this.GetExtendChartByClassName(className);
|
|
81451
|
+
|
|
81452
|
+
var chart=this.GetExtendChartByClassName('StockChip');
|
|
81453
|
+
if (chart) return chart;
|
|
81454
|
+
|
|
81455
|
+
chart=this.GetExtendChartByClassName("StockChipPhone");
|
|
81456
|
+
return chart;
|
|
81457
|
+
}
|
|
81458
|
+
|
|
81459
|
+
this.DeleteStockChipChart=function()
|
|
81460
|
+
{
|
|
81461
|
+
var stockChip=this.GetStockChipChart();
|
|
81462
|
+
if (!stockChip) return;
|
|
81463
|
+
|
|
81464
|
+
var chipWidth=stockChip.Chart.Width;
|
|
81465
|
+
this.DeleteExtendChart(stockChip);
|
|
81466
|
+
this.Frame.ChartBorder.Right-=chipWidth;
|
|
81467
|
+
if (stockChip.Chart.ClassName=="StockChipPhone")
|
|
81468
|
+
{
|
|
81469
|
+
this.GlobalOption.RightHorizontal.Show=true;
|
|
81470
|
+
this.Frame.ResetXYSplit();
|
|
81471
|
+
}
|
|
81472
|
+
this.SetSizeChange(true);
|
|
81473
|
+
this.Draw();
|
|
81474
|
+
}
|
|
81475
|
+
|
|
81476
|
+
this.CreateStockChipPhone=function(option)
|
|
81477
|
+
{
|
|
81478
|
+
var chart=new StockChipPhone();
|
|
81479
|
+
chart.Canvas=this.Canvas;
|
|
81480
|
+
chart.ChartBorder=this.Frame.ChartBorder;
|
|
81481
|
+
chart.ChartFrame=this.Frame;
|
|
81482
|
+
chart.HQChart=this;
|
|
81483
|
+
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
81484
|
+
chart.SetOption(option);
|
|
81485
|
+
this.ExtendChartPaint.push(chart);
|
|
81486
|
+
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
81487
|
+
this.GlobalOption.RightHorizontal.Show=false;
|
|
81488
|
+
|
|
81489
|
+
return chart;
|
|
81490
|
+
}
|
|
81491
|
+
|
|
81134
81492
|
this.CreateExtendChart=function(name, option) //创建扩展图形
|
|
81135
81493
|
{
|
|
81136
81494
|
var chart;
|
|
@@ -81149,17 +81507,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
81149
81507
|
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
81150
81508
|
return chart;
|
|
81151
81509
|
case "StockChipPhone":
|
|
81152
|
-
|
|
81153
|
-
chart.Canvas=this.Canvas;
|
|
81154
|
-
chart.ChartBorder=this.Frame.ChartBorder;
|
|
81155
|
-
chart.ChartFrame=this.Frame;
|
|
81156
|
-
chart.HQChart=this;
|
|
81157
|
-
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
81158
|
-
chart.SetOption(option);
|
|
81159
|
-
this.ExtendChartPaint.push(chart);
|
|
81160
|
-
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
81161
|
-
this.GlobalOption.RightHorizontal.Show=false;
|
|
81162
|
-
return chart;
|
|
81510
|
+
return this.CreateStockChipPhone(option);
|
|
81163
81511
|
case 'KLineTooltip':
|
|
81164
81512
|
if (option.Create && typeof(option.Create)=='function') chart=option.Create();
|
|
81165
81513
|
else chart=new KLineTooltipPaint();
|
|
@@ -82333,7 +82681,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82333
82681
|
|
|
82334
82682
|
var bBGSpit=false, bShowStockChip=false;
|
|
82335
82683
|
if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
|
|
82336
|
-
if (this.
|
|
82684
|
+
if (this.GetStockChipChart()) bShowStockChip=true; //筹码
|
|
82685
|
+
var stockChipConfig={Name:'StockChip', ShowType:1, Width:230 };
|
|
82686
|
+
//var stockChipConfig={Name:'StockChipPhone', Width:150 }; //手机版筹码
|
|
82337
82687
|
|
|
82338
82688
|
var bShowCorss=false; //十字光标十字线
|
|
82339
82689
|
if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
|
|
@@ -82508,7 +82858,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82508
82858
|
|
|
82509
82859
|
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
|
|
82510
82860
|
|
|
82511
|
-
{ Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
|
|
82861
|
+
{ Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[stockChipConfig.Name, stockChipConfig]}, Checked:bShowStockChip},
|
|
82512
82862
|
|
|
82513
82863
|
{ Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
|
|
82514
82864
|
|
|
@@ -91991,6 +92341,8 @@ function KLineChartHScreenContainer(uielement)
|
|
|
91991
92341
|
frame.ChartBorder=border;
|
|
91992
92342
|
frame.Identify=i; //窗口序号
|
|
91993
92343
|
frame.RightSpaceCount=this.RightSpaceCount; //右边
|
|
92344
|
+
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
92345
|
+
frame.GlobalOption=this.GlobalOption;
|
|
91994
92346
|
|
|
91995
92347
|
frame.HorizontalMax=20;
|
|
91996
92348
|
frame.HorizontalMin=10;
|
|
@@ -92001,6 +92353,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
92001
92353
|
frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');
|
|
92002
92354
|
frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');
|
|
92003
92355
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
92356
|
+
frame.YSplitOperator.HQChart=this;
|
|
92004
92357
|
//主图上下间距
|
|
92005
92358
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
92006
92359
|
border.TopSpace=12*pixelTatio;
|
|
@@ -92011,6 +92364,8 @@ function KLineChartHScreenContainer(uielement)
|
|
|
92011
92364
|
frame.YSplitOperator=new FrameSplitY();
|
|
92012
92365
|
frame.YSplitOperator.LanguageID=this.LanguageID;
|
|
92013
92366
|
frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');
|
|
92367
|
+
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
92368
|
+
frame.YSplitOperator.HQChart=this;
|
|
92014
92369
|
//frame.IsLocked = true;
|
|
92015
92370
|
}
|
|
92016
92371
|
|
|
@@ -92044,6 +92399,39 @@ function KLineChartHScreenContainer(uielement)
|
|
|
92044
92399
|
this.Frame.SubFrame[i]=subFrame;
|
|
92045
92400
|
}
|
|
92046
92401
|
}
|
|
92402
|
+
|
|
92403
|
+
this.CreateStockChipPhone=function(option)
|
|
92404
|
+
{
|
|
92405
|
+
var chart=new StockChipPhone();
|
|
92406
|
+
chart.Canvas=this.Canvas;
|
|
92407
|
+
chart.ChartBorder=this.Frame.ChartBorder;
|
|
92408
|
+
chart.ChartFrame=this.Frame;
|
|
92409
|
+
chart.HQChart=this;
|
|
92410
|
+
chart.Left=this.Frame.ChartBorder.Bottom; //左边间距使用当前框架间距
|
|
92411
|
+
chart.SetOption(option);
|
|
92412
|
+
this.ExtendChartPaint.push(chart);
|
|
92413
|
+
this.Frame.ChartBorder.Bottom+=chart.Width; //创建筹码需要增加右边的间距
|
|
92414
|
+
this.GlobalOption.RightHorizontal.Show=false;
|
|
92415
|
+
|
|
92416
|
+
return chart;
|
|
92417
|
+
}
|
|
92418
|
+
|
|
92419
|
+
this.DeleteStockChipChart=function()
|
|
92420
|
+
{
|
|
92421
|
+
var stockChip=this.GetStockChipChart();
|
|
92422
|
+
if (!stockChip) return;
|
|
92423
|
+
|
|
92424
|
+
var chipWidth=stockChip.Chart.Width;
|
|
92425
|
+
this.DeleteExtendChart(stockChip);
|
|
92426
|
+
this.Frame.ChartBorder.Bottom-=chipWidth;
|
|
92427
|
+
if (stockChip.Chart.ClassName=="StockChipPhone")
|
|
92428
|
+
{
|
|
92429
|
+
this.GlobalOption.RightHorizontal.Show=true;
|
|
92430
|
+
this.Frame.ResetXYSplit();
|
|
92431
|
+
}
|
|
92432
|
+
this.SetSizeChange(true);
|
|
92433
|
+
this.Draw();
|
|
92434
|
+
}
|
|
92047
92435
|
}
|
|
92048
92436
|
|
|
92049
92437
|
|
|
@@ -129404,6 +129792,8 @@ function JSReportChartContainer(uielement)
|
|
|
129404
129792
|
|
|
129405
129793
|
this.UIOnMounseOut=function(e)
|
|
129406
129794
|
{
|
|
129795
|
+
this.HideMinuteChartTooltip();
|
|
129796
|
+
|
|
129407
129797
|
var bDraw=false;
|
|
129408
129798
|
var tabChart=this.GetTabChart();
|
|
129409
129799
|
if (tabChart && tabChart.MoveOnTabIndex>=0)
|
|
@@ -129428,6 +129818,8 @@ function JSReportChartContainer(uielement)
|
|
|
129428
129818
|
|
|
129429
129819
|
this.UIOnMouseleave=function(e)
|
|
129430
129820
|
{
|
|
129821
|
+
this.HideMinuteChartTooltip();
|
|
129822
|
+
|
|
129431
129823
|
var tabChart=this.GetTabChart();
|
|
129432
129824
|
if (tabChart && tabChart.MoveOnTabIndex>=0)
|
|
129433
129825
|
{
|
|
@@ -139695,7 +140087,7 @@ function ScrollBarBGChart()
|
|
|
139695
140087
|
|
|
139696
140088
|
|
|
139697
140089
|
|
|
139698
|
-
var HQCHART_VERSION="1.1.
|
|
140090
|
+
var HQCHART_VERSION="1.1.14178";
|
|
139699
140091
|
|
|
139700
140092
|
function PrintHQChartVersion()
|
|
139701
140093
|
{
|