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
package/src/jscommon/umychart.js
CHANGED
|
@@ -2030,16 +2030,6 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
2032
|
|
|
2033
|
-
//历史分钟数据 更改日期
|
|
2034
|
-
this.ChangeTradeDate=function(tradeDate)
|
|
2035
|
-
{
|
|
2036
|
-
if(this.JSChartContainer && typeof(this.JSChartContainer.ChangeTradeDate)=='function')
|
|
2037
|
-
{
|
|
2038
|
-
JSConsole.Chart.Log('[JSChart:ChangeTradeDate] date', tradeDate);
|
|
2039
|
-
this.JSChartContainer.ChangeTradeDate(tradeDate);
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
2033
|
//多日走势图
|
|
2044
2034
|
this.ChangeDayCount=function(count, option)
|
|
2045
2035
|
{
|
|
@@ -2242,6 +2232,15 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
2242
2232
|
return this.JSChartContainer.PopupMenuByDrapdown(menuData, rtButton);
|
|
2243
2233
|
}
|
|
2244
2234
|
}
|
|
2235
|
+
|
|
2236
|
+
this.ExecuteMenuCommand=function(cmdID, aryArgs)
|
|
2237
|
+
{
|
|
2238
|
+
if(this.JSChartContainer && typeof(this.JSChartContainer.ExecuteMenuCommand)=='function')
|
|
2239
|
+
{
|
|
2240
|
+
JSConsole.Chart.Log('[JSChart:ExecuteMenuCommand] ');
|
|
2241
|
+
return this.JSChartContainer.ExecuteMenuCommand(cmdID, aryArgs);
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2245
2244
|
}
|
|
2246
2245
|
|
|
2247
2246
|
JSChart.LastVersion=null; //最新的版本号
|
|
@@ -9916,22 +9915,19 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9916
9915
|
this.ShowDrawToolDialog();
|
|
9917
9916
|
break;
|
|
9918
9917
|
case JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID:
|
|
9919
|
-
var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
9920
|
-
var
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
break;
|
|
9924
|
-
case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
|
|
9925
|
-
var StockChip=this.GetExtendChartByClassName('StockChip');
|
|
9926
|
-
if (StockChip)
|
|
9918
|
+
//var option={Name:'筹码分布', ShowType:1, Width:230 };
|
|
9919
|
+
var stockChip=this.GetStockChipChart();
|
|
9920
|
+
if (stockChip) return;
|
|
9921
|
+
if (srcParam)
|
|
9927
9922
|
{
|
|
9928
|
-
var
|
|
9929
|
-
this.DeleteExtendChart(StockChip);
|
|
9930
|
-
this.Frame.ChartBorder.Right-=chipWidth;
|
|
9923
|
+
var extendChart=this.CreateExtendChart(srcParam, aryArgs[1]); //创建扩展图形
|
|
9931
9924
|
this.SetSizeChange(true);
|
|
9932
9925
|
this.Draw();
|
|
9933
9926
|
}
|
|
9934
9927
|
break;
|
|
9928
|
+
case JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:
|
|
9929
|
+
if (this.DeleteStockChipChart) this.DeleteStockChipChart();
|
|
9930
|
+
break;
|
|
9935
9931
|
case JSCHART_MENU_ID.CMD_ENABLE_SELECT_RECT_ID:
|
|
9936
9932
|
if (IFrameSplitOperator.IsBool(srcParam))
|
|
9937
9933
|
this.EnableSelectRect=srcParam;
|
|
@@ -13862,7 +13858,8 @@ function AverageWidthFrame()
|
|
|
13862
13858
|
var borderTop=this.ChartBorder.Top;
|
|
13863
13859
|
var borderBottom=this.ChartBorder.Bottom;
|
|
13864
13860
|
var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
13865
|
-
var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
13861
|
+
//var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
13862
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
13866
13863
|
}
|
|
13867
13864
|
else
|
|
13868
13865
|
{
|
|
@@ -13870,7 +13867,7 @@ function AverageWidthFrame()
|
|
|
13870
13867
|
var borderLeft=this.ChartBorder.Left;
|
|
13871
13868
|
var isDrawLeft=borderLeft>10 && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
13872
13869
|
//var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
13873
|
-
isDrawRight=this.IsShowRightHorizontal();
|
|
13870
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
13874
13871
|
}
|
|
13875
13872
|
|
|
13876
13873
|
if (!isDrawRight && !isDrawLeft) return null;
|
|
@@ -18560,6 +18557,25 @@ function KLineHScreenFrame()
|
|
|
18560
18557
|
}
|
|
18561
18558
|
}
|
|
18562
18559
|
|
|
18560
|
+
this.IsShowRightHorizontal=function()
|
|
18561
|
+
{
|
|
18562
|
+
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
18563
|
+
var borderBottom=this.ChartBorder.Bottom;
|
|
18564
|
+
if (borderBottom<=10*pixelTatio) return false;
|
|
18565
|
+
|
|
18566
|
+
if (this.YTextPosition[1]==2) return false;
|
|
18567
|
+
if (this.IsShowYText[1]===false) return false;
|
|
18568
|
+
|
|
18569
|
+
if (this.GlobalOption && this.GlobalOption.RightHorizontal)
|
|
18570
|
+
{
|
|
18571
|
+
var item=this.GlobalOption.RightHorizontal;
|
|
18572
|
+
if (item.Show===false) return false;
|
|
18573
|
+
}
|
|
18574
|
+
|
|
18575
|
+
return true;
|
|
18576
|
+
}
|
|
18577
|
+
|
|
18578
|
+
|
|
18563
18579
|
//画Y轴
|
|
18564
18580
|
this.DrawHorizontal=function()
|
|
18565
18581
|
{
|
|
@@ -18575,7 +18591,8 @@ function KLineHScreenFrame()
|
|
|
18575
18591
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
18576
18592
|
|
|
18577
18593
|
var isDrawLeft=borderTop>10*pixelTatio && this.IsShowYText[0]===true && this.YTextPosition[0]!=2;
|
|
18578
|
-
var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
18594
|
+
//var isDrawRight=borderBottom>10*pixelTatio && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
18595
|
+
var isDrawRight=this.IsShowRightHorizontal();
|
|
18579
18596
|
|
|
18580
18597
|
for(var i=this.HorizontalInfo.length-1; i>=0; --i) //从左往右画分割线
|
|
18581
18598
|
{
|
|
@@ -44560,18 +44577,35 @@ function StockChipPhone()
|
|
|
44560
44577
|
this.ClassName='StockChipPhone';
|
|
44561
44578
|
this.ShowType=0; //0=所有筹码 手机版只支持0
|
|
44562
44579
|
|
|
44580
|
+
//手机端没有按钮
|
|
44581
|
+
this.DrawToolbar=function(moveonPoint, mouseStatus) { }
|
|
44582
|
+
|
|
44563
44583
|
this.Draw=function()
|
|
44564
44584
|
{
|
|
44565
|
-
this.
|
|
44585
|
+
this.IsHScreen=this.ChartFrame.IsHScreen==true;
|
|
44566
44586
|
this.PixelRatio=GetDevicePixelRatio();
|
|
44567
|
-
|
|
44568
|
-
|
|
44569
|
-
|
|
44570
|
-
|
|
44571
|
-
|
|
44572
|
-
|
|
44573
|
-
|
|
44574
|
-
|
|
44587
|
+
if (this.IsHScreen)
|
|
44588
|
+
{
|
|
44589
|
+
var border=this.ChartBorder.GetHScreenBorder();
|
|
44590
|
+
var left=ToFixedPoint(border.Left);
|
|
44591
|
+
var right=ToFixedPoint(border.Right);
|
|
44592
|
+
var top=ToFixedPoint(border.Bottom+this.Left);
|
|
44593
|
+
var bottom=ToFixedPoint(border.ChartHeight-2*this.PixelRatio);
|
|
44594
|
+
this.ClientRect={Left:left,Top:top, Right:right, Bottom:bottom};
|
|
44595
|
+
this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
|
|
44596
|
+
this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
|
|
44597
|
+
}
|
|
44598
|
+
else
|
|
44599
|
+
{
|
|
44600
|
+
var left=ToFixedPoint(this.ChartBorder.GetRight()+this.Left);
|
|
44601
|
+
var top=ToFixedPoint(this.ChartBorder.GetTop());
|
|
44602
|
+
var right=ToFixedPoint(left+this.Width-1*this.PixelRatio);
|
|
44603
|
+
var bottom=ToFixedPoint(this.ChartBorder.GetBottom());
|
|
44604
|
+
this.ClientRect={Left:left,Top:top,Right:right, Bottom:bottom};
|
|
44605
|
+
this.ClientRect.Width=this.ClientRect.Right-this.ClientRect.Left;
|
|
44606
|
+
this.ClientRect.Height=this.ClientRect.Bottom-this.ClientRect.Top;
|
|
44607
|
+
}
|
|
44608
|
+
|
|
44575
44609
|
if (ChartData.IsTickPeriod(this.HQChart.Period))
|
|
44576
44610
|
{
|
|
44577
44611
|
|
|
@@ -44580,11 +44614,12 @@ function StockChipPhone()
|
|
|
44580
44614
|
{
|
|
44581
44615
|
if (this.CalculateChip())
|
|
44582
44616
|
{
|
|
44583
|
-
this.DrawFrame();
|
|
44584
44617
|
this.DrawAllChip();
|
|
44585
|
-
|
|
44586
|
-
|
|
44587
|
-
this.
|
|
44618
|
+
if (this.ShowType==1|| this.ShowType==2) this.DrawDayChip();
|
|
44619
|
+
|
|
44620
|
+
this.CalculateCast(); //计算成本
|
|
44621
|
+
if (this.IsHScreen) this.DrawHScreenChipInfo();
|
|
44622
|
+
else this.DrawChipInfo();
|
|
44588
44623
|
}
|
|
44589
44624
|
}
|
|
44590
44625
|
|
|
@@ -44592,17 +44627,170 @@ function StockChipPhone()
|
|
|
44592
44627
|
this.SizeChange=false;
|
|
44593
44628
|
}
|
|
44594
44629
|
|
|
44595
|
-
this.
|
|
44630
|
+
this.DrawAllChip=function()
|
|
44631
|
+
{
|
|
44632
|
+
var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
|
|
44633
|
+
var selectPrice=this.Data.SelectData.Close;
|
|
44634
|
+
var aryProfitPoint=[];
|
|
44635
|
+
var aryNoProfitPoint=[];
|
|
44636
|
+
var totalVol=0,totalAmount=0,totalProfitVol=0, totalYProfitVol=0; //总的成交量, 总的成交金额, 总的盈利的成交量
|
|
44637
|
+
var yPrice=this.Data.YPrice;
|
|
44638
|
+
|
|
44639
|
+
var maxPrice=KLineFrame.HorizontalMax;
|
|
44640
|
+
var minPrice=KLineFrame.HorizontalMin;
|
|
44641
|
+
|
|
44642
|
+
var MaxVol=1;
|
|
44643
|
+
for(var i=0;i<this.Data.AllChip.length;++i)
|
|
44644
|
+
{
|
|
44645
|
+
var vol=this.Data.AllChip[i];
|
|
44646
|
+
if(!vol) continue;
|
|
44647
|
+
var price=(i+this.Data.MinPrice)/this.PriceZoom;
|
|
44648
|
+
totalVol+=vol;
|
|
44649
|
+
totalAmount+=price*vol;
|
|
44650
|
+
|
|
44651
|
+
if (price<yPrice) totalYProfitVol+=vol; //获利的成交量
|
|
44652
|
+
if (price<selectPrice) totalProfitVol+=vol; //鼠标当前位置 获利的成交量
|
|
44653
|
+
|
|
44654
|
+
if (price<=maxPrice && price>=minPrice)
|
|
44655
|
+
{
|
|
44656
|
+
if (MaxVol<vol) MaxVol=vol;
|
|
44657
|
+
}
|
|
44658
|
+
}
|
|
44659
|
+
this.Data.MaxVol=MaxVol; //把成交量最大值替换成 当前屏成交量最大值
|
|
44660
|
+
|
|
44661
|
+
for(var i=0;i<this.Data.AllChip.length;++i)
|
|
44662
|
+
{
|
|
44663
|
+
var vol=this.Data.AllChip[i];
|
|
44664
|
+
if(!vol) continue;
|
|
44665
|
+
var price=(i+this.Data.MinPrice)/this.PriceZoom;
|
|
44666
|
+
if (price>maxPrice || price<minPrice) continue;
|
|
44667
|
+
|
|
44668
|
+
if (this.IsHScreen)
|
|
44669
|
+
{
|
|
44670
|
+
var y=KLineFrame.GetYFromData(price,false);
|
|
44671
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
|
|
44672
|
+
}
|
|
44673
|
+
else
|
|
44674
|
+
{
|
|
44675
|
+
var y=KLineFrame.GetYFromData(price,false);
|
|
44676
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
|
|
44677
|
+
}
|
|
44678
|
+
|
|
44679
|
+
if (price<selectPrice) aryProfitPoint.push({X:x,Y:y});
|
|
44680
|
+
else aryNoProfitPoint.push({X:x,Y:y});
|
|
44681
|
+
}
|
|
44682
|
+
|
|
44683
|
+
this.Data.ChipInfo=
|
|
44684
|
+
{
|
|
44685
|
+
Vol:totalVol, AveragePrice:totalAmount/totalVol, ProfitVol:totalProfitVol,
|
|
44686
|
+
ProfitRate:totalVol>0?totalProfitVol/totalVol*100:0,
|
|
44687
|
+
YProfitRate:totalVol>0?totalYProfitVol/totalVol*100:0
|
|
44688
|
+
};
|
|
44689
|
+
|
|
44690
|
+
if (this.ShowType==0)
|
|
44691
|
+
{
|
|
44692
|
+
this.DrawLines(aryProfitPoint,this.ColorProfit);
|
|
44693
|
+
this.DrawLines(aryNoProfitPoint,this.ColorNoProfit);
|
|
44694
|
+
var averagePrice=this.Data.ChipInfo.AveragePrice;
|
|
44695
|
+
if (averagePrice>0 && averagePrice<=maxPrice && averagePrice>=minPrice)
|
|
44696
|
+
{
|
|
44697
|
+
averagePrice=averagePrice.toFixed(2);
|
|
44698
|
+
this.DrawAveragePriceLine(aryProfitPoint,aryNoProfitPoint,KLineFrame.GetYFromData(averagePrice),this.ColorAveragePrice);
|
|
44699
|
+
}
|
|
44700
|
+
}
|
|
44701
|
+
else //在火焰山模式下, 筹码用一个颜色
|
|
44702
|
+
{
|
|
44703
|
+
this.DrawLines(aryProfitPoint,this.ColorBG);
|
|
44704
|
+
this.DrawLines(aryNoProfitPoint,this.ColorBG);
|
|
44705
|
+
}
|
|
44706
|
+
}
|
|
44707
|
+
|
|
44708
|
+
this.DrawLines=function(aryPoint,color)
|
|
44596
44709
|
{
|
|
44710
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
|
|
44597
44711
|
|
|
44712
|
+
this.Canvas.strokeStyle=color;
|
|
44713
|
+
this.Canvas.beginPath();
|
|
44714
|
+
for(var i =0; i<aryPoint.length; ++i)
|
|
44715
|
+
{
|
|
44716
|
+
var item=aryPoint[i];
|
|
44717
|
+
if (this.IsHScreen)
|
|
44718
|
+
{
|
|
44719
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
44720
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
44721
|
+
}
|
|
44722
|
+
else
|
|
44723
|
+
{
|
|
44724
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
44725
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
44726
|
+
}
|
|
44727
|
+
|
|
44728
|
+
}
|
|
44729
|
+
this.Canvas.stroke();
|
|
44730
|
+
}
|
|
44731
|
+
|
|
44732
|
+
this.DrawAveragePriceLine=function(aryProfitPoint,aryNoProfitPoint,y,color)
|
|
44733
|
+
{
|
|
44734
|
+
for(var i=0; i<aryProfitPoint.length; ++i)
|
|
44735
|
+
{
|
|
44736
|
+
var item=aryProfitPoint[i];
|
|
44737
|
+
if (item.Y==y)
|
|
44738
|
+
{
|
|
44739
|
+
this.Canvas.strokeStyle=color;
|
|
44740
|
+
this.Canvas.beginPath();
|
|
44741
|
+
if (this.IsHScreen)
|
|
44742
|
+
{
|
|
44743
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
44744
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
44745
|
+
}
|
|
44746
|
+
else
|
|
44747
|
+
{
|
|
44748
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
44749
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
44750
|
+
}
|
|
44751
|
+
|
|
44752
|
+
this.Canvas.stroke();
|
|
44753
|
+
return;
|
|
44754
|
+
}
|
|
44755
|
+
}
|
|
44756
|
+
|
|
44757
|
+
for(var i=0; i<aryNoProfitPoint.length; ++i)
|
|
44758
|
+
{
|
|
44759
|
+
var item=aryNoProfitPoint[i];
|
|
44760
|
+
if (item.Y==y)
|
|
44761
|
+
{
|
|
44762
|
+
this.Canvas.strokeStyle=color;
|
|
44763
|
+
this.Canvas.beginPath();
|
|
44764
|
+
if (this.IsHScreen)
|
|
44765
|
+
{
|
|
44766
|
+
this.Canvas.moveTo(item.Y,this.ClientRect.Top);
|
|
44767
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
44768
|
+
}
|
|
44769
|
+
else
|
|
44770
|
+
{
|
|
44771
|
+
this.Canvas.moveTo(this.ClientRect.Left,item.Y);
|
|
44772
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
44773
|
+
}
|
|
44774
|
+
this.Canvas.stroke();
|
|
44775
|
+
return;
|
|
44776
|
+
}
|
|
44777
|
+
}
|
|
44598
44778
|
}
|
|
44599
44779
|
|
|
44600
44780
|
this.GetChipInfoTitle=function()
|
|
44601
44781
|
{
|
|
44602
44782
|
var aryText=[]; //从底部往上
|
|
44603
44783
|
|
|
44604
|
-
|
|
44605
|
-
|
|
44784
|
+
if (ChartData.IsDayPeriod(this.HQChart.Period, true))
|
|
44785
|
+
{
|
|
44786
|
+
var item={ Title:"日期:", Text:IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date) };
|
|
44787
|
+
aryText.push(item);
|
|
44788
|
+
}
|
|
44789
|
+
else if (ChartData.IsMinutePeriod(this.HQChart.Period, true))
|
|
44790
|
+
{
|
|
44791
|
+
var item={ Title:`${IFrameSplitOperator.FormatDateString(this.Data.SelectData.Date)} ${IFrameSplitOperator.FormatTimeString(this.Data.SelectData.Time, "HH:MM")}` };
|
|
44792
|
+
aryText.push(item);
|
|
44793
|
+
}
|
|
44606
44794
|
|
|
44607
44795
|
var item={ Title:"集中度:", Text:"--.--%", };
|
|
44608
44796
|
if (IFrameSplitOperator.IsNonEmptyArray(this.Data.Cast)) item.Text=`${this.Data.Cast[0].Rate.toFixed(2)}%`;
|
|
@@ -44622,9 +44810,66 @@ function StockChipPhone()
|
|
|
44622
44810
|
aryText.push(item);
|
|
44623
44811
|
}
|
|
44624
44812
|
|
|
44813
|
+
if (this.IsHScreen) //横屏直接就显示数值 画进度条太麻烦了
|
|
44814
|
+
{
|
|
44815
|
+
var item={ Title:"获利比例:", Text: `${this.Data.ChipInfo.ProfitRate.toFixed(2)}%`};
|
|
44816
|
+
aryText.push(item);
|
|
44817
|
+
}
|
|
44818
|
+
else
|
|
44819
|
+
{
|
|
44820
|
+
var item={ Title:"获利比例:", Type:1 };
|
|
44821
|
+
aryText.push(item);
|
|
44822
|
+
}
|
|
44823
|
+
|
|
44625
44824
|
return aryText;
|
|
44626
44825
|
}
|
|
44627
44826
|
|
|
44827
|
+
this.DrawHScreenChipInfo=function()
|
|
44828
|
+
{
|
|
44829
|
+
var aryText=this.GetChipInfoTitle();
|
|
44830
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryText)) return;
|
|
44831
|
+
|
|
44832
|
+
this.Canvas.font=this.Font;
|
|
44833
|
+
this.Canvas.fillStyle=this.InfoColor;
|
|
44834
|
+
this.Canvas.textBaseline='bottom';
|
|
44835
|
+
this.Canvas.textAlign='left';
|
|
44836
|
+
|
|
44837
|
+
var top=this.ClientRect.Top+2*this.PixelRatio;
|
|
44838
|
+
var left=this.ClientRect.Left+2*this.PixelRatio;
|
|
44839
|
+
var bottom=this.ClientRect.Bottom;
|
|
44840
|
+
var lineHeight=this.LineHeight*GetDevicePixelRatio();
|
|
44841
|
+
|
|
44842
|
+
this.Canvas.save();
|
|
44843
|
+
this.Canvas.translate(left, top);
|
|
44844
|
+
this.Canvas.rotate(90 * Math.PI / 180);
|
|
44845
|
+
|
|
44846
|
+
var yText=0, xText=0;
|
|
44847
|
+
for(var i=0;i<aryText.length;++i)
|
|
44848
|
+
{
|
|
44849
|
+
var item=aryText[i];
|
|
44850
|
+
yText=0;
|
|
44851
|
+
var textColor=item.TitleColor;
|
|
44852
|
+
if (item.TitleColor) textColor=item.TitleColor;
|
|
44853
|
+
this.Canvas.fillStyle=textColor;
|
|
44854
|
+
this.Canvas.fillText(item.Title,yText,xText);
|
|
44855
|
+
var textWidth=this.Canvas.measureText(item.Title).width+4*this.PixelRatio;
|
|
44856
|
+
var yText=textWidth;
|
|
44857
|
+
|
|
44858
|
+
if (item.Text)
|
|
44859
|
+
{
|
|
44860
|
+
var textColor=item.TitleColor;
|
|
44861
|
+
if (item.TextColor) textColor=item.TextColor;
|
|
44862
|
+
this.Canvas.fillStyle=textColor;
|
|
44863
|
+
this.Canvas.fillText(item.Text,yText,xText);
|
|
44864
|
+
}
|
|
44865
|
+
|
|
44866
|
+
xText-=lineHeight;
|
|
44867
|
+
}
|
|
44868
|
+
|
|
44869
|
+
|
|
44870
|
+
this.Canvas.restore();
|
|
44871
|
+
}
|
|
44872
|
+
|
|
44628
44873
|
this.DrawChipInfo=function()
|
|
44629
44874
|
{
|
|
44630
44875
|
var aryText=this.GetChipInfoTitle();
|
|
@@ -44652,27 +44897,94 @@ function StockChipPhone()
|
|
|
44652
44897
|
var textWidth=this.Canvas.measureText(item.Title).width+4;
|
|
44653
44898
|
var xText=left+textWidth;
|
|
44654
44899
|
|
|
44655
|
-
|
|
44656
|
-
|
|
44657
|
-
|
|
44658
|
-
|
|
44900
|
+
if (item.Text)
|
|
44901
|
+
{
|
|
44902
|
+
var textColor=item.TitleColor;
|
|
44903
|
+
if (item.TextColor) textColor=item.TextColor;
|
|
44904
|
+
this.Canvas.fillStyle=textColor;
|
|
44905
|
+
this.Canvas.fillText(item.Text,xText,yText);
|
|
44906
|
+
}
|
|
44907
|
+
|
|
44908
|
+
if (item.Type==1)
|
|
44909
|
+
{
|
|
44910
|
+
var barLeft=left+textWidth+2;
|
|
44911
|
+
var barWidth=(right-5-barLeft);
|
|
44912
|
+
this.Canvas.strokeStyle=this.ColorNoProfit;
|
|
44913
|
+
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
|
|
44914
|
+
this.Canvas.strokeStyle=this.ColorProfit;
|
|
44915
|
+
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
|
|
44916
|
+
var text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
|
|
44917
|
+
this.Canvas.textAlign='center';
|
|
44918
|
+
this.Canvas.fillText(text,barLeft+barWidth/2,yText);
|
|
44919
|
+
}
|
|
44659
44920
|
|
|
44660
44921
|
yText-=lineHeight;
|
|
44661
44922
|
}
|
|
44923
|
+
}
|
|
44924
|
+
|
|
44925
|
+
this.DrawDayChip=function()
|
|
44926
|
+
{
|
|
44927
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.Data.DayChip)) return;
|
|
44928
|
+
|
|
44929
|
+
var KLineFrame=this.HQChart.Frame.SubFrame[0].Frame;
|
|
44930
|
+
for(var i=0;i<this.Data.DayChip.length;++i)
|
|
44931
|
+
{
|
|
44932
|
+
var aryPoint=[];
|
|
44933
|
+
var chipData=this.Data.DayChip[i].Chip;
|
|
44934
|
+
if (!chipData) continue;
|
|
44935
|
+
var totalVol=0;
|
|
44936
|
+
for(var j=0;j<chipData.length;++j)
|
|
44937
|
+
{
|
|
44938
|
+
var vol=chipData[j];
|
|
44939
|
+
if(!vol) continue;
|
|
44940
|
+
totalVol+=vol;
|
|
44941
|
+
var price=(j+this.Data.MinPrice)/100;
|
|
44942
|
+
if (this.IsHScreen)
|
|
44943
|
+
{
|
|
44944
|
+
var y=KLineFrame.GetYFromData(price);
|
|
44945
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Height+this.ClientRect.Top;
|
|
44946
|
+
}
|
|
44947
|
+
else
|
|
44948
|
+
{
|
|
44949
|
+
var y=KLineFrame.GetYFromData(price);
|
|
44950
|
+
var x=(vol/this.Data.MaxVol)*this.ClientRect.Width+this.ClientRect.Left;
|
|
44951
|
+
}
|
|
44952
|
+
|
|
44953
|
+
aryPoint.push({X:x,Y:y});
|
|
44954
|
+
}
|
|
44955
|
+
this.Data.DayChip[i].Vol=totalVol;
|
|
44956
|
+
this.DrawArea(aryPoint,this.Data.DayChip[i].Color);
|
|
44957
|
+
}
|
|
44958
|
+
}
|
|
44959
|
+
|
|
44960
|
+
this.DrawArea=function(aryPoint,color)
|
|
44961
|
+
{
|
|
44962
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(aryPoint)) return;
|
|
44963
|
+
|
|
44964
|
+
this.Canvas.fillStyle=color;
|
|
44965
|
+
this.Canvas.beginPath();
|
|
44966
|
+
if (this.IsHScreen)
|
|
44967
|
+
{
|
|
44968
|
+
this.Canvas.moveTo(aryPoint[0].Y,this.ClientRect.Top);
|
|
44969
|
+
for(var i=0; i<aryPoint.length; ++i)
|
|
44970
|
+
{
|
|
44971
|
+
var item=aryPoint[i];
|
|
44972
|
+
this.Canvas.lineTo(item.Y,item.X);
|
|
44973
|
+
}
|
|
44974
|
+
this.Canvas.lineTo(aryPoint[aryPoint.length-1].Y,this.ClientRect.Top);
|
|
44975
|
+
}
|
|
44976
|
+
else
|
|
44977
|
+
{
|
|
44978
|
+
this.Canvas.moveTo(this.ClientRect.Left,aryPoint[0].Y);
|
|
44979
|
+
for(var i=0; i<aryPoint.length; ++i)
|
|
44980
|
+
{
|
|
44981
|
+
var item=aryPoint[i];
|
|
44982
|
+
this.Canvas.lineTo(item.X,item.Y);
|
|
44983
|
+
}
|
|
44984
|
+
this.Canvas.lineTo(this.ClientRect.Left,aryPoint[aryPoint.length-1].Y);
|
|
44985
|
+
}
|
|
44662
44986
|
|
|
44663
|
-
|
|
44664
|
-
this.Canvas.fillText(text,left,yText);
|
|
44665
|
-
var textWidth=this.Canvas.measureText(text).width+2;
|
|
44666
|
-
var barLeft=left+textWidth;
|
|
44667
|
-
var barWidth=(right-5-barLeft);
|
|
44668
|
-
this.Canvas.strokeStyle=this.ColorNoProfit;
|
|
44669
|
-
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth,lineHeight);
|
|
44670
|
-
this.Canvas.strokeStyle=this.ColorProfit;
|
|
44671
|
-
this.Canvas.strokeRect(barLeft,yText-lineHeight,barWidth*(this.Data.ChipInfo.ProfitRate/100),lineHeight);
|
|
44672
|
-
text=this.Data.ChipInfo.ProfitRate.toFixed(2)+'%';
|
|
44673
|
-
this.Canvas.textAlign='center';
|
|
44674
|
-
this.Canvas.fillText(text,barLeft+barWidth/2,yText);
|
|
44675
|
-
yText-=lineHeight;
|
|
44987
|
+
this.Canvas.fill();
|
|
44676
44988
|
}
|
|
44677
44989
|
}
|
|
44678
44990
|
|
|
@@ -77206,6 +77518,52 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
77206
77518
|
this.Draw();
|
|
77207
77519
|
}
|
|
77208
77520
|
|
|
77521
|
+
//获取筹码图 className=指定筹码类名 否则就查询所有
|
|
77522
|
+
this.GetStockChipChart=function(className)
|
|
77523
|
+
{
|
|
77524
|
+
if (className)
|
|
77525
|
+
return this.GetExtendChartByClassName(className);
|
|
77526
|
+
|
|
77527
|
+
var chart=this.GetExtendChartByClassName('StockChip');
|
|
77528
|
+
if (chart) return chart;
|
|
77529
|
+
|
|
77530
|
+
chart=this.GetExtendChartByClassName("StockChipPhone");
|
|
77531
|
+
return chart;
|
|
77532
|
+
}
|
|
77533
|
+
|
|
77534
|
+
this.DeleteStockChipChart=function()
|
|
77535
|
+
{
|
|
77536
|
+
var stockChip=this.GetStockChipChart();
|
|
77537
|
+
if (!stockChip) return;
|
|
77538
|
+
|
|
77539
|
+
var chipWidth=stockChip.Chart.Width;
|
|
77540
|
+
this.DeleteExtendChart(stockChip);
|
|
77541
|
+
this.Frame.ChartBorder.Right-=chipWidth;
|
|
77542
|
+
if (stockChip.Chart.ClassName=="StockChipPhone")
|
|
77543
|
+
{
|
|
77544
|
+
this.GlobalOption.RightHorizontal.Show=true;
|
|
77545
|
+
this.Frame.ResetXYSplit();
|
|
77546
|
+
}
|
|
77547
|
+
this.SetSizeChange(true);
|
|
77548
|
+
this.Draw();
|
|
77549
|
+
}
|
|
77550
|
+
|
|
77551
|
+
this.CreateStockChipPhone=function(option)
|
|
77552
|
+
{
|
|
77553
|
+
var chart=new StockChipPhone();
|
|
77554
|
+
chart.Canvas=this.Canvas;
|
|
77555
|
+
chart.ChartBorder=this.Frame.ChartBorder;
|
|
77556
|
+
chart.ChartFrame=this.Frame;
|
|
77557
|
+
chart.HQChart=this;
|
|
77558
|
+
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
77559
|
+
chart.SetOption(option);
|
|
77560
|
+
this.ExtendChartPaint.push(chart);
|
|
77561
|
+
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
77562
|
+
this.GlobalOption.RightHorizontal.Show=false;
|
|
77563
|
+
|
|
77564
|
+
return chart;
|
|
77565
|
+
}
|
|
77566
|
+
|
|
77209
77567
|
this.CreateExtendChart=function(name, option) //创建扩展图形
|
|
77210
77568
|
{
|
|
77211
77569
|
var chart;
|
|
@@ -77224,17 +77582,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
77224
77582
|
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
77225
77583
|
return chart;
|
|
77226
77584
|
case "StockChipPhone":
|
|
77227
|
-
|
|
77228
|
-
chart.Canvas=this.Canvas;
|
|
77229
|
-
chart.ChartBorder=this.Frame.ChartBorder;
|
|
77230
|
-
chart.ChartFrame=this.Frame;
|
|
77231
|
-
chart.HQChart=this;
|
|
77232
|
-
chart.Left=this.Frame.ChartBorder.Right; //左边间距使用当前框架间距
|
|
77233
|
-
chart.SetOption(option);
|
|
77234
|
-
this.ExtendChartPaint.push(chart);
|
|
77235
|
-
this.Frame.ChartBorder.Right+=chart.Width; //创建筹码需要增加右边的间距
|
|
77236
|
-
this.GlobalOption.RightHorizontal.Show=false;
|
|
77237
|
-
return chart;
|
|
77585
|
+
return this.CreateStockChipPhone(option);
|
|
77238
77586
|
case 'KLineTooltip':
|
|
77239
77587
|
if (option.Create && typeof(option.Create)=='function') chart=option.Create();
|
|
77240
77588
|
else chart=new KLineTooltipPaint();
|
|
@@ -78408,7 +78756,9 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78408
78756
|
|
|
78409
78757
|
var bBGSpit=false, bShowStockChip=false;
|
|
78410
78758
|
if (this.GetExtendChartByClassName("SessionBreaksPaint")) bBGSpit=true;
|
|
78411
|
-
if (this.
|
|
78759
|
+
if (this.GetStockChipChart()) bShowStockChip=true; //筹码
|
|
78760
|
+
var stockChipConfig={Name:'StockChip', ShowType:1, Width:230 };
|
|
78761
|
+
//var stockChipConfig={Name:'StockChipPhone', Width:150 }; //手机版筹码
|
|
78412
78762
|
|
|
78413
78763
|
var bShowCorss=false; //十字光标十字线
|
|
78414
78764
|
if (this.ChartCorssCursor) bShowCorss=this.ChartCorssCursor.IsShowCorss;
|
|
@@ -78583,7 +78933,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
78583
78933
|
|
|
78584
78934
|
{ Name:"画图工具", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_DRAWTOOL_ID, Args:[]}, Checked:this.IsShowDrawToolDialog() },
|
|
78585
78935
|
|
|
78586
|
-
{ Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[]}, Checked:bShowStockChip},
|
|
78936
|
+
{ Name:"移动筹码图", Data:{ ID:bShowStockChip?JSCHART_MENU_ID.CMD_HIDE_STOCKCHIP_ID:JSCHART_MENU_ID.CMD_SHOW_STOCKCHIP_ID, Args:[stockChipConfig.Name, stockChipConfig]}, Checked:bShowStockChip},
|
|
78587
78937
|
|
|
78588
78938
|
{ Name:"十字光标线", Data:{ ID:JSCHART_MENU_ID.CMD_SHOW_CORSS_LINE_ID, Args:[!bShowCorss]}, Checked:bShowCorss },
|
|
78589
78939
|
|
|
@@ -88066,6 +88416,8 @@ function KLineChartHScreenContainer(uielement)
|
|
|
88066
88416
|
frame.ChartBorder=border;
|
|
88067
88417
|
frame.Identify=i; //窗口序号
|
|
88068
88418
|
frame.RightSpaceCount=this.RightSpaceCount; //右边
|
|
88419
|
+
frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
88420
|
+
frame.GlobalOption=this.GlobalOption;
|
|
88069
88421
|
|
|
88070
88422
|
frame.HorizontalMax=20;
|
|
88071
88423
|
frame.HorizontalMin=10;
|
|
@@ -88076,6 +88428,7 @@ function KLineChartHScreenContainer(uielement)
|
|
|
88076
88428
|
frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');
|
|
88077
88429
|
frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');
|
|
88078
88430
|
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
|
|
88431
|
+
frame.YSplitOperator.HQChart=this;
|
|
88079
88432
|
//主图上下间距
|
|
88080
88433
|
var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
|
|
88081
88434
|
border.TopSpace=12*pixelTatio;
|
|
@@ -88086,6 +88439,8 @@ function KLineChartHScreenContainer(uielement)
|
|
|
88086
88439
|
frame.YSplitOperator=new FrameSplitY();
|
|
88087
88440
|
frame.YSplitOperator.LanguageID=this.LanguageID;
|
|
88088
88441
|
frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');
|
|
88442
|
+
frame.YSplitOperator.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
|
|
88443
|
+
frame.YSplitOperator.HQChart=this;
|
|
88089
88444
|
//frame.IsLocked = true;
|
|
88090
88445
|
}
|
|
88091
88446
|
|
|
@@ -88119,6 +88474,39 @@ function KLineChartHScreenContainer(uielement)
|
|
|
88119
88474
|
this.Frame.SubFrame[i]=subFrame;
|
|
88120
88475
|
}
|
|
88121
88476
|
}
|
|
88477
|
+
|
|
88478
|
+
this.CreateStockChipPhone=function(option)
|
|
88479
|
+
{
|
|
88480
|
+
var chart=new StockChipPhone();
|
|
88481
|
+
chart.Canvas=this.Canvas;
|
|
88482
|
+
chart.ChartBorder=this.Frame.ChartBorder;
|
|
88483
|
+
chart.ChartFrame=this.Frame;
|
|
88484
|
+
chart.HQChart=this;
|
|
88485
|
+
chart.Left=this.Frame.ChartBorder.Bottom; //左边间距使用当前框架间距
|
|
88486
|
+
chart.SetOption(option);
|
|
88487
|
+
this.ExtendChartPaint.push(chart);
|
|
88488
|
+
this.Frame.ChartBorder.Bottom+=chart.Width; //创建筹码需要增加右边的间距
|
|
88489
|
+
this.GlobalOption.RightHorizontal.Show=false;
|
|
88490
|
+
|
|
88491
|
+
return chart;
|
|
88492
|
+
}
|
|
88493
|
+
|
|
88494
|
+
this.DeleteStockChipChart=function()
|
|
88495
|
+
{
|
|
88496
|
+
var stockChip=this.GetStockChipChart();
|
|
88497
|
+
if (!stockChip) return;
|
|
88498
|
+
|
|
88499
|
+
var chipWidth=stockChip.Chart.Width;
|
|
88500
|
+
this.DeleteExtendChart(stockChip);
|
|
88501
|
+
this.Frame.ChartBorder.Bottom-=chipWidth;
|
|
88502
|
+
if (stockChip.Chart.ClassName=="StockChipPhone")
|
|
88503
|
+
{
|
|
88504
|
+
this.GlobalOption.RightHorizontal.Show=true;
|
|
88505
|
+
this.Frame.ResetXYSplit();
|
|
88506
|
+
}
|
|
88507
|
+
this.SetSizeChange(true);
|
|
88508
|
+
this.Draw();
|
|
88509
|
+
}
|
|
88122
88510
|
}
|
|
88123
88511
|
|
|
88124
88512
|
|