hqchart 1.1.13259 → 1.1.13263
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
CHANGED
|
@@ -4176,7 +4176,7 @@ this.Price;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)retur
|
|
|
4176
4176
|
}var x=left+textWidth;this.Canvas.strokeStyle=this.Line.Color;this.Canvas.beginPath();this.Canvas.moveTo(x,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));this.Canvas.stroke();if(this.Line.Type==2){this.Canvas.restore();}}};this.GetMaxMin=function(){var range={Min:null,Max:null};if(IFrameSplitOperator.IsNumber(this.Price)){range.Min=this.Price;range.Max=this.Price;}return range;};}// 柱子集合 支持横屏
|
|
4177
4177
|
function ChartMultiBar(){this.newMethod=IChartPainting;//派生
|
|
4178
4178
|
this.newMethod();delete this.newMethod;this.ClassName="ChartMultiBar";this.Bars=[];// [ {Point:[ {Index, Value, Value2 }, ], Color:, Width: , Type: 0 实心 1 空心 }, ]
|
|
4179
|
-
this.IsHScreen=false;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(!this.Data||this.Data.length<=0)return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;var dataWidth=this.ChartFrame.DataWidth;var pixelRatio=GetDevicePixelRatio();var drawBars=[];for(var i in this.Bars){var item=this.Bars[i];var drawPoints={Point:[],Color:item.Color,Width:dataWidth,Type:0};if(item.Type>0)drawPoints.Type=item.Type;if(item.Width>0){drawPoints.Width=item.Width*pixelRatio;if(drawPoints.Width>dataWidth)drawPoints.Width=dataWidth;}else{if(drawPoints.Width<4)drawPoints.Width=1*pixelRatio;}for(var j in item.Point){var point=item.Point[j];if(!IFrameSplitOperator.IsNumber(point.Index))continue;var index=point.Index-offset;if(index>=0&&index<xPointCount){var x=this.ChartFrame.GetXFromIndex(index);var y=this.ChartFrame.GetYFromData(point.Value);var y2=this.ChartFrame.GetYFromData(point.Value2);drawPoints.Point.push({X:x,Y:y,Y2:y2});}}if(drawPoints.Point.length>0)drawBars.push(drawPoints);}for(var i in drawBars){var item=drawBars[i];if(item.Width>=4){if(item.Type==1)this.DrawHollowBar(item);else this.DrawFillBar(item);}else{this.DrawLineBar(item);}}};this.DrawLineBar=function(bar){this.Canvas.strokeStyle=bar.Color;var backupLineWidth=this.Canvas.lineWidth;this.Canvas.lineWidth=bar.Width;for(var i in bar.Point){var item=bar.Point[i];this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(item.Y),ToFixedPoint(item.X));this.Canvas.lineTo(ToFixedPoint(item.Y2),ToFixedPoint(item.X));}else{this.Canvas.moveTo(ToFixedPoint(item.X),ToFixedPoint(item.Y));this.Canvas.lineTo(ToFixedPoint(item.X),ToFixedPoint(item.Y2));}this.Canvas.stroke();}this.Canvas.lineWidth=backupLineWidth;};this.DrawFillBar=function(bar){this.Canvas.fillStyle=bar.Color;for(var i in bar.Point){var item=bar.Point[i];var x=item.X-bar.Width/2;var y=Math.min(item.Y,item.Y2);var barWidth=bar.Width;var barHeight=Math.abs(item.Y-item.Y2);if(this.IsHScreen)this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(x),ToFixedRect(barHeight),ToFixedRect(barWidth));else this.Canvas.fillRect(ToFixedRect(x),ToFixedRect(y),ToFixedRect(barWidth),ToFixedRect(barHeight));}};this.DrawHollowBar=function(bar)//空心柱子
|
|
4179
|
+
this.IsHScreen=false;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||this.Data.length<=0)return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;var dataWidth=this.ChartFrame.DataWidth;var pixelRatio=GetDevicePixelRatio();var drawBars=[];for(var i in this.Bars){var item=this.Bars[i];var drawPoints={Point:[],Color:item.Color,Width:dataWidth,Type:0};if(item.Type>0)drawPoints.Type=item.Type;if(item.Width>0){drawPoints.Width=item.Width*pixelRatio;if(drawPoints.Width>dataWidth)drawPoints.Width=dataWidth;}else{if(drawPoints.Width<4)drawPoints.Width=1*pixelRatio;}for(var j in item.Point){var point=item.Point[j];if(!IFrameSplitOperator.IsNumber(point.Index))continue;var index=point.Index-offset;if(index>=0&&index<xPointCount){var x=this.ChartFrame.GetXFromIndex(index);var y=this.ChartFrame.GetYFromData(point.Value);var y2=this.ChartFrame.GetYFromData(point.Value2);drawPoints.Point.push({X:x,Y:y,Y2:y2});}}if(drawPoints.Point.length>0)drawBars.push(drawPoints);}for(var i in drawBars){var item=drawBars[i];if(item.Width>=4){if(item.Type==1)this.DrawHollowBar(item);else this.DrawFillBar(item);}else{this.DrawLineBar(item);}}};this.DrawLineBar=function(bar){this.Canvas.strokeStyle=bar.Color;var backupLineWidth=this.Canvas.lineWidth;this.Canvas.lineWidth=bar.Width;for(var i in bar.Point){var item=bar.Point[i];this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(item.Y),ToFixedPoint(item.X));this.Canvas.lineTo(ToFixedPoint(item.Y2),ToFixedPoint(item.X));}else{this.Canvas.moveTo(ToFixedPoint(item.X),ToFixedPoint(item.Y));this.Canvas.lineTo(ToFixedPoint(item.X),ToFixedPoint(item.Y2));}this.Canvas.stroke();}this.Canvas.lineWidth=backupLineWidth;};this.DrawFillBar=function(bar){this.Canvas.fillStyle=bar.Color;for(var i in bar.Point){var item=bar.Point[i];var x=item.X-bar.Width/2;var y=Math.min(item.Y,item.Y2);var barWidth=bar.Width;var barHeight=Math.abs(item.Y-item.Y2);if(this.IsHScreen)this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(x),ToFixedRect(barHeight),ToFixedRect(barWidth));else this.Canvas.fillRect(ToFixedRect(x),ToFixedRect(y),ToFixedRect(barWidth),ToFixedRect(barHeight));}};this.DrawHollowBar=function(bar)//空心柱子
|
|
4180
4180
|
{this.Canvas.strokeStyle=bar.Color;var backupLineWidth=1;for(var i in bar.Point){var item=bar.Point[i];var x=item.X-bar.Width/2;var y=Math.min(item.Y,item.Y2);var barWidth=bar.Width;var barHeight=Math.abs(item.Y-item.Y2);this.Canvas.beginPath();if(this.IsHScreen)this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(x),ToFixedRect(barHeight),ToFixedRect(barWidth));else this.Canvas.rect(ToFixedPoint(x),ToFixedPoint(y),ToFixedRect(barWidth),ToFixedRect(barHeight));this.Canvas.stroke();}this.Canvas.lineWidth=backupLineWidth;};this.GetMaxMin=function(){var range={Min:null,Max:null};var xPointCount=this.ChartFrame.XPointCount;var start=this.Data.DataOffset;var end=start+xPointCount;for(var i in this.Bars){var item=this.Bars[i];for(var j in item.Point){var point=item.Point[j];if(point.Index>=start&&point.Index<end){var minValue=Math.min(point.Value,point.Value2);var maxValue=Math.max(point.Value,point.Value2);if(range.Max==null)range.Max=maxValue;else if(range.Max<maxValue)range.Max=maxValue;if(range.Min==null)range.Min=minValue;else if(range.Min>minValue)range.Min=minValue;}}}return range;};}// 线段集合 支持横屏
|
|
4181
4181
|
function ChartMultiLine(){this.newMethod=IChartPainting;//派生
|
|
4182
4182
|
this.newMethod();delete this.newMethod;this.ClassName="ChartMultiLine";this.Lines=[];// [ {Point:[ {Index, Value }, ], Color: }, ]
|
|
@@ -6013,14 +6013,15 @@ this.Super_ExportStorageData=this.ExportStorageData;//this.Label; //{Tex
|
|
|
6013
6013
|
this.LineWidth=1;this.Precision=2;//小数位数
|
|
6014
6014
|
this.ValueTextColor='rgb(250,250,250)';this.IsShowCorssCursor=true;//画的时候是否显示十字光标
|
|
6015
6015
|
this.GetLabelCallback;//绘制标题回调函数
|
|
6016
|
-
this.PointCount=1;this.ClassName='ChartDrawHLine';this.Font=14*GetDevicePixelRatio()+"px 微软雅黑";this.TextFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.RightSpaceWidth=50;this.ButtonPosition=0;//按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐
|
|
6016
|
+
this.PointCount=1;this.ClassName='ChartDrawHLine';this.Font=14*GetDevicePixelRatio()+"px 微软雅黑";this.TextFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.RightSpaceWidth=50;this.ButtonPosition=0;//按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
|
|
6017
6017
|
this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.TextMargin={Left:0,Right:0};this.Button={CloseIcon:{Text:'\uE62B',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE,TooltipText:null,Margin:{Left:2,Right:2}},SettingIcon:{Text:'\uE623',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING,TooltipText:null,Margin:{Left:2,Right:2}//修改ID, Text , TooltipText 可以外部定制按钮
|
|
6018
6018
|
}};this.CustomButton=[];//自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null, Data:null }
|
|
6019
6019
|
this.AryShowButton=[];//需要显示的按钮 { Data:, Width }
|
|
6020
6020
|
this.AryButton=[];this.ExtendData;//扩展数据
|
|
6021
6021
|
this.ShowPriceTextConfig={IsShow:[false,false,true],//[0]=left内 [1]=right内 [2]=right外
|
|
6022
6022
|
Font:[12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1']};//内部变量
|
|
6023
|
-
this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.
|
|
6023
|
+
this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.VerticalButtonInfo={Width:0,Height:0};//垂直按钮信息
|
|
6024
|
+
this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.GetLabelCallback){this.GetLabelCallback=option.GetLabelCallback;}if(IFrameSplitOperator.IsNumber(option.Precision))this.Precision=option.Precision;if(option.Font)this.Font=option.Font;if(option.ValueTextColor)this.ValueTextColor=option.ValueTextColor;if(option.ButtonBGColor)this.ButtonBGColor=option.ButtonBGColor;if(IFrameSplitOperator.IsNumber(option.ButtonPosition))this.ButtonPosition=option.ButtonPosition;if(IFrameSplitOperator.IsNumber(option.RightSpaceWidth))this.RightSpaceWidth=option.RightSpaceWidth;if(option.Button){var item=option.Button;if(item.CloseIcon){this.Button.CloseIcon=CloneData(item.CloseIcon);if(!this.Button.CloseIcon.ID)this.Button.CloseIcon.ID=JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE;}else if(item.CloseIcon===null){this.Button.CloseIcon=null;}if(item.SettingIcon){this.Button.SettingIcon=CloneData(item.SettingIcon);if(!this.Button.SettingIcon.ID)this.Button.SettingIcon.ID=JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING;}else if(item.SettingIcon===null){this.Button.SettingIcon=null;}}if(option.ExtendData)this.ExtendData=option.ExtendData;if(IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText)){for(var i=0;i<option.IsShowPriceText.length&&i<3;++i){var value=option.IsShowPriceText[i];if(IFrameSplitOperator.IsBool(value))this.ShowPriceTextConfig.IsShow[i]=value;}}if(option.TextMargin){var item=option.TextMargin;if(IFrameSplitOperator.IsNumber(item.Left))this.TextMargin.Left=item.Left;if(IFrameSplitOperator.IsNumber(item.Right))this.TextMargin.Right=item.Right;}}};this.ExportStorageData=function(){var storageData;if(this.Super_ExportStorageData){storageData=this.Super_ExportStorageData();if(this.Label)storageData.Label=this.Label;}return storageData;};this.IsPointIn=this.IsPointIn_XYValue_Line;/*
|
|
6024
6025
|
this.GetXYCoordinate=function()
|
|
6025
6026
|
{
|
|
6026
6027
|
if (this.IsFrameMinSize()) return null;
|
|
@@ -6030,7 +6031,7 @@ this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.SetOpt
|
|
|
6030
6031
|
}
|
|
6031
6032
|
*/this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
6032
6033
|
{if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};//获取需要显示的按钮 系统按钮+自定义按钮
|
|
6033
|
-
this.GetShowButton=function(){var aryButton=[];var item=this.Button.SettingIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});item=this.Button.CloseIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomButton)){for(var i=0;i<this.CustomButton.length;++i){item=this.CustomButton[i];if(item&&item.Text)aryButton.push({Data:item,Width:null});}}return aryButton;};this.Draw=function(moveonPoint,mouseStatus){this.AryShowButton=[];this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return null;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
|
|
6034
|
+
this.GetShowButton=function(){var aryButton=[];var item=this.Button.SettingIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});item=this.Button.CloseIcon;if(item&&item.Text)aryButton.push({Data:item,Width:null});if(IFrameSplitOperator.IsNonEmptyArray(this.CustomButton)){for(var i=0;i<this.CustomButton.length;++i){item=this.CustomButton[i];if(item&&item.Text)aryButton.push({Data:item,Width:null});}}return aryButton;};this.Draw=function(moveonPoint,mouseStatus){this.AryShowButton=[];this.LinePoint=[];this.AryButton=[];this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.VerticalButtonInfo.Width=0;this.VerticalButtonInfo.Height=0;if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint();if(!drawPoint||drawPoint.length!=1)return;if(!this.Frame)return;if(this.Value.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return null;var isHScreen=this.Frame.IsHScreen;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(isHScreen){left=this.Frame.ChartBorder.GetTop();right=this.Frame.ChartBorder.GetBottom();}this.ClipFrame();//画线段
|
|
6034
6035
|
this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(drawPoint[0].X,left);this.Canvas.lineTo(drawPoint[0].X,right);}else{this.Canvas.moveTo(left,ToFixedPoint(drawPoint[0].Y));this.Canvas.lineTo(right,ToFixedPoint(drawPoint[0].Y));}this.Canvas.stroke();this.RestoreLineWidth();//画水平线段
|
|
6035
6036
|
var line={Start:new Point(),End:new Point()};if(isHScreen){line.Start.X=drawPoint[0].X;line.Start.Y=left;line.End.X=drawPoint[0].X;line.End.Y=right;}else{line.Start.X=left;line.Start.Y=drawPoint[0].Y;line.End.X=right;line.End.Y=drawPoint[0].Y;}this.LinePoint.push(line);var yValue=this.Frame.GetYData(drawPoint[0].Y);var strPrice=yValue.toFixed(this.Precision);if(this.ShowPriceTextConfig.IsShow[0]){this.DrawPriceText(strPrice,line.Start,line.End,0);}if(this.ShowPriceTextConfig.IsShow[1]){this.DrawPriceText(strPrice,line.Start,line.End,1);}var labInfo;if(this.GetLabelCallback)labInfo=this.GetLabelCallback(this);this.AryShowButton=this.GetShowButton();//获取按钮
|
|
6036
6037
|
//描述信息
|
|
@@ -6039,11 +6040,13 @@ var xCenter=left+(right-left)/2;var point={X:xCenter,Y:drawPoint[0].Y};this.Draw
|
|
|
6039
6040
|
if(this.ShowPriceTextConfig.IsShow[2]){var rtDraw={};this.CalculateButtonSize();this.DrawValueText(drawPoint[0].Y,rtDraw,labInfo);if(labInfo)this.DrawRightLab(labInfo,rtDraw);if(labInfo)this.DrawCustomHLine(labInfo,drawPoint[0].Y);}//鼠标是否在按钮上
|
|
6040
6041
|
if(moveonPoint&&mouseStatus){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];var rtButton=item.Rect;if(moveonPoint.X>=rtButton.Left&&moveonPoint.X<rtButton.Right&&moveonPoint.Y>=rtButton.Top&&moveonPoint.Y<=rtButton.Bottom){mouseStatus.MouseOnToolbar={Rect:rtButton,Item:item,Frame:this.Frame,Point:{X:moveonPoint.X,Y:moveonPoint.Y}};break;}}}};this.CalculateLabSize=function(labInfo){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";this.Canvas.font=this.TextFont;var lineHeight=this.Canvas.measureText("擎").width+2;var maxNameWidth=0,maxTextWidth=0;var lineCount=0;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labInfo.LineSpace))lineSpace=labInfo.LineSpace;var maxNameWidth=0,maxTextWidth=0;var lineCount=0;var maxWidth=0;for(var i=0;i<labInfo.AryText.length;++i){var item=labInfo.AryText[i];item.NameWidth=0;item.TextWidth=0;if(item.Name)item.NameWidth=this.Canvas.measureText(item.Name).width+2;if(item.Text)item.TextWidth=this.Canvas.measureText(item.Text).width+2;if(maxNameWidth<item.NameWidth)maxNameWidth=item.NameWidth;if(maxTextWidth<item.TextWidth)maxTextWidth=item.TextWidth;var itemWidth=item.NameWidth+item.TextWidth;if(maxWidth<itemWidth)maxWidth=itemWidth;++lineCount;}var size={Width:maxWidth,Height:lineCount*(lineHeight+lineSpace)+lineSpace,NameWidth:maxNameWidth,TextWidth:maxTextWidth,LineHeight:lineHeight};return size;};this.DrawLab=function(labInfo,y){if(!labInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(labInfo.AryText))return;if(labInfo.Position===2)return;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var labSize=this.CalculateLabSize(labInfo);var drawLeft=right-labSize.Width;var drawTop=y-labSize.Height-1;//背景色
|
|
6041
6042
|
if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=y-labSize.Height-4;this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(right+drawLeft),ToFixedRect(y-rtTop));}var yText=drawTop;for(var i=0;i<labInfo.AryText.length;++i){var item=labInfo.AryText[i];if(item.Name){this.Canvas.fillStyle=item.NameColor;this.Canvas.fillText(item.Name,drawLeft+1,yText+1);}if(item.Text){this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,drawLeft+labSize.NameWidth+1,yText+1);}yText+=labSize.LineHeight;}};this.DrawRightLab=function(labInfo,rtLeftDraw){if(!labInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(labInfo.AryText))return;if(labInfo.Position!=2)return;var labSize=this.CalculateLabSize(labInfo);var drawLeft=rtLeftDraw.Right-labSize.Width;if(drawLeft<rtLeftDraw.Left)drawLeft=rtLeftDraw.Left;var drawRight=drawLeft+labSize.Width;var drawTop=rtLeftDraw.Bottom;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labInfo.LineSpace))lineSpace=labInfo.LineSpace;//背景色
|
|
6042
|
-
if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;
|
|
6043
|
+
var rtLab={Left:drawLeft,Top:drawTop,Width:labSize.Width,Height:labSize.Height};rtLab.Right=rtLab.Left+rtLab.Width;rtLab.Bottom=rtLab.Top+rtLab.Height;if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;this.Canvas.fillRect(ToFixedRect(rtLab.Left),ToFixedRect(rtLab.Top),ToFixedRect(rtLab.Width),ToFixedRect(rtLab.Height));}var yText=drawTop+1+lineSpace;this.Canvas.textBaseline="top";for(var i=0;i<labInfo.AryText.length;++i){var item=labInfo.AryText[i];if(item.Name){this.Canvas.textAlign="left";this.Canvas.fillStyle=item.NameColor;this.Canvas.fillText(item.Name,drawLeft+1,yText+1);}if(item.Text){this.Canvas.textAlign="right";this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Text,drawRight-1,yText+1);}yText+=labSize.LineHeight+lineSpace;}this.DrawVerticalButton(rtLab);};this.DrawCustomHLine=function(labInfo,yLine){if(!labInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(labInfo.AryLine))return;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var pixelRatio=GetDevicePixelRatio();var yMax=yLine,yMin=yLine;for(var i=0;i<labInfo.AryLine.length;++i){var item=labInfo.AryLine[i];if(!IFrameSplitOperator.IsNumber(item.Value))continue;if(item.Width<0)continue;var y=this.Frame.GetYFromData(item.Value);var yFixed=ToFixedPoint(y);var xRight=right;if(IFrameSplitOperator.IsPlusNumber(item.Width)){if(item.Width<1)xRight=left+item.Width*(right-left);//0.3 百分比
|
|
6043
6044
|
else xRight=left+item.Width*pixelRatio;//>1 实际数值就是长度
|
|
6044
6045
|
}if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(xRight,yFixed);this.Canvas.stroke();if(yMax<yFixed)yMax=yFixed;if(yMin>yFixed)yMin=yFixed;}if(yMax!=yMin&&labInfo.VLine){var item=labInfo.VLine;var x=left+20*pixelRatio;if(IFrameSplitOperator.IsNumber(item.XOffset))x=left+item.XOffset*pixelRatio;x=ToFixedPoint(x);if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,yMax);this.Canvas.lineTo(x,yMin);this.Canvas.stroke();}};this.DrawValueText=function(y,rtDraw,labInfo){var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();if(this.RightSpaceWidth>0){this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();}var yValue=this.Frame.GetYData(y);var strValue=yValue.toFixed(this.Precision);if(labInfo&&labInfo.PriceSuffixText)strValue+=labInfo.PriceSuffixText;this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,Top:y-lineHeight/2,Width:textWidth+4,Height:lineHeight};//rtBG.Right=rtBG.Left+rtBG.Width;
|
|
6045
|
-
rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;var xText=rtBG.Left+this.TextMargin.Left+2;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(strValue,xText,y);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;var totalWidth=0;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;item.Width=this.Canvas.measureText(icon.Text).width+2;if(icon.Margin){var margin=icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;
|
|
6046
|
-
|
|
6046
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;var xText=rtBG.Left+this.TextMargin.Left+2;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(strValue,xText,y);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;var totalWidth=0;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;item.Width=this.Canvas.measureText(icon.Text).width+2;item.Height=item.Width;if(icon.Margin){var margin=icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))item.Height+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))item.Height+=margin.Bottom;}if(this.VerticalButtonInfo.Width<item.Width)this.VerticalButtonInfo.Width=item.Width;this.VerticalButtonInfo.Height+=item.Height;totalWidth+=item.Width;}this.ButtonBGWidth=totalWidth;};//垂直排列按钮
|
|
6047
|
+
this.DrawVerticalButton=function(rtLab){if(this.ButtonPosition!=3)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.VerticalButtonInfo.Height<=0)return;var rtBG={Left:rtLab.Right,Top:rtLab.Top,Width:this.VerticalButtonInfo.Width,Height:this.VerticalButtonInfo.Height};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();var yTop=rtLab.Top;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:rtBG.Left,Top:yTop,Width:this.VerticalButtonInfo.Width,Height:item.Height};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText,Data:icon.Data});yTop=rtButton.Bottom;}};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.ButtonPosition==3)return;//垂直按钮在DrawVerticalButton()调用
|
|
6048
|
+
if(this.ButtonPosition==1){drawTop-=drawHeight;var chartWidth=this.Frame.ChartBorder.GetChartWidth();var chartLeft=this.Frame.ChartBorder.GetRight()+this.RightSpaceWidth;if(drawLeft+this.ButtonBGWidth>chartWidth)//右边不够了 往左移动
|
|
6049
|
+
{drawLeft=chartWidth-this.ButtonBGWidth;}if(rtDraw.Left>drawLeft)drawLeft=rtDraw.Left;}else if(this.ButtonPosition==2){drawTop-=drawHeight;drawLeft=rtDraw.Left;}this.Canvas.fillStyle=this.LineColor;var left=drawLeft;var rtBG={Left:drawLeft,Top:drawTop,Width:this.ButtonBGWidth,Height:drawHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:left,Top:drawTop,Width:item.Width,Height:drawHeight};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText,Data:icon.Data});left=rtButton.Right;}};this.PtInButtons=function(x,y){for(var i=0;i<this.AryButton.length;++i){var item=this.AryButton[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect,Data:item.Data};}}return null;};}//趋势线
|
|
6047
6050
|
function ChartDrawPictureTrendLine(){this.newMethod=IChartDrawPicture;//派生
|
|
6048
6051
|
this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPictureTrendLine';this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:false});if(!drawPoint||drawPoint.length!=2)return;var ptStart=drawPoint[0];var ptEnd=drawPoint[1];var extendLine=this.CalculateExtendLinePoint(ptStart,ptEnd);this.ClipFrame();this.Canvas.strokeStyle=this.LineColor;this.SetLineWidth();this.Canvas.beginPath();this.Canvas.moveTo(extendLine.Start.X,extendLine.Start.Y);this.Canvas.lineTo(extendLine.End.X,extendLine.End.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);this.DrawPoint(drawPoint);//画点
|
|
6049
6052
|
this.Canvas.restore();};}//画图工具-矩形
|
|
@@ -6928,8 +6931,10 @@ this.UpdateFrameMaxMin();//调整坐标最大 最小值
|
|
|
6928
6931
|
this.ResetFrameXSplit();this.Frame.SetSizeChage(true);this.Draw();this.UpdatePointByCursorIndex();//更新十字光标位子
|
|
6929
6932
|
};this.OnWheel=function(e){var _this16=this;JSConsole.Chart.Log('[KLineChartContainer::OnWheel]',e);if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var isInClient=false;this.Canvas.beginPath();this.Canvas.rect(this.Frame.ChartBorder.GetLeft(),this.Frame.ChartBorder.GetTop(),this.Frame.ChartBorder.GetWidth(),this.Frame.ChartBorder.GetHeight());isInClient=this.Canvas.isPointInPath(x,y);var wheelValue=e.wheelDelta;if(!IFrameSplitOperator.IsObjectExist(e.wheelDelta))wheelValue=e.deltaY*-0.01;var enableZoomUpDown=true;//是否允许缩放
|
|
6930
6933
|
if(this.EnableZoomUpDown&&this.EnableZoomUpDown.Wheel===false)enableZoomUpDown=false;if(this.SourceData&&this.SourceData.Data){if(isInClient&&wheelValue<0&&enableZoomUpDown)//缩小
|
|
6931
|
-
{var cursorIndex={ZoomType:this.ZoomType,IsLockRight:this.IsZoomLockRight};cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));if(
|
|
6932
|
-
|
|
6934
|
+
{var cursorIndex={ZoomType:this.ZoomType,IsLockRight:this.IsZoomLockRight};cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));if(e.ctrlKey)cursorIndex.ZoomType=1;//ctrl+滚轴 十字中心缩放
|
|
6935
|
+
if(this.Frame.ZoomDown(cursorIndex,{ZoomDownloadDataCallback:function ZoomDownloadDataCallback(requestData){_this16.ZoomDownloadData(requestData);}})){this.CursorIndex=cursorIndex.Index;this.UpdataDataoffset();this.UpdatePointByCursorIndex();this.UpdateFrameMaxMin();this.ResetFrameXSplit();if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true){}else{this.Draw();}this.OnKLinePageChange("wheel");}}else if(isInClient&&wheelValue>0&&enableZoomUpDown)//放大
|
|
6936
|
+
{var cursorIndex={ZoomType:this.ZoomType,IsLockRight:this.IsZoomLockRight};cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));if(e.ctrlKey)cursorIndex.ZoomType=1;//ctrl+滚轴 十字中心缩放
|
|
6937
|
+
if(this.Frame.ZoomUp(cursorIndex)){JSConsole.Chart.Log("[KLineChartContainer::OnWheel] cursorIndex ",cursorIndex);this.CursorIndex=cursorIndex.Index;this.UpdatePointByCursorIndex();this.UpdataDataoffset();this.UpdateFrameMaxMin();this.ResetFrameXSplit();this.Draw();this.OnKLinePageChange("wheel");}}}if(!isInClient){if(!this.OnWheel_ZoomUpDownFrameY(e,x,y))return;}if(e.preventDefault)e.preventDefault();else e.returnValue=false;};//通过滚轴缩放Y轴
|
|
6933
6938
|
this.OnWheel_ZoomUpDownFrameY=function(e,x,y){if(!this.EnableYDrag.Wheel)return false;var dragY=this.TryYDrag(x,y);if(!dragY)return false;if(dragY.Left&&!dragY.IsOverlay||dragY.Right){}else{return false;}var wheelValue=e.wheelDelta;if(!IFrameSplitOperator.IsObjectExist(e.wheelDelta))wheelValue=e.deltaY*-0.01;var yMove=this.EnableYDrag.WheelYMove;if(wheelValue>0)yMove*=-1;dragY.Position=0;//只能两边缩放
|
|
6934
6939
|
if(!this.Frame.OnZoomUpDownFrameY(dragY,yMove))return false;this.Frame.SetSizeChage(true);this.Draw();return true;};//创建
|
|
6935
6940
|
//windowCount 窗口个数
|
|
@@ -13198,7 +13203,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13198
13203
|
this.ExecuteScript(item,data);}this.Status=0;}};this.OnExecuteFinish=function(data,indexInfo,jsExectute,jobInfo){var message={Data:data,IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.FINISH_EXECUTE_SCRIPT,JobInfo:jobInfo};postMessage(message);};this.OnExecuteError=function(error,indexInfo,jobData){var message={IndexInfo:indexInfo,ID:JSCHART_WORKER_MESSAGE_ID.ERROR_EXECUTE_SCRIPT,Error:error};postMessage(message);};}/********************************************************************************
|
|
13199
13204
|
* 版本信息输出
|
|
13200
13205
|
*
|
|
13201
|
-
*/var HQCHART_VERSION="1.1.
|
|
13206
|
+
*/var HQCHART_VERSION="1.1.13262";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
13202
13207
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13203
13208
|
// BaseIndex:BaseIndex,
|
|
13204
13209
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -36811,7 +36811,9 @@ function ChartMultiBar()
|
|
|
36811
36811
|
|
|
36812
36812
|
this.Draw=function()
|
|
36813
36813
|
{
|
|
36814
|
-
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
36814
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
36815
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
36816
|
+
if (this.IsHideScriptIndex()) return;
|
|
36815
36817
|
if (!this.Data || this.Data.length<=0) return;
|
|
36816
36818
|
|
|
36817
36819
|
this.IsHScreen=(this.ChartFrame.IsHScreen===true);
|
|
@@ -56055,7 +56057,7 @@ function ChartDrawHLine()
|
|
|
56055
56057
|
this.TextFont=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
56056
56058
|
this.RightSpaceWidth=50;
|
|
56057
56059
|
|
|
56058
|
-
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐
|
|
56060
|
+
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
|
|
56059
56061
|
this.ButtonBGColor='rgb(190,190,190)';
|
|
56060
56062
|
this.ButtonSpace=3;
|
|
56061
56063
|
|
|
@@ -56087,6 +56089,8 @@ function ChartDrawHLine()
|
|
|
56087
56089
|
this.ColseButtonSize=0;
|
|
56088
56090
|
this.SettingButtonSize=0;
|
|
56089
56091
|
this.ButtonBGWidth=0;
|
|
56092
|
+
this.VerticalButtonInfo={ Width:0, Height:0 }; //垂直按钮信息
|
|
56093
|
+
|
|
56090
56094
|
|
|
56091
56095
|
|
|
56092
56096
|
this.SetOption=function(option)
|
|
@@ -56223,6 +56227,9 @@ function ChartDrawHLine()
|
|
|
56223
56227
|
this.SettingButtonSize=0;
|
|
56224
56228
|
this.ButtonBGWidth=0;
|
|
56225
56229
|
|
|
56230
|
+
this.VerticalButtonInfo.Width=0;
|
|
56231
|
+
this.VerticalButtonInfo.Height=0;
|
|
56232
|
+
|
|
56226
56233
|
if (this.IsFrameMinSize()) return;
|
|
56227
56234
|
if (!this.IsShow) return;
|
|
56228
56235
|
|
|
@@ -56424,15 +56431,16 @@ function ChartDrawHLine()
|
|
|
56424
56431
|
if (IFrameSplitOperator.IsNumber(labInfo.LineSpace)) lineSpace=labInfo.LineSpace;
|
|
56425
56432
|
|
|
56426
56433
|
//背景色
|
|
56434
|
+
var rtLab={ Left:drawLeft, Top:drawTop, Width:labSize.Width, Height:labSize.Height }
|
|
56435
|
+
rtLab.Right=rtLab.Left+rtLab.Width;
|
|
56436
|
+
rtLab.Bottom=rtLab.Top+rtLab.Height;
|
|
56427
56437
|
if (labInfo.BGColor)
|
|
56428
56438
|
{
|
|
56429
56439
|
this.Canvas.fillStyle=labInfo.BGColor;
|
|
56430
|
-
|
|
56431
|
-
this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.Height));
|
|
56440
|
+
this.Canvas.fillRect(ToFixedRect(rtLab.Left),ToFixedRect(rtLab.Top),ToFixedRect(rtLab.Width),ToFixedRect(rtLab.Height));
|
|
56432
56441
|
}
|
|
56433
56442
|
|
|
56434
56443
|
var yText=drawTop+1+lineSpace;
|
|
56435
|
-
|
|
56436
56444
|
this.Canvas.textBaseline="top";
|
|
56437
56445
|
for(var i=0;i<labInfo.AryText.length;++i)
|
|
56438
56446
|
{
|
|
@@ -56453,6 +56461,8 @@ function ChartDrawHLine()
|
|
|
56453
56461
|
|
|
56454
56462
|
yText+=labSize.LineHeight+lineSpace;
|
|
56455
56463
|
}
|
|
56464
|
+
|
|
56465
|
+
this.DrawVerticalButton(rtLab);
|
|
56456
56466
|
}
|
|
56457
56467
|
|
|
56458
56468
|
this.DrawCustomHLine=function(labInfo, yLine)
|
|
@@ -56607,24 +56617,71 @@ function ChartDrawHLine()
|
|
|
56607
56617
|
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
56608
56618
|
this.Canvas.font=font;
|
|
56609
56619
|
item.Width=this.Canvas.measureText(icon.Text).width+2;
|
|
56620
|
+
item.Height=item.Width;
|
|
56610
56621
|
|
|
56611
56622
|
if (icon.Margin)
|
|
56612
56623
|
{
|
|
56613
56624
|
var margin=icon.Margin;
|
|
56614
56625
|
if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
|
|
56615
56626
|
if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
|
|
56627
|
+
|
|
56628
|
+
if (IFrameSplitOperator.IsNumber(margin.Top)) item.Height+=margin.Top;
|
|
56629
|
+
if (IFrameSplitOperator.IsNumber(margin.Bottom)) item.Height+=margin.Bottom;
|
|
56616
56630
|
}
|
|
56617
56631
|
|
|
56632
|
+
if (this.VerticalButtonInfo.Width<item.Width) this.VerticalButtonInfo.Width=item.Width;
|
|
56633
|
+
this.VerticalButtonInfo.Height+=item.Height;
|
|
56634
|
+
|
|
56618
56635
|
totalWidth+=item.Width;
|
|
56619
56636
|
}
|
|
56620
56637
|
|
|
56621
56638
|
this.ButtonBGWidth=totalWidth;
|
|
56622
56639
|
}
|
|
56623
56640
|
|
|
56624
|
-
|
|
56641
|
+
//垂直排列按钮
|
|
56642
|
+
this.DrawVerticalButton=function(rtLab)
|
|
56625
56643
|
{
|
|
56644
|
+
if (this.ButtonPosition!=3) return;
|
|
56626
56645
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
56646
|
+
if (this.VerticalButtonInfo.Height<=0) return;
|
|
56647
|
+
|
|
56648
|
+
var rtBG={ Left:rtLab.Right, Top:rtLab.Top, Width:this.VerticalButtonInfo.Width, Height:this.VerticalButtonInfo.Height };
|
|
56649
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
56650
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
56651
|
+
this.Canvas.fillStyle=this.ButtonBGColor;
|
|
56652
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
56653
|
+
|
|
56654
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
56655
|
+
var yTop=rtLab.Top;
|
|
56656
|
+
for(var i=0;i<this.AryShowButton.length;++i)
|
|
56657
|
+
{
|
|
56658
|
+
var item=this.AryShowButton[i];
|
|
56659
|
+
var icon=item.Data;
|
|
56627
56660
|
|
|
56661
|
+
var rtButton={Left:rtBG.Left, Top:yTop, Width:this.VerticalButtonInfo.Width, Height:item.Height };
|
|
56662
|
+
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
56663
|
+
rtButton.Bottom=rtButton.Top+rtButton.Height;
|
|
56664
|
+
var yCenter=rtButton.Top+rtButton.Height/2;
|
|
56665
|
+
var xCenter=rtButton.Left+rtButton.Width/2;
|
|
56666
|
+
|
|
56667
|
+
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
56668
|
+
this.Canvas.font=font;
|
|
56669
|
+
this.Canvas.textAlign="center";
|
|
56670
|
+
this.Canvas.textBaseline="middle";
|
|
56671
|
+
this.Canvas.fillStyle=icon.Color;
|
|
56672
|
+
this.Canvas.fillText(icon.Text,xCenter,yCenter);
|
|
56673
|
+
|
|
56674
|
+
this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText, Data:icon.Data });
|
|
56675
|
+
|
|
56676
|
+
yTop=rtButton.Bottom;
|
|
56677
|
+
}
|
|
56678
|
+
}
|
|
56679
|
+
|
|
56680
|
+
this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
|
|
56681
|
+
{
|
|
56682
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
56683
|
+
if (this.ButtonPosition==3) return; //垂直按钮在DrawVerticalButton()调用
|
|
56684
|
+
|
|
56628
56685
|
if (this.ButtonPosition==1)
|
|
56629
56686
|
{
|
|
56630
56687
|
drawTop-=drawHeight;
|
|
@@ -56635,7 +56692,7 @@ function ChartDrawHLine()
|
|
|
56635
56692
|
drawLeft=chartWidth-this.ButtonBGWidth;
|
|
56636
56693
|
}
|
|
56637
56694
|
|
|
56638
|
-
if (
|
|
56695
|
+
if (rtDraw.Left>drawLeft) drawLeft=rtDraw.Left;
|
|
56639
56696
|
|
|
56640
56697
|
}
|
|
56641
56698
|
else if (this.ButtonPosition==2)
|
|
@@ -68068,6 +68125,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
68068
68125
|
{
|
|
68069
68126
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
68070
68127
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
68128
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
68071
68129
|
if (this.Frame.ZoomDown(cursorIndex, { ZoomDownloadDataCallback:(requestData)=>{ this.ZoomDownloadData(requestData) } } ))
|
|
68072
68130
|
{
|
|
68073
68131
|
this.CursorIndex=cursorIndex.Index;
|
|
@@ -68090,6 +68148,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
68090
68148
|
{
|
|
68091
68149
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
68092
68150
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
68151
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
68093
68152
|
if (this.Frame.ZoomUp(cursorIndex))
|
|
68094
68153
|
{
|
|
68095
68154
|
JSConsole.Chart.Log("[KLineChartContainer::OnWheel] cursorIndex ",cursorIndex)
|
|
@@ -40703,7 +40703,9 @@ function ChartMultiBar()
|
|
|
40703
40703
|
|
|
40704
40704
|
this.Draw=function()
|
|
40705
40705
|
{
|
|
40706
|
-
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
40706
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
40707
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
40708
|
+
if (this.IsHideScriptIndex()) return;
|
|
40707
40709
|
if (!this.Data || this.Data.length<=0) return;
|
|
40708
40710
|
|
|
40709
40711
|
this.IsHScreen=(this.ChartFrame.IsHScreen===true);
|
|
@@ -59947,7 +59949,7 @@ function ChartDrawHLine()
|
|
|
59947
59949
|
this.TextFont=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
59948
59950
|
this.RightSpaceWidth=50;
|
|
59949
59951
|
|
|
59950
|
-
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐
|
|
59952
|
+
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
|
|
59951
59953
|
this.ButtonBGColor='rgb(190,190,190)';
|
|
59952
59954
|
this.ButtonSpace=3;
|
|
59953
59955
|
|
|
@@ -59979,6 +59981,8 @@ function ChartDrawHLine()
|
|
|
59979
59981
|
this.ColseButtonSize=0;
|
|
59980
59982
|
this.SettingButtonSize=0;
|
|
59981
59983
|
this.ButtonBGWidth=0;
|
|
59984
|
+
this.VerticalButtonInfo={ Width:0, Height:0 }; //垂直按钮信息
|
|
59985
|
+
|
|
59982
59986
|
|
|
59983
59987
|
|
|
59984
59988
|
this.SetOption=function(option)
|
|
@@ -60115,6 +60119,9 @@ function ChartDrawHLine()
|
|
|
60115
60119
|
this.SettingButtonSize=0;
|
|
60116
60120
|
this.ButtonBGWidth=0;
|
|
60117
60121
|
|
|
60122
|
+
this.VerticalButtonInfo.Width=0;
|
|
60123
|
+
this.VerticalButtonInfo.Height=0;
|
|
60124
|
+
|
|
60118
60125
|
if (this.IsFrameMinSize()) return;
|
|
60119
60126
|
if (!this.IsShow) return;
|
|
60120
60127
|
|
|
@@ -60316,15 +60323,16 @@ function ChartDrawHLine()
|
|
|
60316
60323
|
if (IFrameSplitOperator.IsNumber(labInfo.LineSpace)) lineSpace=labInfo.LineSpace;
|
|
60317
60324
|
|
|
60318
60325
|
//背景色
|
|
60326
|
+
var rtLab={ Left:drawLeft, Top:drawTop, Width:labSize.Width, Height:labSize.Height }
|
|
60327
|
+
rtLab.Right=rtLab.Left+rtLab.Width;
|
|
60328
|
+
rtLab.Bottom=rtLab.Top+rtLab.Height;
|
|
60319
60329
|
if (labInfo.BGColor)
|
|
60320
60330
|
{
|
|
60321
60331
|
this.Canvas.fillStyle=labInfo.BGColor;
|
|
60322
|
-
|
|
60323
|
-
this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.Height));
|
|
60332
|
+
this.Canvas.fillRect(ToFixedRect(rtLab.Left),ToFixedRect(rtLab.Top),ToFixedRect(rtLab.Width),ToFixedRect(rtLab.Height));
|
|
60324
60333
|
}
|
|
60325
60334
|
|
|
60326
60335
|
var yText=drawTop+1+lineSpace;
|
|
60327
|
-
|
|
60328
60336
|
this.Canvas.textBaseline="top";
|
|
60329
60337
|
for(var i=0;i<labInfo.AryText.length;++i)
|
|
60330
60338
|
{
|
|
@@ -60345,6 +60353,8 @@ function ChartDrawHLine()
|
|
|
60345
60353
|
|
|
60346
60354
|
yText+=labSize.LineHeight+lineSpace;
|
|
60347
60355
|
}
|
|
60356
|
+
|
|
60357
|
+
this.DrawVerticalButton(rtLab);
|
|
60348
60358
|
}
|
|
60349
60359
|
|
|
60350
60360
|
this.DrawCustomHLine=function(labInfo, yLine)
|
|
@@ -60499,24 +60509,71 @@ function ChartDrawHLine()
|
|
|
60499
60509
|
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
60500
60510
|
this.Canvas.font=font;
|
|
60501
60511
|
item.Width=this.Canvas.measureText(icon.Text).width+2;
|
|
60512
|
+
item.Height=item.Width;
|
|
60502
60513
|
|
|
60503
60514
|
if (icon.Margin)
|
|
60504
60515
|
{
|
|
60505
60516
|
var margin=icon.Margin;
|
|
60506
60517
|
if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
|
|
60507
60518
|
if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
|
|
60519
|
+
|
|
60520
|
+
if (IFrameSplitOperator.IsNumber(margin.Top)) item.Height+=margin.Top;
|
|
60521
|
+
if (IFrameSplitOperator.IsNumber(margin.Bottom)) item.Height+=margin.Bottom;
|
|
60508
60522
|
}
|
|
60509
60523
|
|
|
60524
|
+
if (this.VerticalButtonInfo.Width<item.Width) this.VerticalButtonInfo.Width=item.Width;
|
|
60525
|
+
this.VerticalButtonInfo.Height+=item.Height;
|
|
60526
|
+
|
|
60510
60527
|
totalWidth+=item.Width;
|
|
60511
60528
|
}
|
|
60512
60529
|
|
|
60513
60530
|
this.ButtonBGWidth=totalWidth;
|
|
60514
60531
|
}
|
|
60515
60532
|
|
|
60516
|
-
|
|
60533
|
+
//垂直排列按钮
|
|
60534
|
+
this.DrawVerticalButton=function(rtLab)
|
|
60517
60535
|
{
|
|
60536
|
+
if (this.ButtonPosition!=3) return;
|
|
60518
60537
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
60538
|
+
if (this.VerticalButtonInfo.Height<=0) return;
|
|
60539
|
+
|
|
60540
|
+
var rtBG={ Left:rtLab.Right, Top:rtLab.Top, Width:this.VerticalButtonInfo.Width, Height:this.VerticalButtonInfo.Height };
|
|
60541
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60542
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60543
|
+
this.Canvas.fillStyle=this.ButtonBGColor;
|
|
60544
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
60545
|
+
|
|
60546
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
60547
|
+
var yTop=rtLab.Top;
|
|
60548
|
+
for(var i=0;i<this.AryShowButton.length;++i)
|
|
60549
|
+
{
|
|
60550
|
+
var item=this.AryShowButton[i];
|
|
60551
|
+
var icon=item.Data;
|
|
60519
60552
|
|
|
60553
|
+
var rtButton={Left:rtBG.Left, Top:yTop, Width:this.VerticalButtonInfo.Width, Height:item.Height };
|
|
60554
|
+
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
60555
|
+
rtButton.Bottom=rtButton.Top+rtButton.Height;
|
|
60556
|
+
var yCenter=rtButton.Top+rtButton.Height/2;
|
|
60557
|
+
var xCenter=rtButton.Left+rtButton.Width/2;
|
|
60558
|
+
|
|
60559
|
+
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
60560
|
+
this.Canvas.font=font;
|
|
60561
|
+
this.Canvas.textAlign="center";
|
|
60562
|
+
this.Canvas.textBaseline="middle";
|
|
60563
|
+
this.Canvas.fillStyle=icon.Color;
|
|
60564
|
+
this.Canvas.fillText(icon.Text,xCenter,yCenter);
|
|
60565
|
+
|
|
60566
|
+
this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText, Data:icon.Data });
|
|
60567
|
+
|
|
60568
|
+
yTop=rtButton.Bottom;
|
|
60569
|
+
}
|
|
60570
|
+
}
|
|
60571
|
+
|
|
60572
|
+
this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
|
|
60573
|
+
{
|
|
60574
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
60575
|
+
if (this.ButtonPosition==3) return; //垂直按钮在DrawVerticalButton()调用
|
|
60576
|
+
|
|
60520
60577
|
if (this.ButtonPosition==1)
|
|
60521
60578
|
{
|
|
60522
60579
|
drawTop-=drawHeight;
|
|
@@ -60527,7 +60584,7 @@ function ChartDrawHLine()
|
|
|
60527
60584
|
drawLeft=chartWidth-this.ButtonBGWidth;
|
|
60528
60585
|
}
|
|
60529
60586
|
|
|
60530
|
-
if (
|
|
60587
|
+
if (rtDraw.Left>drawLeft) drawLeft=rtDraw.Left;
|
|
60531
60588
|
|
|
60532
60589
|
}
|
|
60533
60590
|
else if (this.ButtonPosition==2)
|
|
@@ -71960,6 +72017,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71960
72017
|
{
|
|
71961
72018
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
71962
72019
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
72020
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
71963
72021
|
if (this.Frame.ZoomDown(cursorIndex, { ZoomDownloadDataCallback:(requestData)=>{ this.ZoomDownloadData(requestData) } } ))
|
|
71964
72022
|
{
|
|
71965
72023
|
this.CursorIndex=cursorIndex.Index;
|
|
@@ -71982,6 +72040,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
71982
72040
|
{
|
|
71983
72041
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
71984
72042
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
72043
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
71985
72044
|
if (this.Frame.ZoomUp(cursorIndex))
|
|
71986
72045
|
{
|
|
71987
72046
|
JSConsole.Chart.Log("[KLineChartContainer::OnWheel] cursorIndex ",cursorIndex)
|
|
@@ -132008,7 +132067,7 @@ function ScrollBarBGChart()
|
|
|
132008
132067
|
|
|
132009
132068
|
|
|
132010
132069
|
|
|
132011
|
-
var HQCHART_VERSION="1.1.
|
|
132070
|
+
var HQCHART_VERSION="1.1.13262";
|
|
132012
132071
|
|
|
132013
132072
|
function PrintHQChartVersion()
|
|
132014
132073
|
{
|
|
@@ -40747,7 +40747,9 @@ function ChartMultiBar()
|
|
|
40747
40747
|
|
|
40748
40748
|
this.Draw=function()
|
|
40749
40749
|
{
|
|
40750
|
-
if (!this.IsShow || this.ChartFrame.IsMinSize) return;
|
|
40750
|
+
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
40751
|
+
if (this.IsShowIndexTitleOnly()) return;
|
|
40752
|
+
if (this.IsHideScriptIndex()) return;
|
|
40751
40753
|
if (!this.Data || this.Data.length<=0) return;
|
|
40752
40754
|
|
|
40753
40755
|
this.IsHScreen=(this.ChartFrame.IsHScreen===true);
|
|
@@ -59991,7 +59993,7 @@ function ChartDrawHLine()
|
|
|
59991
59993
|
this.TextFont=12*GetDevicePixelRatio() +"px 微软雅黑";
|
|
59992
59994
|
this.RightSpaceWidth=50;
|
|
59993
59995
|
|
|
59994
|
-
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐
|
|
59996
|
+
this.ButtonPosition=0; //按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
|
|
59995
59997
|
this.ButtonBGColor='rgb(190,190,190)';
|
|
59996
59998
|
this.ButtonSpace=3;
|
|
59997
59999
|
|
|
@@ -60023,6 +60025,8 @@ function ChartDrawHLine()
|
|
|
60023
60025
|
this.ColseButtonSize=0;
|
|
60024
60026
|
this.SettingButtonSize=0;
|
|
60025
60027
|
this.ButtonBGWidth=0;
|
|
60028
|
+
this.VerticalButtonInfo={ Width:0, Height:0 }; //垂直按钮信息
|
|
60029
|
+
|
|
60026
60030
|
|
|
60027
60031
|
|
|
60028
60032
|
this.SetOption=function(option)
|
|
@@ -60159,6 +60163,9 @@ function ChartDrawHLine()
|
|
|
60159
60163
|
this.SettingButtonSize=0;
|
|
60160
60164
|
this.ButtonBGWidth=0;
|
|
60161
60165
|
|
|
60166
|
+
this.VerticalButtonInfo.Width=0;
|
|
60167
|
+
this.VerticalButtonInfo.Height=0;
|
|
60168
|
+
|
|
60162
60169
|
if (this.IsFrameMinSize()) return;
|
|
60163
60170
|
if (!this.IsShow) return;
|
|
60164
60171
|
|
|
@@ -60360,15 +60367,16 @@ function ChartDrawHLine()
|
|
|
60360
60367
|
if (IFrameSplitOperator.IsNumber(labInfo.LineSpace)) lineSpace=labInfo.LineSpace;
|
|
60361
60368
|
|
|
60362
60369
|
//背景色
|
|
60370
|
+
var rtLab={ Left:drawLeft, Top:drawTop, Width:labSize.Width, Height:labSize.Height }
|
|
60371
|
+
rtLab.Right=rtLab.Left+rtLab.Width;
|
|
60372
|
+
rtLab.Bottom=rtLab.Top+rtLab.Height;
|
|
60363
60373
|
if (labInfo.BGColor)
|
|
60364
60374
|
{
|
|
60365
60375
|
this.Canvas.fillStyle=labInfo.BGColor;
|
|
60366
|
-
|
|
60367
|
-
this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.Height));
|
|
60376
|
+
this.Canvas.fillRect(ToFixedRect(rtLab.Left),ToFixedRect(rtLab.Top),ToFixedRect(rtLab.Width),ToFixedRect(rtLab.Height));
|
|
60368
60377
|
}
|
|
60369
60378
|
|
|
60370
60379
|
var yText=drawTop+1+lineSpace;
|
|
60371
|
-
|
|
60372
60380
|
this.Canvas.textBaseline="top";
|
|
60373
60381
|
for(var i=0;i<labInfo.AryText.length;++i)
|
|
60374
60382
|
{
|
|
@@ -60389,6 +60397,8 @@ function ChartDrawHLine()
|
|
|
60389
60397
|
|
|
60390
60398
|
yText+=labSize.LineHeight+lineSpace;
|
|
60391
60399
|
}
|
|
60400
|
+
|
|
60401
|
+
this.DrawVerticalButton(rtLab);
|
|
60392
60402
|
}
|
|
60393
60403
|
|
|
60394
60404
|
this.DrawCustomHLine=function(labInfo, yLine)
|
|
@@ -60543,24 +60553,71 @@ function ChartDrawHLine()
|
|
|
60543
60553
|
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
60544
60554
|
this.Canvas.font=font;
|
|
60545
60555
|
item.Width=this.Canvas.measureText(icon.Text).width+2;
|
|
60556
|
+
item.Height=item.Width;
|
|
60546
60557
|
|
|
60547
60558
|
if (icon.Margin)
|
|
60548
60559
|
{
|
|
60549
60560
|
var margin=icon.Margin;
|
|
60550
60561
|
if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
|
|
60551
60562
|
if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
|
|
60563
|
+
|
|
60564
|
+
if (IFrameSplitOperator.IsNumber(margin.Top)) item.Height+=margin.Top;
|
|
60565
|
+
if (IFrameSplitOperator.IsNumber(margin.Bottom)) item.Height+=margin.Bottom;
|
|
60552
60566
|
}
|
|
60553
60567
|
|
|
60568
|
+
if (this.VerticalButtonInfo.Width<item.Width) this.VerticalButtonInfo.Width=item.Width;
|
|
60569
|
+
this.VerticalButtonInfo.Height+=item.Height;
|
|
60570
|
+
|
|
60554
60571
|
totalWidth+=item.Width;
|
|
60555
60572
|
}
|
|
60556
60573
|
|
|
60557
60574
|
this.ButtonBGWidth=totalWidth;
|
|
60558
60575
|
}
|
|
60559
60576
|
|
|
60560
|
-
|
|
60577
|
+
//垂直排列按钮
|
|
60578
|
+
this.DrawVerticalButton=function(rtLab)
|
|
60561
60579
|
{
|
|
60580
|
+
if (this.ButtonPosition!=3) return;
|
|
60562
60581
|
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
60582
|
+
if (this.VerticalButtonInfo.Height<=0) return;
|
|
60583
|
+
|
|
60584
|
+
var rtBG={ Left:rtLab.Right, Top:rtLab.Top, Width:this.VerticalButtonInfo.Width, Height:this.VerticalButtonInfo.Height };
|
|
60585
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
60586
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
60587
|
+
this.Canvas.fillStyle=this.ButtonBGColor;
|
|
60588
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));
|
|
60589
|
+
|
|
60590
|
+
var pixelRatio=GetDevicePixelRatio();
|
|
60591
|
+
var yTop=rtLab.Top;
|
|
60592
|
+
for(var i=0;i<this.AryShowButton.length;++i)
|
|
60593
|
+
{
|
|
60594
|
+
var item=this.AryShowButton[i];
|
|
60595
|
+
var icon=item.Data;
|
|
60563
60596
|
|
|
60597
|
+
var rtButton={Left:rtBG.Left, Top:yTop, Width:this.VerticalButtonInfo.Width, Height:item.Height };
|
|
60598
|
+
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
60599
|
+
rtButton.Bottom=rtButton.Top+rtButton.Height;
|
|
60600
|
+
var yCenter=rtButton.Top+rtButton.Height/2;
|
|
60601
|
+
var xCenter=rtButton.Left+rtButton.Width/2;
|
|
60602
|
+
|
|
60603
|
+
var font=`${icon.Size*pixelRatio}px ${icon.Family}`;
|
|
60604
|
+
this.Canvas.font=font;
|
|
60605
|
+
this.Canvas.textAlign="center";
|
|
60606
|
+
this.Canvas.textBaseline="middle";
|
|
60607
|
+
this.Canvas.fillStyle=icon.Color;
|
|
60608
|
+
this.Canvas.fillText(icon.Text,xCenter,yCenter);
|
|
60609
|
+
|
|
60610
|
+
this.AryButton.push({Rect:rtButton,ID:icon.ID, TooltipText:icon.TooltipText, Data:icon.Data });
|
|
60611
|
+
|
|
60612
|
+
yTop=rtButton.Bottom;
|
|
60613
|
+
}
|
|
60614
|
+
}
|
|
60615
|
+
|
|
60616
|
+
this.DrawButton=function(drawTop, drawLeft, drawHeight, rtDraw)
|
|
60617
|
+
{
|
|
60618
|
+
if (!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton)) return;
|
|
60619
|
+
if (this.ButtonPosition==3) return; //垂直按钮在DrawVerticalButton()调用
|
|
60620
|
+
|
|
60564
60621
|
if (this.ButtonPosition==1)
|
|
60565
60622
|
{
|
|
60566
60623
|
drawTop-=drawHeight;
|
|
@@ -60571,7 +60628,7 @@ function ChartDrawHLine()
|
|
|
60571
60628
|
drawLeft=chartWidth-this.ButtonBGWidth;
|
|
60572
60629
|
}
|
|
60573
60630
|
|
|
60574
|
-
if (
|
|
60631
|
+
if (rtDraw.Left>drawLeft) drawLeft=rtDraw.Left;
|
|
60575
60632
|
|
|
60576
60633
|
}
|
|
60577
60634
|
else if (this.ButtonPosition==2)
|
|
@@ -72004,6 +72061,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72004
72061
|
{
|
|
72005
72062
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
72006
72063
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
72064
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
72007
72065
|
if (this.Frame.ZoomDown(cursorIndex, { ZoomDownloadDataCallback:(requestData)=>{ this.ZoomDownloadData(requestData) } } ))
|
|
72008
72066
|
{
|
|
72009
72067
|
this.CursorIndex=cursorIndex.Index;
|
|
@@ -72026,6 +72084,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
72026
72084
|
{
|
|
72027
72085
|
var cursorIndex={ ZoomType:this.ZoomType, IsLockRight:this.IsZoomLockRight };
|
|
72028
72086
|
cursorIndex.Index=parseInt(Math.abs(this.CursorIndex-0.5).toFixed(0));
|
|
72087
|
+
if (e.ctrlKey) cursorIndex.ZoomType=1; //ctrl+滚轴 十字中心缩放
|
|
72029
72088
|
if (this.Frame.ZoomUp(cursorIndex))
|
|
72030
72089
|
{
|
|
72031
72090
|
JSConsole.Chart.Log("[KLineChartContainer::OnWheel] cursorIndex ",cursorIndex)
|
|
@@ -135417,7 +135476,7 @@ function HQChartScriptWorker()
|
|
|
135417
135476
|
|
|
135418
135477
|
|
|
135419
135478
|
|
|
135420
|
-
var HQCHART_VERSION="1.1.
|
|
135479
|
+
var HQCHART_VERSION="1.1.13262";
|
|
135421
135480
|
|
|
135422
135481
|
function PrintHQChartVersion()
|
|
135423
135482
|
{
|