hqchart 1.1.13105 → 1.1.13107
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
|
@@ -1634,17 +1634,19 @@ this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID&&this.TouchStatus.CorssCursor
|
|
|
1634
1634
|
{if(e.cancelable)e.preventDefault();}if(this.IsPhoneDragging(e)){var touches=this.GetToucheData(e,this.IsForceLandscape);var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);if(this.TryClickLock||this.TryClickIndexTitle)//指标枷锁区域 , 指标标题点击
|
|
1635
1635
|
{var x=pt.X;var y=pt.Y;if(this.TryClickLock&&this.TryClickLock(x,y))return;if(this.TryClickIndexTitle&&this.TryClickIndexTitle(x,y))return;}if(this.ClickFrameButton){var button=this.Frame.PtInButtons(pt.X,pt.Y);if(button){this.ClickFrameButton(button,e);return;}}if(this.EnableVerticalDrag){this.VerticalDrag={IsDrag:false};if(this.Frame.PtInFrameVertical(pt.X,pt.Y))this.VerticalDrag.IsDrag=true;}var bStartTimer=true;if(this.ChartDrawOption.IsLockScreen){bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){if(this.TouchStatus.CorssCursorShow==true)bStartTimer=false;}else if(this.DragMode==JSCHART_DRAG_ID.DISABLE_DRAG_ID){bStartTimer=false;}else{if(!isSingleTouch)bStartTimer=false;}if(this.VerticalDrag)bStartTimer=false;if(this.EnableClickModel&&this.ClickModel.IsShowCorssCursor==true)bStartTimer=false;var drag={"Click":{},"LastMove":{}//最后移动的位置
|
|
1636
1636
|
};//var touches=this.GetToucheData(e,this.IsForceLandscape);
|
|
1637
|
-
drag.Click.X=touches[0].clientX;drag.Click.Y=touches[0].clientY;drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;this.MouseDrag=drag;
|
|
1637
|
+
drag.Click.X=touches[0].clientX;drag.Click.Y=touches[0].clientY;drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;this.MouseDrag=drag;var drawPictureActive=this.GetActiveDrawPicture();//上一次选中的
|
|
1638
|
+
var selectedChart={Chart:this.SelectedChart.Selected.Chart,Identify:this.SelectedChart.Selected.Identify};//上一次选中的图形
|
|
1639
|
+
this.PhoneTouchInfo={Start:{X:touches[0].clientX,Y:touches[0].clientY},End:{X:touches[0].clientX,Y:touches[0].clientY}};if(this.SelectChartDrawPicture)this.SelectChartDrawPicture.IsSelected=false;this.SelectChartDrawPicture=null;var isDrawPictrue=false;if(this.CurrentChartDrawPicture)//画图工具模式
|
|
1638
1640
|
{var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==2)this.SetChartDrawPictureThirdPoint(drag.Click.X,drag.Click.Y,true);else{this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);//只有1个点 直接完成
|
|
1639
|
-
if(this.FinishChartDrawPicturePoint())this.DrawDynamicInfo({Corss:false,Tooltip:false});}if(e.cancelable)e.preventDefault();return;}else{var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);var drawPictrueData={X:pt.X,Y:pt.Y};var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
|
|
1641
|
+
if(this.FinishChartDrawPicturePoint()){if(drawPicture.IsDrawMain)this.Draw();else this.DrawDynamicInfo({Corss:false,Tooltip:false});}}if(e.cancelable)e.preventDefault();return;}else{var pt=this.PointAbsoluteToRelative(touches[0].clientX,touches[0].clientY,true);var drawPictrueData={X:pt.X,Y:pt.Y};var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
|
|
1640
1642
|
if(this.GetChartDrawPictureByPoint(drawPictrueData)){drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;drawPictrueData.ChartDrawPicture.IsSelected=true;this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;var _event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
|
|
1641
|
-
if(_event&&_event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};_event.Callback(_event,sendData,this);}if(e.cancelable)e.preventDefault();return;}}if(bStartTimer){//长按2秒,十字光标
|
|
1643
|
+
if(_event&&_event.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};_event.Callback(_event,sendData,this);}var drawType=0;if(drawPictrueData.ChartDrawPicture.IsDrawMain)drawType=1;else if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart&&drawPictureActive.Select.Chart.IsDrawMain)drawType=1;if(drawType==1)this.Draw();if(e.cancelable)e.preventDefault();return;}}if(bStartTimer){//长按2秒,十字光标
|
|
1642
1644
|
var self=this;this.DragTimer=setTimeout(function(){if(drag.Click.X==drag.LastMove.X&&drag.Click.Y==drag.LastMove.Y)//手指没有移动,出现十字光标
|
|
1643
1645
|
{var mouseDrag=self.MouseDrag;self.MouseDrag=null;if(self.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID)self.TouchStatus.CorssCursorShow=true;//十字显示
|
|
1644
1646
|
if(self.EnableClickModel===true)self.ClickModel.IsShowCorssCursor=true;self.MoveCorssCursor(drag.Click,e);//移动十字光标
|
|
1645
1647
|
}},self.PressTime);}if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[JSChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}if(this.ChartDrawOption.IsLockScreen){this.MouseDrag=null;}else if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){}else if(this.DragMode==JSCHART_DRAG_ID.DISABLE_DRAG_ID){this.MouseDrag=null;this.MoveCorssCursor(drag.Click,e);}else if(this.EnableClickModel){//if (this.ClickModel.IsShowCorssCursor===true) this.MoveCorssCursor(drag.Click,e)
|
|
1646
1648
|
}else if(this.VerticalDrag){if(!this.VerticalDrag.IsDrag)this.MoveCorssCursor(drag.Click,e);//没有点击X轴, 就显示十字光标
|
|
1647
|
-
}else if(this.IsClickShowCorssCursor){this.MoveCorssCursor(drag.Click,e);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};phonePinch.Last={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){if(this.IsForceLandscape)y=uielement.getBoundingClientRect().width-touches[0].clientY;//强制横屏Y计算
|
|
1649
|
+
}else if(this.IsClickShowCorssCursor){this.MoveCorssCursor(drag.Click,e);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);var drawType=0;if(drawPictureActive.Select.Guid!=null){if(drawPictureActive.Select.Guid&&drawPictureActive.Select.Chart)drawType=1;}if(drawType==1)this.Draw();}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};phonePinch.Last={X:touches[0].pageX,Y:touches[0].pageY,X2:touches[1].pageX,Y2:touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){if(this.IsForceLandscape)y=uielement.getBoundingClientRect().width-touches[0].clientY;//强制横屏Y计算
|
|
1648
1650
|
if(!this.ChartDrawOption.IsLockScreen)this.MoveCorssCursor({X:touches[0].clientX,Y:touches[0].clientY},e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);var isMoveCorssCursor=this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID&&this.TouchStatus.CorssCursorShow==true;//是否移动十字光标
|
|
1649
1651
|
if(this.VerticalDrag){if(this.VerticalDrag.IsDrag===true)isMoveCorssCursor=false;else isMoveCorssCursor=true;}if(this.EnableClickModel){if(this.ClickModel.IsShowCorssCursor===true)isMoveCorssCursor=true;else isMoveCorssCursor=false;}//JSConsole.Chart.Log(`[JSChartContainer::OnTouchMove] moveAngle=${moveAngle} , moveUpDown=${moveUpDown}, moveSetp=${moveSetp}`);
|
|
1650
1652
|
if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
|
|
@@ -5885,8 +5887,9 @@ this.ValueTextColor='rgb(250,250,250)';this.IsShowCorssCursor=true;//画的时
|
|
|
5885
5887
|
this.GetLabelCallback;//绘制标题回调函数
|
|
5886
5888
|
this.PointCount=1;this.ClassName='ChartDrawHLine';this.Font=14*GetDevicePixelRatio()+"px 微软雅黑";this.TextFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.RightSpaceWidth=50;this.ButtonPosition=0;//按钮位置, 0=价格后面, 1=价格上面
|
|
5887
5889
|
this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.Button={CloseIcon:{Text:'\uE62B',Color:'rgb(255,255,255)',Family:"iconfont",Size:16},SettingIcon:{Text:'\uE623',Color:'rgb(255,255,255)',Family:"iconfont",Size:16}};this.AryButton=[];this.ExtendData;//扩展数据
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
+
this.ShowPriceTextConfig={IsShow:[false,false,true],//[0]=left内 [1]=right内 [2]=right外
|
|
5891
|
+
Font:[12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1']};//内部变量
|
|
5892
|
+
this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;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(IFrameSplitOperator.IsNumber(option.Precision))this.Precision=option.Precision;if(option.Font)this.Font=option.Font;if(option.ValueTextColor)this.ValueTextColor=option.ValueTextColor;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(item.SettingIcon)this.Button.SettingIcon=CloneData(item.SettingIcon);}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;}}}};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;/*
|
|
5890
5893
|
this.GetXYCoordinate=function()
|
|
5891
5894
|
{
|
|
5892
5895
|
if (this.IsFrameMinSize()) return null;
|
|
@@ -5896,13 +5899,14 @@ this.ColseButtonSize=0;this.SettingButtonSize=0;this.ButtonBGWidth=0;this.SetOpt
|
|
|
5896
5899
|
}
|
|
5897
5900
|
*/this.IsDrawMain=function()//选中绘制在动态绘图上, 没有选中绘制在背景上
|
|
5898
5901
|
{if(!this.GetActiveDrawPicture)return true;var active=this.GetActiveDrawPicture();if(active.Select.Guid==this.Guid)return false;return true;};this.MainDraw=function(){this.Draw();};this.Draw=function(moveonPoint,mouseStatus){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();//画线段
|
|
5899
|
-
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()
|
|
5902
|
+
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();//画水平线段
|
|
5903
|
+
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);//描述信息
|
|
5900
5904
|
if(labInfo)this.DrawLab(labInfo,drawPoint[0].Y);//画中心点
|
|
5901
|
-
var xCenter=left+(right-left)/2;var point={X:xCenter,Y:drawPoint[0].Y};this.DrawPoint([point]);this.Canvas.restore()
|
|
5902
|
-
this.CalculateButtonSize();this.DrawValueText(drawPoint[0].Y,rtDraw,labInfo);if(labInfo)this.DrawRightLab(labInfo,rtDraw)
|
|
5905
|
+
var xCenter=left+(right-left)/2;var point={X:xCenter,Y:drawPoint[0].Y};this.DrawPoint([point]);this.Canvas.restore();//外部右侧显示价格
|
|
5906
|
+
if(this.ShowPriceTextConfig.IsShow[2]){var rtDraw={};this.CalculateButtonSize();this.DrawValueText(drawPoint[0].Y,rtDraw,labInfo);if(labInfo)this.DrawRightLab(labInfo,rtDraw);}//鼠标是否在按钮上
|
|
5903
5907
|
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;//背景色
|
|
5904
5908
|
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;var drawTop=rtLeftDraw.Bottom;var lineSpace=0;if(IFrameSplitOperator.IsNumber(labInfo.LineSpace))lineSpace=labInfo.LineSpace;//背景色
|
|
5905
|
-
if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=drawTop;this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.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,rtLeftDraw.Right-1,yText+1);}yText+=labSize.LineHeight+lineSpace;}};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;rtBG.Bottom=rtBG.Top+rtBG.Height;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,rtBG.Left+2,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.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(this.Button.SettingIcon){var icon=this.Button.SettingIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.SettingButtonSize=width;}if(this.Button.CloseIcon){var icon=this.Button.CloseIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.ColseButtonSize=width;}if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;var buttonWidth=0;if(this.SettingButtonSize>0)buttonWidth+=this.SettingButtonSize;if(this.ColseButtonSize>0){if(buttonWidth>0)buttonWidth+=this.ButtonSpace;buttonWidth+=this.ColseButtonSize;}buttonWidth+=4;this.ButtonBGWidth=buttonWidth;};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;if(this.ButtonPosition==1)drawTop-=drawHeight;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));left+=1;var pixelRatio=GetDevicePixelRatio();if(this.Button.SettingIcon){var rtButton={Left:left,Top:drawTop,Width:this.SettingButtonSize,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 icon=this.Button.SettingIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING});/*
|
|
5909
|
+
if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=drawTop;this.Canvas.fillRect(ToFixedRect(drawLeft),ToFixedRect(rtTop),ToFixedRect(labSize.Width),ToFixedRect(labSize.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,rtLeftDraw.Right-1,yText+1);}yText+=labSize.LineHeight+lineSpace;}};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;rtBG.Bottom=rtBG.Top+rtBG.Height;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,rtBG.Left+2,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(this.Button.SettingIcon){var icon=this.Button.SettingIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.SettingButtonSize=width;}if(this.Button.CloseIcon){var icon=this.Button.CloseIcon;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;var width=this.Canvas.measureText(icon.Text).width;this.ColseButtonSize=width;}if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;var buttonWidth=0;if(this.SettingButtonSize>0)buttonWidth+=this.SettingButtonSize;if(this.ColseButtonSize>0){if(buttonWidth>0)buttonWidth+=this.ButtonSpace;buttonWidth+=this.ColseButtonSize;}buttonWidth+=4;this.ButtonBGWidth=buttonWidth;};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(this.ColseButtonSize<=0&&this.SettingButtonSize<=0)return;if(this.ButtonPosition==1)drawTop-=drawHeight;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));left+=1;var pixelRatio=GetDevicePixelRatio();if(this.Button.SettingIcon&&this.Button.SettingIcon.Text){var rtButton={Left:left,Top:drawTop,Width:this.SettingButtonSize,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 icon=this.Button.SettingIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.SettingIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING});/*
|
|
5906
5910
|
if (this.ColseButtonSize>0)
|
|
5907
5911
|
{
|
|
5908
5912
|
var xLine=rtButton.Right+this.ButtonSpace/2;
|
|
@@ -5913,7 +5917,7 @@ if(labInfo.BGColor){this.Canvas.fillStyle=labInfo.BGColor;var rtTop=drawTop;this
|
|
|
5913
5917
|
this.Canvas.lineTo(xLine,rtButton.Bottom);
|
|
5914
5918
|
this.Canvas.stroke();
|
|
5915
5919
|
}
|
|
5916
|
-
*/left=rtButton.Right+this.ButtonSpace;}if(this.Button.CloseIcon){var rtButton={Left:left,Top:drawTop,Width:this.ColseButtonSize,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 icon=this.Button.CloseIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE});left=rtButton.Right;}rtDraw.Right=rtBG.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};}}return null;};}//趋势线
|
|
5920
|
+
*/left=rtButton.Right+this.ButtonSpace;}if(this.Button.CloseIcon&&this.Button.CloseIcon.Text){var rtButton={Left:left,Top:drawTop,Width:this.ColseButtonSize,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 icon=this.Button.CloseIcon;this.Canvas.font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(this.Button.CloseIcon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE});left=rtButton.Right;}rtDraw.Right=rtBG.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};}}return null;};}//趋势线
|
|
5917
5921
|
function ChartDrawPictureTrendLine(){this.newMethod=IChartDrawPicture;//派生
|
|
5918
5922
|
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);//画点
|
|
5919
5923
|
this.Canvas.restore();};}//画图工具-矩形
|
|
@@ -6356,7 +6360,7 @@ this.TitleFont=13*GetDevicePixelRatio()+'px 微软雅黑';//指标显示,tooltip
|
|
|
6356
6360
|
this.IndexTitleBGColor='rgb(250,250,250)';//指标名字背景色
|
|
6357
6361
|
this.IndexTitleBorderColor='rgb(180,180,180)';//指标名字边框颜色
|
|
6358
6362
|
this.IndexTitleBorderMoveOnColor='rgb(0,0,0)';//指标名字边框颜色(鼠标在上面)
|
|
6359
|
-
this.IndexTitleBorderStyle=1,//0=直角边框 1
|
|
6363
|
+
this.IndexTitleBorderStyle=1,//0=直角边框 1=圆角边框
|
|
6360
6364
|
this.IndexTitleColor="rgb(43,54,69)";//指标名字颜色
|
|
6361
6365
|
this.IndexTitleSelectedColor="rgb(65,105,225)";this.OverlayIndexTitleBGColor='rgba(255,255,255,0.7)';this.IndexTitleMerginLeft=1;//指标输出左边间距
|
|
6362
6366
|
this.IndexTitle={UpDownArrow://数值涨跌箭头
|
|
@@ -13024,7 +13028,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13024
13028
|
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);};}/********************************************************************************
|
|
13025
13029
|
* 版本信息输出
|
|
13026
13030
|
*
|
|
13027
|
-
*/var HQCHART_VERSION="1.1.
|
|
13031
|
+
*/var HQCHART_VERSION="1.1.13106";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();//把给外界调用的方法暴露出来
|
|
13028
13032
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13029
13033
|
// BaseIndex:BaseIndex,
|
|
13030
13034
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -4398,6 +4398,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4398
4398
|
drag.LastMove.Y=touches[0].clientY;
|
|
4399
4399
|
|
|
4400
4400
|
this.MouseDrag=drag;
|
|
4401
|
+
var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
|
|
4402
|
+
var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
|
|
4401
4403
|
this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
|
|
4402
4404
|
if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.IsSelected=false;
|
|
4403
4405
|
this.SelectChartDrawPicture=null;
|
|
@@ -4411,7 +4413,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4411
4413
|
{
|
|
4412
4414
|
this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);
|
|
4413
4415
|
//只有1个点 直接完成
|
|
4414
|
-
if (this.FinishChartDrawPicturePoint())
|
|
4416
|
+
if (this.FinishChartDrawPicturePoint())
|
|
4417
|
+
{
|
|
4418
|
+
if (drawPicture.IsDrawMain) this.Draw();
|
|
4419
|
+
else this.DrawDynamicInfo( {Corss:false, Tooltip:false} );
|
|
4420
|
+
}
|
|
4415
4421
|
}
|
|
4416
4422
|
|
|
4417
4423
|
if (e.cancelable) e.preventDefault();
|
|
@@ -4437,6 +4443,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4437
4443
|
event.Callback(event,sendData,this);
|
|
4438
4444
|
}
|
|
4439
4445
|
|
|
4446
|
+
var drawType=0;
|
|
4447
|
+
if (drawPictrueData.ChartDrawPicture.IsDrawMain) drawType=1;
|
|
4448
|
+
else if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart && drawPictureActive.Select.Chart.IsDrawMain) drawType=1;
|
|
4449
|
+
|
|
4450
|
+
if (drawType==1) this.Draw();
|
|
4451
|
+
|
|
4440
4452
|
if (e.cancelable) e.preventDefault();
|
|
4441
4453
|
return;
|
|
4442
4454
|
}
|
|
@@ -4493,6 +4505,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
4493
4505
|
}
|
|
4494
4506
|
|
|
4495
4507
|
this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchStart"}, e);
|
|
4508
|
+
|
|
4509
|
+
var drawType=0;
|
|
4510
|
+
if (drawPictureActive.Select.Guid!=null)
|
|
4511
|
+
{
|
|
4512
|
+
if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart) drawType=1;
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
if (drawType==1) this.Draw();
|
|
4496
4516
|
}
|
|
4497
4517
|
else if (this.IsPhonePinching(e))
|
|
4498
4518
|
{
|
|
@@ -54997,6 +55017,15 @@ function ChartDrawHLine()
|
|
|
54997
55017
|
|
|
54998
55018
|
this.AryButton=[];
|
|
54999
55019
|
this.ExtendData; //扩展数据
|
|
55020
|
+
this.ShowPriceTextConfig=
|
|
55021
|
+
{
|
|
55022
|
+
IsShow:[false, false, true], //[0]=left内 [1]=right内 [2]=right外
|
|
55023
|
+
Font:
|
|
55024
|
+
[
|
|
55025
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
55026
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
55027
|
+
],
|
|
55028
|
+
};
|
|
55000
55029
|
|
|
55001
55030
|
//内部变量
|
|
55002
55031
|
this.ColseButtonSize=0;
|
|
@@ -55028,6 +55057,15 @@ function ChartDrawHLine()
|
|
|
55028
55057
|
if (item.SettingIcon) this.Button.SettingIcon=CloneData(item.SettingIcon);
|
|
55029
55058
|
}
|
|
55030
55059
|
if (option.ExtendData) this.ExtendData=option.ExtendData;
|
|
55060
|
+
|
|
55061
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText))
|
|
55062
|
+
{
|
|
55063
|
+
for(var i=0;i<option.IsShowPriceText.length && i<3;++i)
|
|
55064
|
+
{
|
|
55065
|
+
var value=option.IsShowPriceText[i]
|
|
55066
|
+
if (IFrameSplitOperator.IsBool(value)) this.ShowPriceTextConfig.IsShow[i]=value;
|
|
55067
|
+
}
|
|
55068
|
+
}
|
|
55031
55069
|
}
|
|
55032
55070
|
}
|
|
55033
55071
|
|
|
@@ -55116,6 +55154,7 @@ function ChartDrawHLine()
|
|
|
55116
55154
|
this.Canvas.stroke();
|
|
55117
55155
|
this.RestoreLineWidth();
|
|
55118
55156
|
|
|
55157
|
+
//画水平线段
|
|
55119
55158
|
var line={Start:new Point(), End:new Point()};
|
|
55120
55159
|
if (isHScreen)
|
|
55121
55160
|
{
|
|
@@ -55133,6 +55172,18 @@ function ChartDrawHLine()
|
|
|
55133
55172
|
}
|
|
55134
55173
|
this.LinePoint.push(line);
|
|
55135
55174
|
|
|
55175
|
+
var yValue=this.Frame.GetYData(drawPoint[0].Y);
|
|
55176
|
+
var strPrice=yValue.toFixed(this.Precision);
|
|
55177
|
+
if (this.ShowPriceTextConfig.IsShow[0])
|
|
55178
|
+
{
|
|
55179
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 0);
|
|
55180
|
+
}
|
|
55181
|
+
|
|
55182
|
+
if (this.ShowPriceTextConfig.IsShow[1])
|
|
55183
|
+
{
|
|
55184
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 1);
|
|
55185
|
+
}
|
|
55186
|
+
|
|
55136
55187
|
var labInfo;
|
|
55137
55188
|
if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
|
|
55138
55189
|
|
|
@@ -55147,14 +55198,17 @@ function ChartDrawHLine()
|
|
|
55147
55198
|
|
|
55148
55199
|
this.Canvas.restore();
|
|
55149
55200
|
|
|
55150
|
-
var rtDraw={ };
|
|
55151
55201
|
|
|
55152
|
-
|
|
55153
|
-
this.
|
|
55154
|
-
|
|
55155
|
-
|
|
55156
|
-
this.
|
|
55202
|
+
//外部右侧显示价格
|
|
55203
|
+
if (this.ShowPriceTextConfig.IsShow[2])
|
|
55204
|
+
{
|
|
55205
|
+
var rtDraw={ };
|
|
55206
|
+
this.CalculateButtonSize();
|
|
55207
|
+
this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
|
|
55208
|
+
if (labInfo) this.DrawRightLab(labInfo, rtDraw);
|
|
55209
|
+
}
|
|
55157
55210
|
|
|
55211
|
+
|
|
55158
55212
|
//鼠标是否在按钮上
|
|
55159
55213
|
if (moveonPoint && mouseStatus)
|
|
55160
55214
|
{
|
|
@@ -55334,6 +55388,39 @@ function ChartDrawHLine()
|
|
|
55334
55388
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
55335
55389
|
}
|
|
55336
55390
|
|
|
55391
|
+
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
55392
|
+
{
|
|
55393
|
+
if (position!=1 && position!=0) return;
|
|
55394
|
+
|
|
55395
|
+
var font=this.ShowPriceTextConfig.Font[position];
|
|
55396
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
55397
|
+
this.Canvas.font=font;
|
|
55398
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
55399
|
+
var lineHeight=this.GetFontHeight();
|
|
55400
|
+
|
|
55401
|
+
var rtBG=null;
|
|
55402
|
+
if (position==1)
|
|
55403
|
+
{
|
|
55404
|
+
var rtBG={ Left:ptStart.X, Top:ptStart.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
55405
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
55406
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
55407
|
+
}
|
|
55408
|
+
else if (position==0)
|
|
55409
|
+
{
|
|
55410
|
+
var rtBG={ Right:ptEnd.X, Top:ptEnd.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
55411
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
55412
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
55413
|
+
}
|
|
55414
|
+
|
|
55415
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));
|
|
55416
|
+
|
|
55417
|
+
this.Canvas.fillStyle=this.ValueTextColor
|
|
55418
|
+
this.Canvas.textAlign="left";
|
|
55419
|
+
this.Canvas.textBaseline="middle";
|
|
55420
|
+
this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);
|
|
55421
|
+
|
|
55422
|
+
}
|
|
55423
|
+
|
|
55337
55424
|
this.CalculateButtonSize=function()
|
|
55338
55425
|
{
|
|
55339
55426
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -55387,7 +55474,7 @@ function ChartDrawHLine()
|
|
|
55387
55474
|
|
|
55388
55475
|
left+=1;
|
|
55389
55476
|
var pixelRatio=GetDevicePixelRatio();
|
|
55390
|
-
if (this.Button.SettingIcon)
|
|
55477
|
+
if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
|
|
55391
55478
|
{
|
|
55392
55479
|
var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
|
|
55393
55480
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -55420,7 +55507,7 @@ function ChartDrawHLine()
|
|
|
55420
55507
|
left=rtButton.Right+this.ButtonSpace;
|
|
55421
55508
|
}
|
|
55422
55509
|
|
|
55423
|
-
if (this.Button.CloseIcon)
|
|
55510
|
+
if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
|
|
55424
55511
|
{
|
|
55425
55512
|
var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
|
|
55426
55513
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -63025,7 +63112,7 @@ function JSChartResource()
|
|
|
63025
63112
|
this.IndexTitleBGColor='rgb(250,250,250)'; //指标名字背景色
|
|
63026
63113
|
this.IndexTitleBorderColor='rgb(180,180,180)'; //指标名字边框颜色
|
|
63027
63114
|
this.IndexTitleBorderMoveOnColor='rgb(0,0,0)'; //指标名字边框颜色(鼠标在上面)
|
|
63028
|
-
this.IndexTitleBorderStyle=1, //0=直角边框 1
|
|
63115
|
+
this.IndexTitleBorderStyle=1, //0=直角边框 1=圆角边框
|
|
63029
63116
|
this.IndexTitleColor="rgb(43,54,69)"; //指标名字颜色
|
|
63030
63117
|
this.IndexTitleSelectedColor="rgb(65,105,225)";
|
|
63031
63118
|
this.OverlayIndexTitleBGColor='rgba(255,255,255,0.7)';
|
|
@@ -8290,6 +8290,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8290
8290
|
drag.LastMove.Y=touches[0].clientY;
|
|
8291
8291
|
|
|
8292
8292
|
this.MouseDrag=drag;
|
|
8293
|
+
var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
|
|
8294
|
+
var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
|
|
8293
8295
|
this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
|
|
8294
8296
|
if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.IsSelected=false;
|
|
8295
8297
|
this.SelectChartDrawPicture=null;
|
|
@@ -8303,7 +8305,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8303
8305
|
{
|
|
8304
8306
|
this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);
|
|
8305
8307
|
//只有1个点 直接完成
|
|
8306
|
-
if (this.FinishChartDrawPicturePoint())
|
|
8308
|
+
if (this.FinishChartDrawPicturePoint())
|
|
8309
|
+
{
|
|
8310
|
+
if (drawPicture.IsDrawMain) this.Draw();
|
|
8311
|
+
else this.DrawDynamicInfo( {Corss:false, Tooltip:false} );
|
|
8312
|
+
}
|
|
8307
8313
|
}
|
|
8308
8314
|
|
|
8309
8315
|
if (e.cancelable) e.preventDefault();
|
|
@@ -8329,6 +8335,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8329
8335
|
event.Callback(event,sendData,this);
|
|
8330
8336
|
}
|
|
8331
8337
|
|
|
8338
|
+
var drawType=0;
|
|
8339
|
+
if (drawPictrueData.ChartDrawPicture.IsDrawMain) drawType=1;
|
|
8340
|
+
else if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart && drawPictureActive.Select.Chart.IsDrawMain) drawType=1;
|
|
8341
|
+
|
|
8342
|
+
if (drawType==1) this.Draw();
|
|
8343
|
+
|
|
8332
8344
|
if (e.cancelable) e.preventDefault();
|
|
8333
8345
|
return;
|
|
8334
8346
|
}
|
|
@@ -8385,6 +8397,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8385
8397
|
}
|
|
8386
8398
|
|
|
8387
8399
|
this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchStart"}, e);
|
|
8400
|
+
|
|
8401
|
+
var drawType=0;
|
|
8402
|
+
if (drawPictureActive.Select.Guid!=null)
|
|
8403
|
+
{
|
|
8404
|
+
if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart) drawType=1;
|
|
8405
|
+
}
|
|
8406
|
+
|
|
8407
|
+
if (drawType==1) this.Draw();
|
|
8388
8408
|
}
|
|
8389
8409
|
else if (this.IsPhonePinching(e))
|
|
8390
8410
|
{
|
|
@@ -58889,6 +58909,15 @@ function ChartDrawHLine()
|
|
|
58889
58909
|
|
|
58890
58910
|
this.AryButton=[];
|
|
58891
58911
|
this.ExtendData; //扩展数据
|
|
58912
|
+
this.ShowPriceTextConfig=
|
|
58913
|
+
{
|
|
58914
|
+
IsShow:[false, false, true], //[0]=left内 [1]=right内 [2]=right外
|
|
58915
|
+
Font:
|
|
58916
|
+
[
|
|
58917
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
58918
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
58919
|
+
],
|
|
58920
|
+
};
|
|
58892
58921
|
|
|
58893
58922
|
//内部变量
|
|
58894
58923
|
this.ColseButtonSize=0;
|
|
@@ -58920,6 +58949,15 @@ function ChartDrawHLine()
|
|
|
58920
58949
|
if (item.SettingIcon) this.Button.SettingIcon=CloneData(item.SettingIcon);
|
|
58921
58950
|
}
|
|
58922
58951
|
if (option.ExtendData) this.ExtendData=option.ExtendData;
|
|
58952
|
+
|
|
58953
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText))
|
|
58954
|
+
{
|
|
58955
|
+
for(var i=0;i<option.IsShowPriceText.length && i<3;++i)
|
|
58956
|
+
{
|
|
58957
|
+
var value=option.IsShowPriceText[i]
|
|
58958
|
+
if (IFrameSplitOperator.IsBool(value)) this.ShowPriceTextConfig.IsShow[i]=value;
|
|
58959
|
+
}
|
|
58960
|
+
}
|
|
58923
58961
|
}
|
|
58924
58962
|
}
|
|
58925
58963
|
|
|
@@ -59008,6 +59046,7 @@ function ChartDrawHLine()
|
|
|
59008
59046
|
this.Canvas.stroke();
|
|
59009
59047
|
this.RestoreLineWidth();
|
|
59010
59048
|
|
|
59049
|
+
//画水平线段
|
|
59011
59050
|
var line={Start:new Point(), End:new Point()};
|
|
59012
59051
|
if (isHScreen)
|
|
59013
59052
|
{
|
|
@@ -59025,6 +59064,18 @@ function ChartDrawHLine()
|
|
|
59025
59064
|
}
|
|
59026
59065
|
this.LinePoint.push(line);
|
|
59027
59066
|
|
|
59067
|
+
var yValue=this.Frame.GetYData(drawPoint[0].Y);
|
|
59068
|
+
var strPrice=yValue.toFixed(this.Precision);
|
|
59069
|
+
if (this.ShowPriceTextConfig.IsShow[0])
|
|
59070
|
+
{
|
|
59071
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 0);
|
|
59072
|
+
}
|
|
59073
|
+
|
|
59074
|
+
if (this.ShowPriceTextConfig.IsShow[1])
|
|
59075
|
+
{
|
|
59076
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 1);
|
|
59077
|
+
}
|
|
59078
|
+
|
|
59028
59079
|
var labInfo;
|
|
59029
59080
|
if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
|
|
59030
59081
|
|
|
@@ -59039,14 +59090,17 @@ function ChartDrawHLine()
|
|
|
59039
59090
|
|
|
59040
59091
|
this.Canvas.restore();
|
|
59041
59092
|
|
|
59042
|
-
var rtDraw={ };
|
|
59043
59093
|
|
|
59044
|
-
|
|
59045
|
-
this.
|
|
59046
|
-
|
|
59047
|
-
|
|
59048
|
-
this.
|
|
59094
|
+
//外部右侧显示价格
|
|
59095
|
+
if (this.ShowPriceTextConfig.IsShow[2])
|
|
59096
|
+
{
|
|
59097
|
+
var rtDraw={ };
|
|
59098
|
+
this.CalculateButtonSize();
|
|
59099
|
+
this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
|
|
59100
|
+
if (labInfo) this.DrawRightLab(labInfo, rtDraw);
|
|
59101
|
+
}
|
|
59049
59102
|
|
|
59103
|
+
|
|
59050
59104
|
//鼠标是否在按钮上
|
|
59051
59105
|
if (moveonPoint && mouseStatus)
|
|
59052
59106
|
{
|
|
@@ -59226,6 +59280,39 @@ function ChartDrawHLine()
|
|
|
59226
59280
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
59227
59281
|
}
|
|
59228
59282
|
|
|
59283
|
+
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
59284
|
+
{
|
|
59285
|
+
if (position!=1 && position!=0) return;
|
|
59286
|
+
|
|
59287
|
+
var font=this.ShowPriceTextConfig.Font[position];
|
|
59288
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
59289
|
+
this.Canvas.font=font;
|
|
59290
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
59291
|
+
var lineHeight=this.GetFontHeight();
|
|
59292
|
+
|
|
59293
|
+
var rtBG=null;
|
|
59294
|
+
if (position==1)
|
|
59295
|
+
{
|
|
59296
|
+
var rtBG={ Left:ptStart.X, Top:ptStart.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
59297
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
59298
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59299
|
+
}
|
|
59300
|
+
else if (position==0)
|
|
59301
|
+
{
|
|
59302
|
+
var rtBG={ Right:ptEnd.X, Top:ptEnd.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
59303
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
59304
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59305
|
+
}
|
|
59306
|
+
|
|
59307
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));
|
|
59308
|
+
|
|
59309
|
+
this.Canvas.fillStyle=this.ValueTextColor
|
|
59310
|
+
this.Canvas.textAlign="left";
|
|
59311
|
+
this.Canvas.textBaseline="middle";
|
|
59312
|
+
this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);
|
|
59313
|
+
|
|
59314
|
+
}
|
|
59315
|
+
|
|
59229
59316
|
this.CalculateButtonSize=function()
|
|
59230
59317
|
{
|
|
59231
59318
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -59279,7 +59366,7 @@ function ChartDrawHLine()
|
|
|
59279
59366
|
|
|
59280
59367
|
left+=1;
|
|
59281
59368
|
var pixelRatio=GetDevicePixelRatio();
|
|
59282
|
-
if (this.Button.SettingIcon)
|
|
59369
|
+
if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
|
|
59283
59370
|
{
|
|
59284
59371
|
var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
|
|
59285
59372
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -59312,7 +59399,7 @@ function ChartDrawHLine()
|
|
|
59312
59399
|
left=rtButton.Right+this.ButtonSpace;
|
|
59313
59400
|
}
|
|
59314
59401
|
|
|
59315
|
-
if (this.Button.CloseIcon)
|
|
59402
|
+
if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
|
|
59316
59403
|
{
|
|
59317
59404
|
var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
|
|
59318
59405
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -66917,7 +67004,7 @@ function JSChartResource()
|
|
|
66917
67004
|
this.IndexTitleBGColor='rgb(250,250,250)'; //指标名字背景色
|
|
66918
67005
|
this.IndexTitleBorderColor='rgb(180,180,180)'; //指标名字边框颜色
|
|
66919
67006
|
this.IndexTitleBorderMoveOnColor='rgb(0,0,0)'; //指标名字边框颜色(鼠标在上面)
|
|
66920
|
-
this.IndexTitleBorderStyle=1, //0=直角边框 1
|
|
67007
|
+
this.IndexTitleBorderStyle=1, //0=直角边框 1=圆角边框
|
|
66921
67008
|
this.IndexTitleColor="rgb(43,54,69)"; //指标名字颜色
|
|
66922
67009
|
this.IndexTitleSelectedColor="rgb(65,105,225)";
|
|
66923
67010
|
this.OverlayIndexTitleBGColor='rgba(255,255,255,0.7)';
|
|
@@ -131352,7 +131439,7 @@ function ScrollBarBGChart()
|
|
|
131352
131439
|
|
|
131353
131440
|
|
|
131354
131441
|
|
|
131355
|
-
var HQCHART_VERSION="1.1.
|
|
131442
|
+
var HQCHART_VERSION="1.1.13106";
|
|
131356
131443
|
|
|
131357
131444
|
function PrintHQChartVersion()
|
|
131358
131445
|
{
|
|
@@ -8334,6 +8334,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8334
8334
|
drag.LastMove.Y=touches[0].clientY;
|
|
8335
8335
|
|
|
8336
8336
|
this.MouseDrag=drag;
|
|
8337
|
+
var drawPictureActive=this.GetActiveDrawPicture(); //上一次选中的
|
|
8338
|
+
var selectedChart={ Chart:this.SelectedChart.Selected.Chart, Identify:this.SelectedChart.Selected.Identify }; //上一次选中的图形
|
|
8337
8339
|
this.PhoneTouchInfo={ Start:{X:touches[0].clientX, Y:touches[0].clientY }, End:{ X:touches[0].clientX, Y:touches[0].clientY } };
|
|
8338
8340
|
if (this.SelectChartDrawPicture) this.SelectChartDrawPicture.IsSelected=false;
|
|
8339
8341
|
this.SelectChartDrawPicture=null;
|
|
@@ -8347,7 +8349,11 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8347
8349
|
{
|
|
8348
8350
|
this.SetChartDrawPictureFirstPoint(drag.Click.X,drag.Click.Y,true);
|
|
8349
8351
|
//只有1个点 直接完成
|
|
8350
|
-
if (this.FinishChartDrawPicturePoint())
|
|
8352
|
+
if (this.FinishChartDrawPicturePoint())
|
|
8353
|
+
{
|
|
8354
|
+
if (drawPicture.IsDrawMain) this.Draw();
|
|
8355
|
+
else this.DrawDynamicInfo( {Corss:false, Tooltip:false} );
|
|
8356
|
+
}
|
|
8351
8357
|
}
|
|
8352
8358
|
|
|
8353
8359
|
if (e.cancelable) e.preventDefault();
|
|
@@ -8373,6 +8379,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8373
8379
|
event.Callback(event,sendData,this);
|
|
8374
8380
|
}
|
|
8375
8381
|
|
|
8382
|
+
var drawType=0;
|
|
8383
|
+
if (drawPictrueData.ChartDrawPicture.IsDrawMain) drawType=1;
|
|
8384
|
+
else if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart && drawPictureActive.Select.Chart.IsDrawMain) drawType=1;
|
|
8385
|
+
|
|
8386
|
+
if (drawType==1) this.Draw();
|
|
8387
|
+
|
|
8376
8388
|
if (e.cancelable) e.preventDefault();
|
|
8377
8389
|
return;
|
|
8378
8390
|
}
|
|
@@ -8429,6 +8441,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
8429
8441
|
}
|
|
8430
8442
|
|
|
8431
8443
|
this.TouchEvent({ EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH, FunctionName:"OnTouchStart"}, e);
|
|
8444
|
+
|
|
8445
|
+
var drawType=0;
|
|
8446
|
+
if (drawPictureActive.Select.Guid!=null)
|
|
8447
|
+
{
|
|
8448
|
+
if (drawPictureActive.Select.Guid && drawPictureActive.Select.Chart) drawType=1;
|
|
8449
|
+
}
|
|
8450
|
+
|
|
8451
|
+
if (drawType==1) this.Draw();
|
|
8432
8452
|
}
|
|
8433
8453
|
else if (this.IsPhonePinching(e))
|
|
8434
8454
|
{
|
|
@@ -58933,6 +58953,15 @@ function ChartDrawHLine()
|
|
|
58933
58953
|
|
|
58934
58954
|
this.AryButton=[];
|
|
58935
58955
|
this.ExtendData; //扩展数据
|
|
58956
|
+
this.ShowPriceTextConfig=
|
|
58957
|
+
{
|
|
58958
|
+
IsShow:[false, false, true], //[0]=left内 [1]=right内 [2]=right外
|
|
58959
|
+
Font:
|
|
58960
|
+
[
|
|
58961
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
58962
|
+
`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
58963
|
+
],
|
|
58964
|
+
};
|
|
58936
58965
|
|
|
58937
58966
|
//内部变量
|
|
58938
58967
|
this.ColseButtonSize=0;
|
|
@@ -58964,6 +58993,15 @@ function ChartDrawHLine()
|
|
|
58964
58993
|
if (item.SettingIcon) this.Button.SettingIcon=CloneData(item.SettingIcon);
|
|
58965
58994
|
}
|
|
58966
58995
|
if (option.ExtendData) this.ExtendData=option.ExtendData;
|
|
58996
|
+
|
|
58997
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.IsShowPriceText))
|
|
58998
|
+
{
|
|
58999
|
+
for(var i=0;i<option.IsShowPriceText.length && i<3;++i)
|
|
59000
|
+
{
|
|
59001
|
+
var value=option.IsShowPriceText[i]
|
|
59002
|
+
if (IFrameSplitOperator.IsBool(value)) this.ShowPriceTextConfig.IsShow[i]=value;
|
|
59003
|
+
}
|
|
59004
|
+
}
|
|
58967
59005
|
}
|
|
58968
59006
|
}
|
|
58969
59007
|
|
|
@@ -59052,6 +59090,7 @@ function ChartDrawHLine()
|
|
|
59052
59090
|
this.Canvas.stroke();
|
|
59053
59091
|
this.RestoreLineWidth();
|
|
59054
59092
|
|
|
59093
|
+
//画水平线段
|
|
59055
59094
|
var line={Start:new Point(), End:new Point()};
|
|
59056
59095
|
if (isHScreen)
|
|
59057
59096
|
{
|
|
@@ -59069,6 +59108,18 @@ function ChartDrawHLine()
|
|
|
59069
59108
|
}
|
|
59070
59109
|
this.LinePoint.push(line);
|
|
59071
59110
|
|
|
59111
|
+
var yValue=this.Frame.GetYData(drawPoint[0].Y);
|
|
59112
|
+
var strPrice=yValue.toFixed(this.Precision);
|
|
59113
|
+
if (this.ShowPriceTextConfig.IsShow[0])
|
|
59114
|
+
{
|
|
59115
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 0);
|
|
59116
|
+
}
|
|
59117
|
+
|
|
59118
|
+
if (this.ShowPriceTextConfig.IsShow[1])
|
|
59119
|
+
{
|
|
59120
|
+
this.DrawPriceText(strPrice, line.Start, line.End, 1);
|
|
59121
|
+
}
|
|
59122
|
+
|
|
59072
59123
|
var labInfo;
|
|
59073
59124
|
if (this.GetLabelCallback) labInfo=this.GetLabelCallback(this);
|
|
59074
59125
|
|
|
@@ -59083,14 +59134,17 @@ function ChartDrawHLine()
|
|
|
59083
59134
|
|
|
59084
59135
|
this.Canvas.restore();
|
|
59085
59136
|
|
|
59086
|
-
var rtDraw={ };
|
|
59087
59137
|
|
|
59088
|
-
|
|
59089
|
-
this.
|
|
59090
|
-
|
|
59091
|
-
|
|
59092
|
-
this.
|
|
59138
|
+
//外部右侧显示价格
|
|
59139
|
+
if (this.ShowPriceTextConfig.IsShow[2])
|
|
59140
|
+
{
|
|
59141
|
+
var rtDraw={ };
|
|
59142
|
+
this.CalculateButtonSize();
|
|
59143
|
+
this.DrawValueText(drawPoint[0].Y, rtDraw, labInfo);
|
|
59144
|
+
if (labInfo) this.DrawRightLab(labInfo, rtDraw);
|
|
59145
|
+
}
|
|
59093
59146
|
|
|
59147
|
+
|
|
59094
59148
|
//鼠标是否在按钮上
|
|
59095
59149
|
if (moveonPoint && mouseStatus)
|
|
59096
59150
|
{
|
|
@@ -59270,6 +59324,39 @@ function ChartDrawHLine()
|
|
|
59270
59324
|
this.DrawButton(rtBG.Top, rtBG.Right, lineHeight, rtDraw);
|
|
59271
59325
|
}
|
|
59272
59326
|
|
|
59327
|
+
this.DrawPriceText=function(text, ptStart, ptEnd, position)
|
|
59328
|
+
{
|
|
59329
|
+
if (position!=1 && position!=0) return;
|
|
59330
|
+
|
|
59331
|
+
var font=this.ShowPriceTextConfig.Font[position];
|
|
59332
|
+
this.Canvas.fillStyle=this.LineColor;
|
|
59333
|
+
this.Canvas.font=font;
|
|
59334
|
+
var textWidth=this.Canvas.measureText(text).width;
|
|
59335
|
+
var lineHeight=this.GetFontHeight();
|
|
59336
|
+
|
|
59337
|
+
var rtBG=null;
|
|
59338
|
+
if (position==1)
|
|
59339
|
+
{
|
|
59340
|
+
var rtBG={ Left:ptStart.X, Top:ptStart.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
59341
|
+
rtBG.Right=rtBG.Left+rtBG.Width;
|
|
59342
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59343
|
+
}
|
|
59344
|
+
else if (position==0)
|
|
59345
|
+
{
|
|
59346
|
+
var rtBG={ Right:ptEnd.X, Top:ptEnd.Y-lineHeight/2, Width:textWidth+4, Height:lineHeight };
|
|
59347
|
+
rtBG.Left=rtBG.Right-rtBG.Width;
|
|
59348
|
+
rtBG.Bottom=rtBG.Top+rtBG.Height;
|
|
59349
|
+
}
|
|
59350
|
+
|
|
59351
|
+
this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top), ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));
|
|
59352
|
+
|
|
59353
|
+
this.Canvas.fillStyle=this.ValueTextColor
|
|
59354
|
+
this.Canvas.textAlign="left";
|
|
59355
|
+
this.Canvas.textBaseline="middle";
|
|
59356
|
+
this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);
|
|
59357
|
+
|
|
59358
|
+
}
|
|
59359
|
+
|
|
59273
59360
|
this.CalculateButtonSize=function()
|
|
59274
59361
|
{
|
|
59275
59362
|
var pixelRatio=GetDevicePixelRatio();
|
|
@@ -59323,7 +59410,7 @@ function ChartDrawHLine()
|
|
|
59323
59410
|
|
|
59324
59411
|
left+=1;
|
|
59325
59412
|
var pixelRatio=GetDevicePixelRatio();
|
|
59326
|
-
if (this.Button.SettingIcon)
|
|
59413
|
+
if (this.Button.SettingIcon && this.Button.SettingIcon.Text)
|
|
59327
59414
|
{
|
|
59328
59415
|
var rtButton={Left:left, Top:drawTop, Width:this.SettingButtonSize, Height:drawHeight };
|
|
59329
59416
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -59356,7 +59443,7 @@ function ChartDrawHLine()
|
|
|
59356
59443
|
left=rtButton.Right+this.ButtonSpace;
|
|
59357
59444
|
}
|
|
59358
59445
|
|
|
59359
|
-
if (this.Button.CloseIcon)
|
|
59446
|
+
if (this.Button.CloseIcon && this.Button.CloseIcon.Text)
|
|
59360
59447
|
{
|
|
59361
59448
|
var rtButton={Left:left, Top:drawTop, Width:this.ColseButtonSize, Height:drawHeight };
|
|
59362
59449
|
rtButton.Right=rtButton.Left+rtButton.Width;
|
|
@@ -66961,7 +67048,7 @@ function JSChartResource()
|
|
|
66961
67048
|
this.IndexTitleBGColor='rgb(250,250,250)'; //指标名字背景色
|
|
66962
67049
|
this.IndexTitleBorderColor='rgb(180,180,180)'; //指标名字边框颜色
|
|
66963
67050
|
this.IndexTitleBorderMoveOnColor='rgb(0,0,0)'; //指标名字边框颜色(鼠标在上面)
|
|
66964
|
-
this.IndexTitleBorderStyle=1, //0=直角边框 1
|
|
67051
|
+
this.IndexTitleBorderStyle=1, //0=直角边框 1=圆角边框
|
|
66965
67052
|
this.IndexTitleColor="rgb(43,54,69)"; //指标名字颜色
|
|
66966
67053
|
this.IndexTitleSelectedColor="rgb(65,105,225)";
|
|
66967
67054
|
this.OverlayIndexTitleBGColor='rgba(255,255,255,0.7)';
|
|
@@ -133916,7 +134003,7 @@ function HQChartScriptWorker()
|
|
|
133916
134003
|
|
|
133917
134004
|
|
|
133918
134005
|
|
|
133919
|
-
var HQCHART_VERSION="1.1.
|
|
134006
|
+
var HQCHART_VERSION="1.1.13106";
|
|
133920
134007
|
|
|
133921
134008
|
function PrintHQChartVersion()
|
|
133922
134009
|
{
|