hqchart 1.1.10713 → 1.1.10722

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.
@@ -1637,7 +1637,7 @@ this.Frame.SetDrawDepthMap(function(){for(var i=0;i<_this5.ExtendChartPaint.leng
1637
1637
  for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(item.IsDrawFirst)item.Draw();}for(var i=0;i<this.ChartPaint.length;++i){var item=this.ChartPaint[i];if(!item.IsDrawFirst)item.Draw();}for(var i=0;i<this.ChartPaintEx.length;++i){var item=this.ChartPaintEx[i];item.Draw();}//叠加股票
1638
1638
  for(var i=0;i<this.OverlayChartPaint.length;++i){var item=this.OverlayChartPaint[i];item.Draw();}if(this.Frame.DrawOveraly)this.Frame.DrawOveraly();//画叠加指标
1639
1639
  //固定扩展图形
1640
- for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.IsCallbackDraw)continue;if(!item.IsDynamic&&item.IsAnimation==false)item.Draw();}if(this.Frame.DrawInsideHorizontal)this.Frame.DrawInsideHorizontal();if(this.Frame.DrawCustomHorizontal)this.Frame.DrawCustomHorizontal();if(this.Frame.DrawEx)this.Frame.DrawEx({Symbol:this.Symbol});if(this.ChartInfoPaint)this.ChartInfoPaint.Draw();this.Frame.DrawLock();this.Frame.Snapshot();for(var i=0;i<this.ExtendChartPaint.length;++i)//动态扩展图形
1640
+ for(var i=0;i<this.ExtendChartPaint.length;++i){var item=this.ExtendChartPaint[i];if(item.IsCallbackDraw)continue;if(!item.IsDynamic&&item.IsAnimation==false)item.Draw();}if(this.Frame.DrawInsideHorizontal)this.Frame.DrawInsideHorizontal();if(this.Frame.DrawCustomHorizontal)this.Frame.DrawCustomHorizontal();if(this.Frame.DrawEx)this.Frame.DrawEx({Symbol:this.Symbol});if(this.ChartInfoPaint)this.ChartInfoPaint.Draw();this.Frame.DrawLock();this.Frame.DrawLogo();this.Frame.Snapshot();for(var i=0;i<this.ExtendChartPaint.length;++i)//动态扩展图形
1641
1641
  {var item=this.ExtendChartPaint[i];if(item.IsCallbackDraw)continue;if(item.IsDynamic&&item.DrawAfterTitle===false)item.Draw();}for(var i=0;i<this.ChartDrawPicture.length;++i){var item=this.ChartDrawPicture[i];if(item.IsDrawFirst)item.Draw();}if(this.IsDrawPictureXY){if(this.CurrentChartDrawPicture)this.Frame.DrawPictureCoordinate(this.CurrentChartDrawPicture,{Symbol:this.Symbol,Period:this.Period});else if(this.SelectChartDrawPicture)this.Frame.DrawPictureCoordinate(this.SelectChartDrawPicture,{Symbol:this.Symbol,Period:this.Period});}if(this.LastPoint.X!=null||this.LastPoint.Y!=null){if(this.ChartCorssCursor){this.ChartCorssCursor.LastPoint=this.LastPoint;this.ChartCorssCursor.CursorIndex=this.CursorIndex;if(this.DragMode==JSCHART_DRAG_ID.CLICK_TOUCH_MODE_ID){//点击手势模式下
1642
1642
  if(this.TouchStatus.CorssCursorShow==true)this.ChartCorssCursor.Draw();}else if(!(this.CorssCursorTouchEnd===true&&this.MouseDrag)&&!(this.CorssCursorTouchEnd==true&&this.IsOnTouch==false)){//移动端 拖拽数据的时候 不显示十字光标, 没有按屏的时候也不显示十字光标
1643
1643
  this.ChartCorssCursor.Draw();}}}var drawStatus=this.GetDrawStatus();drawStatus.DrawName="Draw";var eventTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_TITLE_DRAW);var eventIndexTitleDraw=this.GetEventCallback(JSCHART_EVENT_ID.ON_INDEXTITLE_DRAW);for(var i=0;i<this.TitlePaint.length;++i){var item=this.TitlePaint[i];if(!item.IsDynamic)continue;item.CursorIndex=this.CursorIndex;if(item.ClassName=='DynamicChartTitlePainting')item.OnDrawEvent=eventIndexTitleDraw;else item.OnDrawEvent=eventTitleDraw;if(item.OnDrawEvent){item.OnDrawEvent.FunctionName='Draw';item.OnDrawEvent.PointPosition=null;}item.DrawStatus=drawStatus;item.Draw();}for(var i=0;i<this.ExtendChartPaint.length;++i)//动态扩展图形
@@ -1866,7 +1866,7 @@ this.IsShowIndexTitle=true;//显示整个指标标题信息
1866
1866
  this.IsDrawTitleBottomLine=false;this.BorderLine=null;//1=上 2=下 4=左 8=右
1867
1867
  this.Buttons=[];//按钮事件
1868
1868
  this.IsMinSize=false;//窗口是否最小化
1869
- this.PtInButtons=function(x,y)//坐标是否在按钮上
1869
+ this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.PtInButtons=function(x,y)//坐标是否在按钮上
1870
1870
  {for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[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;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;};this.DrawFrame=function(){};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
1871
1871
  this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;//JSConsole.Chart.Log('[IChartFramePainting.DrawBorder] bottom',bottom);
1872
1872
  if(this.BorderLine==null){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.strokeRect(left,top,width,height);}else if(IFrameSplitOperator.IsPlusNumber(this.BorderLine))//单独绘制每个边框
@@ -1875,7 +1875,7 @@ if(this.BorderLine==null){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.str
1875
1875
  {this.Canvas.moveTo(left,bottom);this.Canvas.lineTo(right,bottom);}if((this.BorderLine&4)>0)//左
1876
1876
  {this.Canvas.moveTo(left,top);this.Canvas.lineTo(left,bottom);}if((this.BorderLine&8)>0)//右
1877
1877
  {this.Canvas.moveTo(right,top);this.Canvas.lineTo(right,bottom);}this.Canvas.stroke();}};//画标题背景色
1878
- this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=new ChartLock();this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(true);}};this.CalculateLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=new ChartLock();this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(false);}};//设施上锁
1878
+ this.DrawTitleBG=function(){if(this.ChartBorder.TitleHeight<=0)return;var border=this.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(this.ChartBorder.GetTopTitle());var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.TitleBGColor;this.Canvas.fillRect(left,top,width,height);if(this.IsDrawTitleBottomLine){this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(left,ToFixedPoint(border.TopTitle));this.Canvas.lineTo(right,ToFixedPoint(border.TopTitle));this.Canvas.stroke();}};this.DrawLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=new ChartLock();this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(true);}};this.DrawLogo=function(){var border=this.GetBorder();var text=g_JSChartResource.FrameLogo.Text;this.Canvas.fillStyle=this.LogoTextColor;this.Canvas.font=this.LogoTextFont;this.Canvas.textAlign='left';this.Canvas.textBaseline='bottom';if(this.IsHScreen){var x=border.Left+5;var y=border.Top+5;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{var x=border.Left+5;var y=border.Bottom-5;this.Canvas.fillText(text,x,y);}};this.CalculateLock=function(){if(this.IsLocked){if(this.LockPaint==null)this.LockPaint=new ChartLock();this.LockPaint.Canvas=this.Canvas;this.LockPaint.ChartBorder=this.ChartBorder;this.LockPaint.ChartFrame=this;this.LockPaint.Draw(false);}};//设施上锁
1879
1879
  this.SetLock=function(lockData){if(!lockData)//空数据不上锁
1880
1880
  {this.IsLocked=false;return;}this.IsLocked=true;if(!this.LockPaint)this.LockPaint=new ChartLock();//创建锁
1881
1881
  if(lockData.Callback)this.LockPaint.Callback=lockData.Callback;//回调
@@ -2418,7 +2418,7 @@ if(IFrameSplitOperator.IsNonEmptyArray(item.OverlayIndex)){for(var j=0,k=0;j<ite
2418
2418
  var minValue=overlayItem.Frame.HorizontalMin;overlayItem.Frame.YSplitOperator.Operator();var value=overlayItem.Frame.GetScaleTextWidth();overlayItem.Frame.HorizontalMax=maxValue;overlayItem.Frame.HorizontalMin=minValue;overlayItem.RightWidth={Index:-1,Width:0};if(!value||!value.TextWidth)continue;var widthItem=value.TextWidth;if(!IFrameSplitOperator.IsNumber(widthItem.Right))continue;overlayItem.RightWidth.Index=k;overlayItem.RightWidth.Width=widthItem.Right;if(aryOverlayWidth[k]){aryOverlayWidth[k][i]=overlayItem.RightWidth;}else{aryOverlayWidth[k]=[];aryOverlayWidth[k][i]=overlayItem.RightWidth;}++k;}}}var overlayWidth=[];for(var i=0;i<aryOverlayWidth.length;++i){var colItem=aryOverlayWidth[i];var max=0;for(var j=0;j<colItem.length;++j){if(!colItem[j])continue;var item=colItem[j].Width;if(max<item)max=item;}if(max>0)max+=this.OverlayBlankWidth;for(var j=0;j<colItem.length;++j){if(!colItem[j])continue;colItem[j].Width=max;}overlayWidth[i]=max;}for(var i=0;i<overlayWidth.length;++i){var value=overlayWidth[i];if(!IFrameSplitOperator.IsNumber(value))continue;width.OverlayRight+=value;}return width;};this.IsFrameXYSplit=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];if(item.Frame.XYSplit)return true;for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];if(overlayItem.Frame.XYSplit)return true;}}return false;};this.Draw=function(option){if(this.SizeChange===true){this.CalculateChartBorder();}var isSplash=false;//是否过场动画
2419
2419
  if(option&&option.IsEnableSplash===true)isSplash=true;if(isSplash==false&&(this.AutoLeftBorder||this.AutoRightBorder)&&this.IsFrameXYSplit()){this.AutoRightOverlayWidth=[];var textWidth=this.GetScaleTextWidth();var bSizeChange=false;if(IFrameSplitOperator.IsNumber(textWidth.Left)&&this.AutoLeftBorder){var blank=0;if(IFrameSplitOperator.IsNumber(this.AutoLeftBorder.Blank))blank=this.AutoLeftBorder.Blank;var value=textWidth.Left+blank;if(IFrameSplitOperator.IsNumber(this.AutoLeftBorder.MinWidth)){if(this.AutoLeftBorder.MinWidth>value)value=this.AutoLeftBorder.MinWidth;}if(this.IsHScreen)this.ChartBorder.Top=value;else this.ChartBorder.Left=value;for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(this.IsHScreen)item.Frame.ChartBorder.Top=value;else item.Frame.ChartBorder.Left=value;}}if(IFrameSplitOperator.IsNumber(textWidth.Right)&&this.AutoRightBorder){var blank=0;if(IFrameSplitOperator.IsNumber(this.AutoRightBorder.Blank))blank=this.AutoRightBorder.Blank;var value=textWidth.Right+blank;if(IFrameSplitOperator.IsNumber(this.AutoRightBorder.MinWidth)){if(this.AutoRightBorder.MinWidth>value)value=this.AutoRightBorder.MinWidth;}this.AuotRightWidth=value;if(IFrameSplitOperator.IsPlusNumber(textWidth.OverlayRight)){value+=this.OverlayBlankWidth;this.AuotRightWidth=value;value+=textWidth.OverlayRight;}if(this.GetExtendChartRightWidth){var extendWidth=this.GetExtendChartRightWidth();value+=extendWidth;}if(this.IsHScreen){if(this.ChartBorder.Bottom!=value)bSizeChange=true;this.ChartBorder.Bottom=value;}else{if(this.ChartBorder.Right!=value)bSizeChange=true;this.ChartBorder.Right=value;}for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(this.IsHScreen)item.Frame.ChartBorder.Bottom=value;else item.Frame.ChartBorder.Right=value;item.Frame.ReDrawToolbar=true;}}this.SetSizeChage(true);}for(var i in this.SubFrame){var item=this.SubFrame[i];if(item.Height<=0)continue;item.Frame.Draw();if(this.AutoRightBorder){var rightOffset=this.AuotRightWidth;for(var j=0;j<item.OverlayIndex.length;++j){var overlayItem=item.OverlayIndex[j];//把主坐标部分设置给子坐标下来
2420
2420
  overlayItem.Frame.DataWidth=item.Frame.DataWidth;overlayItem.Frame.DistanceWidth=item.Frame.DistanceWidth;overlayItem.Frame.XPointCount=item.Frame.XPointCount;if(overlayItem.ChartPaint.length>0&&overlayItem.Frame){overlayItem.Frame.RightOffset=rightOffset;overlayItem.Frame.Draw();rightOffset+=overlayItem.RightWidth.Width;}}}else{var rightOffset=item.Interval;if(item.Frame.RightTextMaxWidth>rightOffset)rightOffset=item.Frame.RightTextMaxWidth;for(var j in item.OverlayIndex){var overlayItem=item.OverlayIndex[j];//把主坐标部分设置给子坐标下来
2421
- overlayItem.Frame.DataWidth=item.Frame.DataWidth;overlayItem.Frame.DistanceWidth=item.Frame.DistanceWidth;overlayItem.Frame.XPointCount=item.Frame.XPointCount;if(overlayItem.ChartPaint.length>0&&overlayItem.Frame){overlayItem.Frame.RightOffset=rightOffset;overlayItem.Frame.Draw();if(overlayItem.Frame.IsShow)rightOffset+=item.Interval;}}}}this.SizeChange=false;};this.DrawOveraly=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];for(var j in item.OverlayIndex){var overlayItem=item.OverlayIndex[j];for(var k in overlayItem.ChartPaint){if(overlayItem.ChartPaint[k].IsShow)overlayItem.ChartPaint[k].Draw();}}}};this.DrawPictureCoordinate=function(drawPicture,option){if(!drawPicture||!drawPicture.Frame)return;if(!IFrameSplitOperator.IsNonEmptyArray(drawPicture.Point))return;if(!drawPicture.GetXYCoordinate)return;var range=drawPicture.GetXYCoordinate();drawPicture.Frame.DrawPictureYCoordinate(drawPicture,range,option);for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(!item||!item.Frame)continue;if(!item.Frame.XSplitOperator.ShowText)continue;item.Frame.DrawPictureXCoordinate(drawPicture,range,option);break;}};this.DrawLock=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.DrawLock();}};this.CalculateLock=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.CalculateLock();}};this.DrawInsideHorizontal=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];if(item.Frame.DrawInsideHorizontal)item.Frame.DrawInsideHorizontal();}};this.DrawCustomHorizontal=function()//定制坐标
2421
+ overlayItem.Frame.DataWidth=item.Frame.DataWidth;overlayItem.Frame.DistanceWidth=item.Frame.DistanceWidth;overlayItem.Frame.XPointCount=item.Frame.XPointCount;if(overlayItem.ChartPaint.length>0&&overlayItem.Frame){overlayItem.Frame.RightOffset=rightOffset;overlayItem.Frame.Draw();if(overlayItem.Frame.IsShow)rightOffset+=item.Interval;}}}}this.SizeChange=false;};this.DrawOveraly=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];for(var j in item.OverlayIndex){var overlayItem=item.OverlayIndex[j];for(var k in overlayItem.ChartPaint){if(overlayItem.ChartPaint[k].IsShow)overlayItem.ChartPaint[k].Draw();}}}};this.DrawPictureCoordinate=function(drawPicture,option){if(!drawPicture||!drawPicture.Frame)return;if(!IFrameSplitOperator.IsNonEmptyArray(drawPicture.Point))return;if(!drawPicture.GetXYCoordinate)return;var range=drawPicture.GetXYCoordinate();drawPicture.Frame.DrawPictureYCoordinate(drawPicture,range,option);for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(!item||!item.Frame)continue;if(!item.Frame.XSplitOperator.ShowText)continue;item.Frame.DrawPictureXCoordinate(drawPicture,range,option);break;}};this.DrawLock=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.DrawLock();}};this.DrawLogo=function(){for(var i=0;i<this.SubFrame.length;++i){var item=this.SubFrame[i];if(item.Frame.DrawLogo){item.Frame.DrawLogo();break;}}};this.CalculateLock=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.CalculateLock();}};this.DrawInsideHorizontal=function(){for(var i in this.SubFrame){var item=this.SubFrame[i];if(item.Frame.DrawInsideHorizontal)item.Frame.DrawInsideHorizontal();}};this.DrawCustomHorizontal=function()//定制坐标
2422
2422
  {for(var i in this.SubFrame){var item=this.SubFrame[i];if(item.Frame.DrawCustomHorizontal)item.Frame.DrawCustomHorizontal();}};this.DrawEx=function(option){for(var i in this.SubFrame){var item=this.SubFrame[i];if((item.Frame.ClassName=="MinuteFrame"||item.Frame.ClassName=="MinuteHScreenFrame")&&i==1){item.Frame.DrawVolTitle(option.Symbol);}}};this.DrawCustomVertical=function(event){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.DrawCustomVerticalEvent=event;if(item.Frame.DrawCustomVertical)item.Frame.DrawCustomVertical();}};this.SetSizeChage=function(sizeChange){this.SizeChange=sizeChange;for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.SizeChange=sizeChange;for(var j in item.OverlayIndex){var overlayItem=item.OverlayIndex[j];if(overlayItem.Frame)overlayItem.Frame.SizeChange=sizeChange;}}//画布的位置
2423
2423
  if(this.ChartBorder.UIElement){this.Position={X:this.ChartBorder.UIElement.offsetLeft,Y:this.ChartBorder.UIElement.offsetTop,W:this.ChartBorder.UIElement.clientWidth,H:this.ChartBorder.UIElement.clientHeight};}};this.SetDrawDepthMap=function(callback){for(var i in this.SubFrame){var item=this.SubFrame[i];item.Frame.DrawDepthMapCallback=callback;}};//图形快照
2424
2424
  this.Snapshot=function(){this.ScreenImageData=this.Canvas.getImageData(0,0,this.ChartBorder.GetChartWidth(),this.ChartBorder.GetChartHeight());};this.GetXData=function(x){return this.SubFrame[0].Frame.GetXData(x);};this.GetYData=function(y,outObject)//outObject 可以保存返回的额外数据
@@ -3033,7 +3033,7 @@ Zoom:{Type:g_JSChartResource.DRAWTEXT.Zoom.Type,Value:g_JSChartResource.DRAWTEXT
3033
3033
  FontName:g_JSChartResource.DRAWTEXT.FontName,YOffset:g_JSChartResource.DRAWTEXT.YOffset};}else if(this.Name=="DRAWNUMBER"){this.TextSize={Max:g_JSChartResource.DRAWNUMBER.MaxSize,Min:g_JSChartResource.DRAWNUMBER.MinSize,//字体的最大最小值
3034
3034
  Zoom:{Type:g_JSChartResource.DRAWNUMBER.Zoom.Type,Value:g_JSChartResource.DRAWNUMBER.Zoom.Value},//放大倍数
3035
3035
  FontName:g_JSChartResource.DRAWNUMBER.FontName,YOffset:g_JSChartResource.DRAWNUMBER.YOffset};}else if(this.Name=="DRAWTEXT_FIX"){this.Font.DRAWTEXT_FIX=g_JSChartResource.DRAWTEXT_FIX.Font;}else if(this.Name=="DRAWNUMBER_FIX"){this.Font.DRAWNUMBER_FIX=g_JSChartResource.DRAWNUMBER_FIX.Font;}};this.SuperGetMaxMin=this.GetMaxMin;this.GetMaxMin=function(){if(this.Name=="DRAWTEXT_FIX"||this.Name=='DRAWNUMBER_FIX')//固定位置的 没有大小值
3036
- {return{Min:null,Max:null};}else if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){return{Min:null,Max:null};}else{return this.SuperGetMaxMin();}};this.DrawRectText=function(){if(!this.DrawData)return;var isHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();if(this.Name=="DRAWTEXTREL"){if(isHScreen){var height=border.RightTitle-border.LeftEx;var width=border.BottomEx-border.TopEx;var x=this.DrawData.Point.X/1000*width+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y/1000*width;}else{var width=border.RightEx-border.LeftEx;var height=border.BottomEx-border.TopTitle;var x=this.DrawData.Point.X/1000*width+border.LeftEx;var y=this.DrawData.Point.Y/1000*height+border.TopTitle;}}else if(this.Name=="DRAWTEXTABS"){if(isHScreen){var x=this.DrawData.Point.X+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y;}else{var x=this.DrawData.Point.X+border.LeftEx;var y=this.DrawData.Point.Y+border.TopTitle;}}else{return;}if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.Color;this.DrawText(this.DrawData.Text,x,y,isHScreen);};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){this.DrawRectText();return;}if(this.Position){this.DrawPosition();return;}if(!this.Data||!this.Data.Data)return;var isHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(isHScreen){chartright=this.ChartBorder.GetBottom();top=this.ChartBorder.GetRightEx();bottom=this.ChartBorder.GetLeftEx();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var xPointCount=this.ChartFrame.XPointCount;var isArrayText=Array.isArray(this.Text);var pixelTatio=GetDevicePixelRatio();var drawTextInfo={Text:{},Font:{}};if(this.Direction==1){this.Canvas.textBaseline='bottom';drawTextInfo.Text={Baseline:'bottom'};}else if(this.Direction==2){this.Canvas.textBaseline='top';drawTextInfo.Text={Baseline:'top'};}else{this.Canvas.textBaseline='middle';drawTextInfo.Text={Baseline:'middle'};}if(this.IconFont){this.Color=this.IconFont.Color;this.Text=this.IconFont.Text;if(this.FixedFontSize>0)var iconSize=this.FixedFontSize;else var iconSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=iconSize+'px '+this.IconFont.Family;}else{if(this.FixedFontSize>0)this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;}drawTextInfo.Font={Height:this.GetFontHeight(this.TextFont)};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y=this.ChartFrame.GetYFromData(value);if(x>chartright)break;this.Canvas.textAlign=this.TextAlign;this.Canvas.fillStyle=this.Color;drawTextInfo.Text.Color=this.Color;drawTextInfo.Text.Align=this.TextAlign;drawTextInfo.X=x;drawTextInfo.Y=y;if(this.YOffset>0&&this.Direction>0){var yPrice=y;this.Canvas.setLineDash([5,10]);this.Canvas.strokeStyle=this.Color;this.Canvas.beginPath();if(isHScreen){if(this.Direction==1){y=top-this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom+this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(yPrice),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(y),ToFixedPoint(x));}else{if(this.Direction==1){y=top+this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom-this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yPrice));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.setLineDash([]);}if(isArrayText){var text=this.Text[i];if(!text)continue;if(this.Name=='DRAWNUMBER'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}this.DrawText(text,x,y,isHScreen);}else{if(this.Name=='DRAWICON'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2){if(this.IconFont)y+=this.IconSize.YOffset*pixelTatio;else y+=this.TextSize.YOffset*pixelTatio;}}else if(this.Name=="DRAWTEXT"){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT"){this.DrawTextV2(this.Text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,x,y,isHScreen);}}}};this.DrawPosition=function()//绘制在指定位置上
3036
+ {return{Min:null,Max:null};}else if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){return{Min:null,Max:null};}else{return this.SuperGetMaxMin();}};this.DrawRectText=function(){if(!this.DrawData)return;var isHScreen=this.ChartFrame.IsHScreen===true;var border=this.ChartFrame.GetBorder();if(this.Name=="DRAWTEXTREL"){if(isHScreen){var height=border.RightTitle-border.LeftEx;var width=border.BottomEx-border.TopEx;var x=this.DrawData.Point.X/1000*width+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y/1000*width;}else{var width=border.RightEx-border.LeftEx;var height=border.BottomEx-border.TopTitle;var x=this.DrawData.Point.X/1000*width+border.LeftEx;var y=this.DrawData.Point.Y/1000*height+border.TopTitle;}}else if(this.Name=="DRAWTEXTABS"){if(isHScreen){var x=this.DrawData.Point.X+border.TopEx;var y=border.RightTitle-this.DrawData.Point.Y;}else{var x=this.DrawData.Point.X+border.LeftEx;var y=this.DrawData.Point.Y+border.TopTitle;}}else{return;}if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';this.Canvas.font=this.TextFont;this.Canvas.fillStyle=this.Color;this.DrawText(this.DrawData.Text,x,y,isHScreen);};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(this.NotSupportMessage){this.DrawNotSupportmessage();return;}if(this.Name=="DRAWTEXTREL"||this.Name=="DRAWTEXTABS"){this.DrawRectText();return;}if(this.Position){this.DrawPosition();return;}if(!this.Data||!this.Data.Data)return;var isHScreen=this.ChartFrame.IsHScreen===true;var isMinute=this.IsMinuteFrame();var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(isHScreen){chartright=this.ChartBorder.GetBottom();top=this.ChartBorder.GetRightEx();bottom=this.ChartBorder.GetLeftEx();xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;}var xPointCount=this.ChartFrame.XPointCount;var isArrayText=Array.isArray(this.Text);var pixelTatio=GetDevicePixelRatio();var drawTextInfo={Text:{},Font:{}};if(this.Direction==1){this.Canvas.textBaseline='bottom';drawTextInfo.Text={Baseline:'bottom'};}else if(this.Direction==2){this.Canvas.textBaseline='top';drawTextInfo.Text={Baseline:'top'};}else{this.Canvas.textBaseline='middle';drawTextInfo.Text={Baseline:'middle'};}if(this.IconFont){this.Color=this.IconFont.Color;this.Text=this.IconFont.Text;if(this.FixedFontSize>0)var iconSize=this.FixedFontSize;else var iconSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=iconSize+'px '+this.IconFont.Family;}else{if(this.FixedFontSize>0)this.TextFont=this.FixedFontSize+'px '+this.TextSize.FontName;else this.TextFont=this.GetDynamicFont(dataWidth,distanceWidth,this.TextSize.Max,this.TextSize.Min,this.TextSize.Zoom,this.TextSize.FontName);this.Canvas.font=this.TextFont;}drawTextInfo.Font={Height:this.GetFontHeight(this.TextFont)};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var value=this.Data.Data[i];if(value==null)continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y=this.ChartFrame.GetYFromData(value);if(x>chartright)break;this.Canvas.textAlign=this.TextAlign;this.Canvas.fillStyle=this.Color;drawTextInfo.Text.Color=this.Color;drawTextInfo.Text.Align=this.TextAlign;drawTextInfo.X=x;drawTextInfo.Y=y;if(this.YOffset>0&&this.Direction>0){var yPrice=y;this.Canvas.setLineDash([5,10]);this.Canvas.strokeStyle=this.Color;this.Canvas.beginPath();if(isHScreen){if(this.Direction==1){y=top-this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom+this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(yPrice),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(y),ToFixedPoint(x));}else{if(this.Direction==1){y=top+this.YOffset*pixelTatio;yPrice+=5*pixelTatio;}else{y=bottom-this.YOffset*pixelTatio;yPrice-=5*pixelTatio;}this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(yPrice));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.setLineDash([]);}if(isArrayText){var text=this.Text[i];if(!text)continue;if(this.Name=='DRAWNUMBER'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT")this.DrawTextV2(text,drawTextInfo,isHScreen);else this.DrawText(text,x,y,isHScreen);}else{if(this.Name=='DRAWICON'){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2){if(this.IconFont)y+=this.IconSize.YOffset*pixelTatio;else y+=this.TextSize.YOffset*pixelTatio;}}else if(this.Name=="DRAWTEXT"){if(this.Direction==1)y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;else if(this.Direction==2)y+=this.TextSize.YOffset*pixelTatio;}if(this.Name=="DRAWTEXT"){this.DrawTextV2(this.Text,drawTextInfo,isHScreen);}else{this.DrawText(this.Text,x,y,isHScreen);}}}};this.DrawPosition=function()//绘制在指定位置上
3037
3037
  {if(!this.Text)return;var isHScreen=this.ChartFrame.IsHScreen===true;if(isHScreen){var y=this.ChartBorder.GetRightEx()-this.ChartBorder.GetWidthEx()*this.Position.Y;var x=this.ChartBorder.GetTop()+this.ChartBorder.GetHeight()*this.Position.X;}else{var x=this.ChartBorder.GetLeft()+this.ChartBorder.GetWidth()*this.Position.X;var y=this.ChartBorder.GetTopEx()+this.ChartBorder.GetHeightEx()*this.Position.Y;}this.Canvas.fillStyle=this.Color;if(this.Name=="DRAWTEXT_FIX")this.Canvas.font=this.Font.DRAWTEXT_FIX;else if(this.Name=="DRAWNUMBER_FIX")this.Canvas.font=this.Font.DRAWNUMBER_FIX;//TYPE:0为左对齐,1为右对齐.
3038
3038
  if(this.Position.Type==0)this.Canvas.textAlign='left';else if(this.Position.Type==1)this.Canvas.textAlign='right';else this.Canvas.textAlign='center';if(this.Direction==1)this.Canvas.textBaseline='bottom';else if(this.Direction==2)this.Canvas.textBaseline='top';else this.Canvas.textBaseline='middle';if(Array.isArray(this.Text)){if(!this.Data||!this.Data.Data)return;var xPointCount=this.ChartFrame.XPointCount;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var text=this.Text[i];if(text){this.DrawText(text,x,y,isHScreen);break;}}}else{this.DrawText(this.Text,x,y,isHScreen);}};this.DrawText=function(text,x,y,isHScreen){if(isHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{this.Canvas.fillText(text,x,y);}};this.DrawTextV2=function(text,drawInfo,isHScreen){var textWidth=this.Canvas.measureText(text).width;if(isHScreen){var x=drawInfo.Y;var y=drawInfo.X;if(drawInfo.Text.Align=="right")y=y-textWidth;else if(drawInfo.Text.Align=="center")y=y-textWidth/2;if(drawInfo.Text.Baseline=="top")x-=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")x-=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
3039
3039
  var xRect=x-margin[0];var yRect=y-margin[2];var bgWidth=textWidth+margin[2]+margin[3];var bgHeight=drawInfo.Font.Height+margin[0]+margin[1];if(this.TextBG.Color){this.Canvas.fillStyle=this.TextBG.Color;this.Canvas.fillRect(xRect,yRect,bgHeight,bgWidth);}if(this.TextBG.Border){this.Canvas.strokeStyle=this.TextBG.Border;this.Canvas.strokeRect(ToFixedPoint(xRect),ToFixedPoint(yRect),ToFixedRect(bgHeight),ToFixedRect(bgWidth));}}this.Canvas.textBaseline="bottom";this.Canvas.textAlign="left";this.Canvas.fillStyle=drawInfo.Text.Color;this.Canvas.save();this.Canvas.translate(x,y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(text,0,0);this.Canvas.restore();}else{var x=drawInfo.X;var y=drawInfo.Y;if(drawInfo.Text.Align=="right")x=x-textWidth;else if(drawInfo.Text.Align=="center")x=x-textWidth/2;if(drawInfo.Text.Baseline=="top")y+=drawInfo.Font.Height;else if(drawInfo.Text.Baseline=="middle")y+=drawInfo.Font.Height/2;if(this.TextBG&&(this.TextBG.Color||this.TextBG.Border)){var margin=this.TextBG.Margin;//0=上 1=下 2=左 3=右
@@ -3405,7 +3405,7 @@ this.Color="#696969";//input type="color"不支持rgb的颜色格式
3405
3405
  //this.Left=5;
3406
3406
  this.Top=5*GetDevicePixelRatio();this.Width=45*GetDevicePixelRatio();//宽度
3407
3407
  this.SetOption=function(option){var pixelRatio=GetDevicePixelRatio();if(!option)return;if(option.Width>10)this.Width=option.Width*pixelRatio;};this.Clear=function(){if(this.ToolsDiv)this.ChartBorder.UIElement.parentNode.removeChild(this.ToolsDiv);};this.Draw=function(){var _this8=this;if(this.SizeChange==false)return;//工具列表
3408
- var TOOL_LIST=[[{HTML:{Title:'线段',IClass:'iconfont icon-draw_line',ID:'icon-segment'},Name:'线段'},{HTML:{Title:'尺子',IClass:'iconfont icon-ruler',ID:'icon_ruler'},Name:'尺子'},{HTML:{Title:'射线',IClass:'iconfont icon-draw_rays',ID:'icon-beam'},Name:'射线'},{HTML:{Title:'标价线',IClass:'iconfont icon-price_line',ID:'icon-price-line'},Name:'标价线'},{HTML:{Title:'垂直线',IClass:'iconfont icon-vertical_line',ID:'icon-vertical-line'},Name:'垂直线'},{HTML:{Title:'箭头',IClass:'iconfont icon-draw_rays',ID:'icon-beam2'},Name:'箭头'},{HTML:{Title:'趋势线',IClass:'iconfont icon-draw_trendline',ID:'icon-trendline'},Name:'趋势线'},{HTML:{Title:'水平线',IClass:'iconfont icon-draw_hline',ID:'icon-hline'},Name:'水平线'},{HTML:{Title:'水平线段',IClass:'iconfont icon-draw_hlinesegment',ID:'icon-hlineseg'},Name:'水平线段'},{HTML:{Title:'平行射线',IClass:'iconfont icon-draw_p_rays_lines',ID:'icon-rayslineseg'},Name:'平行射线'},{HTML:{Title:'平行线',IClass:'iconfont icon-draw_parallel_lines',ID:'icon-parallellines'},Name:'平行线'},{HTML:{Title:'平行通道',IClass:'iconfont icon-draw_parallelchannel',ID:'icon-parallelchannel'},Name:'平行通道'},{HTML:{Title:'价格通道线',IClass:'iconfont icon-draw_pricechannel',ID:'icon-pricechannel'},Name:'价格通道线'},{HTML:{Title:'M头W底',IClass:'iconfont icon-draw_wavemw',ID:'icon-wavemw'},Name:'M头W底'},{HTML:{Title:'头肩型',IClass:'iconfont icon-draw_head_shoulders_bt',ID:'icon-Head-Shoulders'},Name:'头肩型'},{HTML:{Title:'波浪尺',IClass:'iconfont icon-waveruler',ID:'icon-wave-ruler'},Name:'波浪尺'},{HTML:{Title:'AB波浪尺',IClass:'iconfont icon-waveruler',ID:'icon-wave-ruler'},Name:'AB波浪尺'},{HTML:{Title:'箱型线',IClass:'iconfont icon-draw_box',ID:'icon-drawbox'},Name:'箱型线'},{HTML:{Title:'涂鸦线段',IClass:'iconfont icon-draw_line',ID:'icon-segment'},Name:'涂鸦线段'}],[{HTML:{Title:'圆弧',IClass:'iconfont icon-draw_arc',ID:'icon-arc'},Name:'圆弧线'},{HTML:{Title:'矩形',IClass:'iconfont icon-rectangle',ID:'icon-rect'},Name:'矩形'},{HTML:{Title:'平行四边形',IClass:'iconfont icon-draw_quadrangle',ID:'icon-quad'},Name:'平行四边形'},{HTML:{Title:'三角形',IClass:'iconfont icon-draw_triangle',ID:'icon-triangle'},Name:'三角形'},{HTML:{Title:'圆',IClass:'iconfont icon-draw_circle',ID:'icon-circle'},Name:'圆'},{HTML:{Title:'对称角度',IClass:'iconfont icon-draw_symangle',ID:'icon-symangle'},Name:'对称角度'}],[{HTML:{Title:'文本',IClass:'iconfont icon-draw_text',ID:'icon-text'},Name:'文本'},{HTML:{Title:'向上箭头',IClass:'iconfont icon-arrow_up',ID:'icon-arrowup'},Name:'icon-arrow_up'},{HTML:{Title:'向下箭头',IClass:'iconfont icon-arrow_down',ID:'icon-arrowdown'},Name:'icon-arrow_down'},{HTML:{Title:'向左箭头',IClass:'iconfont icon-arrow_left',ID:'icon-arrowleft'},Name:'icon-arrow_left'},{HTML:{Title:'向右箭头',IClass:'iconfont icon-arrow_right',ID:'icon-arrowright'},Name:'icon-arrow_right'}],[{HTML:{Title:'江恩角度线',IClass:'iconfont icon-draw_gannfan',ID:'icon-gannfan'},Name:'江恩角度线'},{HTML:{Title:'斐波那契周期线',IClass:'iconfont icon-draw_fibonacci',ID:'icon-fibonacci'},Name:'斐波那契周期线'},{HTML:{Title:'阻速线',IClass:'iconfont icon-draw_resline',ID:'icon-resline'},Name:'阻速线'},{HTML:{Title:'黄金分割',IClass:'iconfont icon-draw_goldensection',ID:'icon-goldensection'},Name:'黄金分割'},{HTML:{Title:'百分比线',IClass:'iconfont icon-draw_percentage',ID:'icon-percentage'},Name:'百分比线'},{HTML:{Title:'波段线',IClass:'iconfont icon-draw_waveband',ID:'icon-waveband'},Name:'波段线'},{HTML:{Title:'线形回归线',IClass:'iconfont icon-linear_3',ID:'icon-waveband2'},Name:'线形回归线'},{HTML:{Title:'线形回归带',IClass:'iconfont icon-linear_1',ID:'icon-waveband3'},Name:'线形回归带'},{HTML:{Title:'延长线形回归带',IClass:'iconfont icon-linear_2',ID:'icon-waveband5'},Name:'延长线形回归带'}],[{HTML:{Title:'全部删除',IClass:'iconfont icon-recycle_bin',ID:'icon-delete'},Name:'全部删除'}]];var hqChart=this.HQChart;if(!this.ToolsDiv){var div=document.createElement("div");div.className='drawtools';div.id=this.ID;var spanList="";//一层菜单
3408
+ var TOOL_LIST=[[{HTML:{Title:'线段',IClass:'iconfont icon-draw_line',ID:'icon-segment'},Name:'线段'},{HTML:{Title:'尺子',IClass:'iconfont icon-ruler',ID:'icon_ruler'},Name:'尺子'},{HTML:{Title:'射线',IClass:'iconfont icon-draw_rays',ID:'icon-beam'},Name:'射线'},{HTML:{Title:'标价线',IClass:'iconfont icon-price_line',ID:'icon-price-line'},Name:'标价线'},{HTML:{Title:'垂直线',IClass:'iconfont icon-vertical_line',ID:'icon-vertical-line'},Name:'垂直线'},{HTML:{Title:'箭头',IClass:'iconfont icon-draw_rays',ID:'icon-beam2'},Name:'箭头'},{HTML:{Title:'趋势线',IClass:'iconfont icon-draw_trendline',ID:'icon-trendline'},Name:'趋势线'},{HTML:{Title:'水平线',IClass:'iconfont icon-draw_hline',ID:'icon-hline'},Name:'水平线'},{HTML:{Title:'水平线段',IClass:'iconfont icon-draw_hlinesegment',ID:'icon-hlineseg'},Name:'水平线段'},{HTML:{Title:'平行射线',IClass:'iconfont icon-draw_p_rays_lines',ID:'icon-rayslineseg'},Name:'平行射线'},{HTML:{Title:'平行线',IClass:'iconfont icon-draw_parallel_lines',ID:'icon-parallellines'},Name:'平行线'},{HTML:{Title:'平行通道',IClass:'iconfont icon-draw_parallelchannel',ID:'icon-parallelchannel'},Name:'平行通道'},{HTML:{Title:'价格通道线',IClass:'iconfont icon-draw_pricechannel',ID:'icon-pricechannel'},Name:'价格通道线'},{HTML:{Title:'M头W底',IClass:'iconfont icon-draw_wavemw',ID:'icon-wavemw'},Name:'M头W底'},{HTML:{Title:'头肩型',IClass:'iconfont icon-draw_head_shoulders_bt',ID:'icon-Head-Shoulders'},Name:'头肩型'},{HTML:{Title:'波浪尺',IClass:'iconfont icon-waveruler',ID:'icon-wave-ruler'},Name:'波浪尺'},{HTML:{Title:'AB波浪尺',IClass:'iconfont icon-waveruler',ID:'icon-wave-ruler'},Name:'AB波浪尺'},{HTML:{Title:'箱型线',IClass:'iconfont icon-draw_box',ID:'icon-drawbox'},Name:'箱型线'},{HTML:{Title:'涂鸦线段',IClass:'iconfont icon-draw_line',ID:'icon-segment2'},Name:'涂鸦线段'}],[{HTML:{Title:'圆弧',IClass:'iconfont icon-draw_arc',ID:'icon-arc'},Name:'圆弧线'},{HTML:{Title:'矩形',IClass:'iconfont icon-rectangle',ID:'icon-rect'},Name:'矩形'},{HTML:{Title:'平行四边形',IClass:'iconfont icon-draw_quadrangle',ID:'icon-quad'},Name:'平行四边形'},{HTML:{Title:'三角形',IClass:'iconfont icon-draw_triangle',ID:'icon-triangle'},Name:'三角形'},{HTML:{Title:'圆',IClass:'iconfont icon-draw_circle',ID:'icon-circle'},Name:'圆'},{HTML:{Title:'对称角度',IClass:'iconfont icon-draw_symangle',ID:'icon-symangle'},Name:'对称角度'}],[{HTML:{Title:'文本',IClass:'iconfont icon-draw_text',ID:'icon-text'},Name:'文本'},{HTML:{Title:'向上箭头',IClass:'iconfont icon-arrow_up',ID:'icon-arrowup'},Name:'icon-arrow_up'},{HTML:{Title:'向下箭头',IClass:'iconfont icon-arrow_down',ID:'icon-arrowdown'},Name:'icon-arrow_down'},{HTML:{Title:'向左箭头',IClass:'iconfont icon-arrow_left',ID:'icon-arrowleft'},Name:'icon-arrow_left'},{HTML:{Title:'向右箭头',IClass:'iconfont icon-arrow_right',ID:'icon-arrowright'},Name:'icon-arrow_right'}],[{HTML:{Title:'江恩角度线',IClass:'iconfont icon-draw_gannfan',ID:'icon-gannfan'},Name:'江恩角度线'},{HTML:{Title:'斐波那契周期线',IClass:'iconfont icon-draw_fibonacci',ID:'icon-fibonacci'},Name:'斐波那契周期线'},{HTML:{Title:'阻速线',IClass:'iconfont icon-draw_resline',ID:'icon-resline'},Name:'阻速线'},{HTML:{Title:'黄金分割',IClass:'iconfont icon-draw_goldensection',ID:'icon-goldensection'},Name:'黄金分割'},{HTML:{Title:'百分比线',IClass:'iconfont icon-draw_percentage',ID:'icon-percentage'},Name:'百分比线'},{HTML:{Title:'波段线',IClass:'iconfont icon-draw_waveband',ID:'icon-waveband'},Name:'波段线'},{HTML:{Title:'线形回归线',IClass:'iconfont icon-linear_3',ID:'icon-waveband2'},Name:'线形回归线'},{HTML:{Title:'线形回归带',IClass:'iconfont icon-linear_1',ID:'icon-waveband3'},Name:'线形回归带'},{HTML:{Title:'延长线形回归带',IClass:'iconfont icon-linear_2',ID:'icon-waveband5'},Name:'延长线形回归带'}],[{HTML:{Title:'全部删除',IClass:'iconfont icon-recycle_bin',ID:'icon-delete'},Name:'全部删除'}]];var hqChart=this.HQChart;if(!this.ToolsDiv){var div=document.createElement("div");div.className='drawtools';div.id=this.ID;var spanList="";//一层菜单
3409
3409
  var menuTwoList="";//二层菜单
3410
3410
  var menuOne=new Array();TOOL_LIST.forEach(function(item,index){menuOne.push(item[0]);});for(var i=0;i<TOOL_LIST.length;i++){var itemOut=menuOne[i];var itemIn=TOOL_LIST[i];var menuTwoStr="";var contentArrow="";for(var j=0;j<itemIn.length;j++){var currentItem=itemIn[j];var menuTwoName=currentItem.Name;if(menuTwoName.indexOf('up')>-1){menuTwoName="向上箭头";}else if(menuTwoName.indexOf('down')>-1){menuTwoName="向下箭头";}else if(menuTwoName.indexOf('left')>-1){menuTwoName="向左箭头";}else if(menuTwoName.indexOf('right')>-1){menuTwoName="向右箭头";}menuTwoStr+='<p class="menuTwoItem '+currentItem.HTML.ID+'">'+menuTwoName+'<i class="'+currentItem.HTML.IClass+'" title="'+currentItem.HTML.Title+'"></i></p>';}if(i!==TOOL_LIST.length-1){//不是“全部删除”项
3411
3411
  menuTwoList='<div class="menuTwo">'+menuTwoStr+'</div>';contentArrow='<i class="contentArrow iconfont icon-menu_arraw_left"></i>';}else{menuTwoList="";contentArrow="";}var spanNode='<div class="icon-image '+'first-'+itemOut.HTML.ID+'"><i class="'+itemOut.HTML.IClass+'" title="'+itemOut.HTML.Title+'"></i>'+menuTwoList+contentArrow+'</div>';spanList+=spanNode;}this.ChartBorder.UIElement.parentNode.appendChild(div);div.innerHTML=spanList;this.ToolsDiv=div;for(var i in TOOL_LIST){var item=TOOL_LIST[i][0];(0,_jquery2.default)('#'+this.ID+" .first-"+item.HTML.ID).hover(function(){//箭头的旋转过渡
@@ -4433,7 +4433,8 @@ this.FrameSplitTextFont=14*GetDevicePixelRatio()+"px 微软雅黑";//坐标刻
4433
4433
  this.FrameTitleBGColor="rgb(246,251,253)";//标题栏背景色
4434
4434
  this.Frame={XBottomOffset:1*GetDevicePixelRatio(),//X轴文字向下偏移
4435
4435
  YTopOffset:2*GetDevicePixelRatio(),//Y轴顶部文字向下偏移
4436
- YTextPadding:[2,2]};//百分比坐标文字颜色
4436
+ YTextPadding:[2,2]};this.FrameLogo={TextColor:'rgb(178,34,34)',Font:"bold "+16*GetDevicePixelRatio()+"px 微软雅黑",Text:"*仅学习使用*"//请求不要修改声明, 任何修改声明产生的任何法律责任由修改者自行独立承担,与HQChart插件作者无关。
4437
+ };//百分比坐标文字颜色
4437
4438
  this.Frame.PercentageText={PriceColor:'rgb(117,125,129)',PercentageColor:"rgb(117,125,129)",SplitColor:"rgb(117,125,129)",Font:14*GetDevicePixelRatio()+"px 微软雅黑"};//对数坐标
4438
4439
  this.FrameLogarithmic={OpenPriceFont:"bold "+14*GetDevicePixelRatio()+"px 微软雅黑",//开盘价刻度文字字体
4439
4440
  MinInterval:45*GetDevicePixelRatio()//刻度最小间距
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "hqchart",
3
3
  "description": "stock chart",
4
4
  "author": "jones2000",
5
- "version": "1.1.10713",
5
+ "version": "1.1.10722",
6
6
  "main": "lib/main.js",
7
7
  "private": false,
8
8
  "license": "Apache License 2.0",
@@ -7463,6 +7463,7 @@ function JSChartContainer(uielement, OffscreenElement)
7463
7463
  if (this.Frame.DrawEx) this.Frame.DrawEx( {Symbol:this.Symbol} );
7464
7464
  if (this.ChartInfoPaint) this.ChartInfoPaint.Draw();
7465
7465
  this.Frame.DrawLock();
7466
+ this.Frame.DrawLogo();
7466
7467
  this.Frame.Snapshot();
7467
7468
 
7468
7469
  for(var i=0;i<this.ExtendChartPaint.length;++i) //动态扩展图形
@@ -10392,6 +10393,9 @@ function IChartFramePainting()
10392
10393
 
10393
10394
  this.IsMinSize=false; //窗口是否最小化
10394
10395
 
10396
+ this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
10397
+ this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
10398
+
10395
10399
 
10396
10400
  this.PtInButtons=function(x,y) //坐标是否在按钮上
10397
10401
  {
@@ -10548,6 +10552,33 @@ function IChartFramePainting()
10548
10552
  }
10549
10553
  }
10550
10554
 
10555
+ this.DrawLogo=function()
10556
+ {
10557
+ var border=this.GetBorder();
10558
+ var text=g_JSChartResource.FrameLogo.Text;
10559
+
10560
+ this.Canvas.fillStyle=this.LogoTextColor;
10561
+ this.Canvas.font=this.LogoTextFont;
10562
+ this.Canvas.textAlign = 'left';
10563
+ this.Canvas.textBaseline = 'bottom';
10564
+ if (this.IsHScreen)
10565
+ {
10566
+ var x=border.Left+5;
10567
+ var y=border.Top+5;
10568
+ this.Canvas.save();
10569
+ this.Canvas.translate(x,y);
10570
+ this.Canvas.rotate(90 * Math.PI / 180);
10571
+ this.Canvas.fillText(text,0,0);
10572
+ this.Canvas.restore();
10573
+ }
10574
+ else
10575
+ {
10576
+ var x=border.Left+5;
10577
+ var y=border.Bottom-5;
10578
+ this.Canvas.fillText(text,x,y);
10579
+ }
10580
+ }
10581
+
10551
10582
  this.CalculateLock=function()
10552
10583
  {
10553
10584
  if (this.IsLocked)
@@ -16259,6 +16290,19 @@ function HQTradeFrame()
16259
16290
  }
16260
16291
  }
16261
16292
 
16293
+ this.DrawLogo=function()
16294
+ {
16295
+ for(var i=0;i<this.SubFrame.length;++i)
16296
+ {
16297
+ var item=this.SubFrame[i];
16298
+ if (item.Frame.DrawLogo)
16299
+ {
16300
+ item.Frame.DrawLogo();
16301
+ break;
16302
+ }
16303
+ }
16304
+ }
16305
+
16262
16306
  this.CalculateLock=function()
16263
16307
  {
16264
16308
  for (var i in this.SubFrame)
@@ -25370,7 +25414,11 @@ function ChartSingleText()
25370
25414
  if (this.Direction==1) y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;
25371
25415
  else if (this.Direction==2) y+=this.TextSize.YOffset*pixelTatio;
25372
25416
  }
25373
- this.DrawText(text,x,y,isHScreen);
25417
+
25418
+ if (this.Name=="DRAWTEXT")
25419
+ this.DrawTextV2(text,drawTextInfo,isHScreen);
25420
+ else
25421
+ this.DrawText(text,x,y,isHScreen);
25374
25422
  }
25375
25423
  else
25376
25424
  {
@@ -31822,7 +31870,7 @@ function DrawToolsButton()
31822
31870
  { HTML: { Title: '波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: '波浪尺' },
31823
31871
  { HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: 'AB波浪尺' },
31824
31872
  { HTML: { Title: '箱型线', IClass: 'iconfont icon-draw_box', ID: 'icon-drawbox' }, Name: '箱型线' },
31825
- { HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment' }, Name: '涂鸦线段' },
31873
+ { HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment2' }, Name: '涂鸦线段' },
31826
31874
 
31827
31875
  ],
31828
31876
  [
@@ -45373,6 +45421,13 @@ function JSChartResource()
45373
45421
  YTextPadding:[2,2]
45374
45422
  };
45375
45423
 
45424
+ this.FrameLogo=
45425
+ {
45426
+ TextColor:'rgb(178,34,34)',
45427
+ Font:"bold "+ 16*GetDevicePixelRatio() +"px 微软雅黑",
45428
+ Text:"*仅学习使用*" //请求不要修改声明, 任何修改声明产生的任何法律责任由修改者自行独立承担,与HQChart插件作者无关。
45429
+ };
45430
+
45376
45431
  //百分比坐标文字颜色
45377
45432
  this.Frame.PercentageText= {
45378
45433
  PriceColor:'rgb(117,125,129)',
@@ -7507,6 +7507,7 @@ function JSChartContainer(uielement, OffscreenElement)
7507
7507
  if (this.Frame.DrawEx) this.Frame.DrawEx( {Symbol:this.Symbol} );
7508
7508
  if (this.ChartInfoPaint) this.ChartInfoPaint.Draw();
7509
7509
  this.Frame.DrawLock();
7510
+ this.Frame.DrawLogo();
7510
7511
  this.Frame.Snapshot();
7511
7512
 
7512
7513
  for(var i=0;i<this.ExtendChartPaint.length;++i) //动态扩展图形
@@ -10436,6 +10437,9 @@ function IChartFramePainting()
10436
10437
 
10437
10438
  this.IsMinSize=false; //窗口是否最小化
10438
10439
 
10440
+ this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;
10441
+ this.LogoTextFont=g_JSChartResource.FrameLogo.Font;
10442
+
10439
10443
 
10440
10444
  this.PtInButtons=function(x,y) //坐标是否在按钮上
10441
10445
  {
@@ -10592,6 +10596,33 @@ function IChartFramePainting()
10592
10596
  }
10593
10597
  }
10594
10598
 
10599
+ this.DrawLogo=function()
10600
+ {
10601
+ var border=this.GetBorder();
10602
+ var text=g_JSChartResource.FrameLogo.Text;
10603
+
10604
+ this.Canvas.fillStyle=this.LogoTextColor;
10605
+ this.Canvas.font=this.LogoTextFont;
10606
+ this.Canvas.textAlign = 'left';
10607
+ this.Canvas.textBaseline = 'bottom';
10608
+ if (this.IsHScreen)
10609
+ {
10610
+ var x=border.Left+5;
10611
+ var y=border.Top+5;
10612
+ this.Canvas.save();
10613
+ this.Canvas.translate(x,y);
10614
+ this.Canvas.rotate(90 * Math.PI / 180);
10615
+ this.Canvas.fillText(text,0,0);
10616
+ this.Canvas.restore();
10617
+ }
10618
+ else
10619
+ {
10620
+ var x=border.Left+5;
10621
+ var y=border.Bottom-5;
10622
+ this.Canvas.fillText(text,x,y);
10623
+ }
10624
+ }
10625
+
10595
10626
  this.CalculateLock=function()
10596
10627
  {
10597
10628
  if (this.IsLocked)
@@ -16303,6 +16334,19 @@ function HQTradeFrame()
16303
16334
  }
16304
16335
  }
16305
16336
 
16337
+ this.DrawLogo=function()
16338
+ {
16339
+ for(var i=0;i<this.SubFrame.length;++i)
16340
+ {
16341
+ var item=this.SubFrame[i];
16342
+ if (item.Frame.DrawLogo)
16343
+ {
16344
+ item.Frame.DrawLogo();
16345
+ break;
16346
+ }
16347
+ }
16348
+ }
16349
+
16306
16350
  this.CalculateLock=function()
16307
16351
  {
16308
16352
  for (var i in this.SubFrame)
@@ -25414,7 +25458,11 @@ function ChartSingleText()
25414
25458
  if (this.Direction==1) y-=g_JSChartResource.DRAWABOVE.YOffset*pixelTatio;
25415
25459
  else if (this.Direction==2) y+=this.TextSize.YOffset*pixelTatio;
25416
25460
  }
25417
- this.DrawText(text,x,y,isHScreen);
25461
+
25462
+ if (this.Name=="DRAWTEXT")
25463
+ this.DrawTextV2(text,drawTextInfo,isHScreen);
25464
+ else
25465
+ this.DrawText(text,x,y,isHScreen);
25418
25466
  }
25419
25467
  else
25420
25468
  {
@@ -31866,7 +31914,7 @@ function DrawToolsButton()
31866
31914
  { HTML: { Title: '波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: '波浪尺' },
31867
31915
  { HTML: { Title: 'AB波浪尺', IClass: 'iconfont icon-waveruler', ID: 'icon-wave-ruler' }, Name: 'AB波浪尺' },
31868
31916
  { HTML: { Title: '箱型线', IClass: 'iconfont icon-draw_box', ID: 'icon-drawbox' }, Name: '箱型线' },
31869
- { HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment' }, Name: '涂鸦线段' },
31917
+ { HTML: { Title: '涂鸦线段', IClass: 'iconfont icon-draw_line', ID: 'icon-segment2' }, Name: '涂鸦线段' },
31870
31918
 
31871
31919
  ],
31872
31920
  [
@@ -45417,6 +45465,13 @@ function JSChartResource()
45417
45465
  YTextPadding:[2,2]
45418
45466
  };
45419
45467
 
45468
+ this.FrameLogo=
45469
+ {
45470
+ TextColor:'rgb(178,34,34)',
45471
+ Font:"bold "+ 16*GetDevicePixelRatio() +"px 微软雅黑",
45472
+ Text:"*仅学习使用*" //请求不要修改声明, 任何修改声明产生的任何法律责任由修改者自行独立承担,与HQChart插件作者无关。
45473
+ };
45474
+
45420
45475
  //百分比坐标文字颜色
45421
45476
  this.Frame.PercentageText= {
45422
45477
  PriceColor:'rgb(117,125,129)',