hqchart 1.1.13600 → 1.1.13606

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.
@@ -1857,7 +1857,8 @@ this.Tooltip.style.position="absolute";this.Tooltip.style.left=left+"px";this.To
1857
1857
  this.Tooltip.style.position="absolute";this.Tooltip.style.left=left+"px";this.Tooltip.style.top=top+xMove+"px";this.Tooltip.style.width=width+"px";this.Tooltip.style.height=null;this.Tooltip.innerHTML=format.Text;;this.Tooltip.style.display="block";}else if(toolTip.Type==7)//ChartDrawSVG
1858
1858
  {var left=x;var top=y;var format=g_DivTooltipDataForamt.Create('ChartDrawSVGDataStringFormat');format.Value=toolTip;format.Symbol=this.Symbol;format.Period=this.Period;format.LanguageID=this.LanguageID;if(!format.Operator())return;var width=format.Width;this.Tooltip.className='jchart-chartdrawsvg-tooltip';//ChartDrawSVG指标数据
1859
1859
  this.Tooltip.style.position="absolute";this.Tooltip.style.left=left+"px";this.Tooltip.style.top=top+xMove+"px";this.Tooltip.style.width=width+"px";this.Tooltip.style.height=null;this.Tooltip.innerHTML=format.Text;this.Tooltip.style.display="block";}};this.UpdateDOMTooltip=function(toolTipType,data){var _this12=this;if(!this.TooltipCache.IsShow)return;if(this.TooltipCache.Type!=toolTipType)return;if(!this.TooltipCache.Data)return;if(this.TooltipCache.Type===0){if(!data||!IFrameSplitOperator.IsNonEmptyArray(data.Data))return;var lastItem=data.Data[data.Data.length-1];if(lastItem.Date!=this.TooltipCache.Data.Date)return;if(IFrameSplitOperator.IsNumber(lastItem.Time)&&lastItem.Time!=this.TooltipCache.Data.Time)return;var klinePaint=this.ChartPaint[0];var format=g_DivTooltipDataForamt.Create('HistoryDataStringFormat');format.Value={Data:lastItem,ChartPaint:klinePaint,Type:this.TooltipCache.Type};format.Symbol=this.Symbol;format.LanguageID=this.LanguageID;format.GetEventCallback=function(id){return _this12.GetEventCallback(id);};if(!format.Operator())return;if(format.Text==this.TooltipCache.InnerHTML)return;this.Tooltip.innerHTML=format.Text;this.TooltipCache.InnerHTML=format.Text;}};this.HideTooltip=function(){this.TooltipCache.IsShow=false;this.TooltipCache.Type=null;this.TooltipCache.InnerHTML=null;this.TooltipCache.Data=null;if(this.Tooltip.style.display!="none")this.Tooltip.style.display="none";};this.UpdateSelectRect=function(start,end){if(!this.ChartPaint[0].Data)return;var paint=this.GetRectSelectPaint();if(!paint)return;var data=this.ChartPaint[0].Data;var startItem=data.Data[start];var endItem=data.Data[end];JSConsole.Chart.Log('[JSChartContainer::UpdateSelectRect]',startItem,endItem);paint.SetPoint(startItem,{Index:0,DataIndex:start});paint.SetPoint(endItem,{Index:1,DataIndex:end});this.Draw();};this.HideSelectRect=function(){this.ClearDragSelectRect();};this.ResetFrameXYSplit=function(){if(typeof this.Frame.ResetXYSplit=='function')this.Frame.ResetXYSplit();};this.ResetFrameXSplit=function(){if(typeof this.Frame.ResetXSplit=='function')this.Frame.ResetXSplit();};this.UpdateFrameMaxMinV2=function(){var mapFrame=new _map2.default();//key=frameid, value:{ ChartPaint:[] }
1860
- for(var i=0;i<this.Frame.SubFrame.length;++i){var subItem=this.Frame.SubFrame[i];if(!subItem||!subItem.Frame)continue;var frame=subItem.Frame;var key=frame.Identify;var item={ID:key,Frame:frame,ChartPaint:[],Max:null,Min:null,OverlayFrame:[],//共享坐标
1860
+ for(var i=0;i<this.Frame.SubFrame.length;++i){var subItem=this.Frame.SubFrame[i];if(!subItem||!subItem.Frame)continue;var frame=subItem.Frame;//自定义刻度每次都调用
1861
+ frame.YCustomSplit=true;var key=frame.Identify;var item={ID:key,Frame:frame,ChartPaint:[],Max:null,Min:null,OverlayFrame:[],//共享坐标
1861
1862
  SingleOverlay:[],//独立坐标
1862
1863
  MainOverlayFrame:[null,null]//叠加坐标在主坐标显示[0]=left [1]=right
1863
1864
  };for(var j=0;j<subItem.OverlayIndex.length;++j){var overlayItem=subItem.OverlayIndex[j];var overlayFrame=overlayItem.Frame;if(overlayFrame.IsShowMainFrame===1)item.MainOverlayFrame[0]=overlayFrame;else if(overlayFrame.IsShowMainFrame===2)item.MainOverlayFrame[1]=overlayFrame;if(overlayFrame.IsShareY){if(!overlayFrame.MainFrame)continue;if(overlayFrame.IsCalculateYMaxMin===false)continue;//叠加坐标Y轴不调整
@@ -2117,6 +2118,7 @@ this.IsShow=true;//是否显示
2117
2118
  this.SizeChange=true;//大小是否改变
2118
2119
  this.XYSplit=true;//XY轴坐标信息改变
2119
2120
  this.XSplit=true;//X轴变化
2121
+ this.YCustomSplit=true;//自定义Y轴分割线
2120
2122
  this.HorizontalMax;//Y轴最大值
2121
2123
  this.HorizontalMin;//Y轴最小值
2122
2124
  this.HorizontalReserved=null;//Y轴预留高度 { Top:上, Bottom:下 }
@@ -2144,7 +2146,8 @@ this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSC
2144
2146
  this.IsDrawRightBorder=false;//是否绘制右侧刻度空白的边框
2145
2147
  this.IsDrawLeftBorder=false;//是否绘制右侧刻度空白的边框
2146
2148
  this.PtInButtons=function(x,y)//坐标是否在按钮上
2147
- {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.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;};this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
2149
+ {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.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2150
+ };this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
2148
2151
  var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.ClientBGColor;this.Canvas.fillRect(left,top,width,height);};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;}}};//画边框
2149
2152
  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 top=ToFixedPoint(border.TopEx);
2150
2153
  var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
@@ -2356,7 +2359,8 @@ var top=ToFixedPoint(border.Top);var bottom=ToFixedPoint(border.Bottom);this.Can
2356
2359
  this.DrawPictureXCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var left=border.Left;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();if(range.X){var xRange=range.X;var xLeft=xRange.Min.X;var xRight=xRange.Max.X;if(xLeft<left)xLeft=left;if(xRight>right)xRight=right;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(xLeft,border.Bottom,xRight-xLeft,fontHeight);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.X<left||item.X>right)continue;var index=parseInt(this.GetXData(item.X));var kItem=this.GetKItem(index,option);if(kItem){//var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
2357
2360
  var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex,option){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;if(currentIndex<this.Data.Data.length){return this.Data.Data[currentIndex];}else{var kItem=this.Data.Data[this.Data.Data.length-1];var xDatetime=g_MinuteTimeStringData.GetTimeData(option.Symbol);var index=currentIndex%xDatetime.length;var timeItem=xDatetime[index];return{Date:kItem.Date,Time:timeItem};}};this.DrawDayVertical=function(dayItem,x,border){if(!dayItem.BG)return;var bgItem=dayItem.BG;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var maxWidth=xEnd-xStart;var bgHeight=this.ChartBorder.Bottom;if(IFrameSplitOperator.IsNumber(bgItem.Height))bgHeight=bgItem.Height;if(bgItem.Color){this.Canvas.fillStyle=bgItem.Color;var rtBG={Left:xStart,Width:maxWidth,Top:border.Bottom,Height:bgHeight};this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText))//[ [{Text:, Color:},], []]
2358
2361
  {this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var yText=border.Bottom+2;var lineHeight=this.Canvas.measureText("擎").width+2;for(var i=0,j=0;i<dayItem.AryText.length;++i){var aryText=dayItem.AryText[i];var itemWidth=0;var aryOut=[];for(j=0;j<aryText.length;++j){var item=aryText[j];var textWidth=this.Canvas.measureText(item.Text).width;if(itemWidth+textWidth>maxWidth)break;var newItem={Text:item.Text,Width:textWidth,Color:item.Color,Space:item.Space};itemWidth+=textWidth;item.Width=textWidth;if(item.Space>=1)itemWidth+=item.Space;aryOut.push(newItem);}var xText=xStart+(maxWidth-itemWidth)/2;for(var j=0;j<aryOut.length;++j){var item=aryOut[j];if(!IFrameSplitOperator.IsNumber(item.Width))break;if(item.Color)this.Canvas.fillStyle=item.Color;else if(dayItem.TextColor)this.Canvas.fillStyle=dayItem.TextColor;this.Canvas.fillText(item.Text,xText,yText);xText+=item.Width;if(item.Space>=1)xText+=item.Space;}yText+=lineHeight;}}};//分割x,y轴坐标信息
2359
- this.SplitXYCoordinate=function(){if(this.XYSplit==false)return;if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.YSplitOperator!=null)this.YSplitOperator.Operator();};this.GetMultiDayXFromIndex=function(index,border){var dayBorder=border.DayBorder;var minuteIndex=index%this.MinuteCount;var dayIndex=parseInt(index/this.MinuteCount);if(dayIndex>=dayBorder.length)dayIndex=dayBorder.length-1;var client=dayBorder[dayIndex];var count=this.MinuteCount-1;if(minuteIndex>=count){return client.RightEx;}else{var width=client.RightEx-client.LeftEx;var offset=client.LeftEx+width*minuteIndex/count;return offset;}};this.GetXFromIndex=function(index){var count=this.XPointCount-1;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXFromIndex(index,border);if(count==1){if(index==0)return border.LeftEx;else return border.RightEx;}else if(count<=0){return border.LeftEx;}else if(index>=count){return border.RightEx;}else{var width=border.RightEx-border.LeftEx;var offset=border.LeftEx+width*index/count;return offset;}};this.GetMultiDayXData=function(x,border){var dayBorder=border.DayBorder;for(var i=0;i<dayBorder.length;++i){var client=dayBorder[i];if(x>=client.Left&&x<=client.Right){var count=this.MinuteCount-1;var dayMinuteCount=this.MinuteCount*i;if(x<=client.LeftEx)return 0+dayMinuteCount;if(x>=client.RightEx)return count+dayMinuteCount;var width=client.RightEx-client.LeftEx;return(x-client.LeftEx)*(count*1.0/width)+dayMinuteCount;}}};//X坐标转x轴数值
2362
+ this.SplitXYCoordinate=function(){if(this.XYSplit==false){//计算自定义刻度
2363
+ if(this.YCustomSplit){if(this.YSplitOperator&&this.YSplitOperator.CustomCoordinate)this.YSplitOperator.CustomCoordinate();}return;}if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.YSplitOperator!=null)this.YSplitOperator.Operator();};this.GetMultiDayXFromIndex=function(index,border){var dayBorder=border.DayBorder;var minuteIndex=index%this.MinuteCount;var dayIndex=parseInt(index/this.MinuteCount);if(dayIndex>=dayBorder.length)dayIndex=dayBorder.length-1;var client=dayBorder[dayIndex];var count=this.MinuteCount-1;if(minuteIndex>=count){return client.RightEx;}else{var width=client.RightEx-client.LeftEx;var offset=client.LeftEx+width*minuteIndex/count;return offset;}};this.GetXFromIndex=function(index){var count=this.XPointCount-1;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXFromIndex(index,border);if(count==1){if(index==0)return border.LeftEx;else return border.RightEx;}else if(count<=0){return border.LeftEx;}else if(index>=count){return border.RightEx;}else{var width=border.RightEx-border.LeftEx;var offset=border.LeftEx+width*index/count;return offset;}};this.GetMultiDayXData=function(x,border){var dayBorder=border.DayBorder;for(var i=0;i<dayBorder.length;++i){var client=dayBorder[i];if(x>=client.Left&&x<=client.Right){var count=this.MinuteCount-1;var dayMinuteCount=this.MinuteCount*i;if(x<=client.LeftEx)return 0+dayMinuteCount;if(x>=client.RightEx)return count+dayMinuteCount;var width=client.RightEx-client.LeftEx;return(x-client.LeftEx)*(count*1.0/width)+dayMinuteCount;}}};//X坐标转x轴数值
2360
2364
  this.GetXData=function(x){var count=this.XPointCount-1;if(count<0)count=0;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXData(x,border);if(x<=border.LeftEx)return 0;if(x>=border.RightEx)return count;var width=border.RightEx-border.LeftEx;return(x-border.LeftEx)*(count*1.0/width);};this.DrawCustomHorizontal=function()//Y轴刻度定制显示
2361
2365
  {if(this.IsMinSize)return;for(var i in this.CustomHorizontalInfo){var item=this.CustomHorizontalInfo[i];switch(item.Type){case 0:case 1:this.DrawCustomItem(item);//自定义刻度
2362
2366
  break;}}};this.GetLeftExtendXFromIndex=function(index,obj){var count=obj.TotalCount-1;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetLeftExtendMultiDayXFromIndex(index,obj,border);var left=border.Left;var width=this.ChartBorder.LeftExtendWidth;var offset=left+width*index/count;return offset;};this.GetLeftExtendMultiDayXFromIndex=function(index,obj,border){var dayBorder=border.DayBorder;var client=dayBorder[obj.Index];var count=obj.TotalCount-1;var left=client.Left;var right=client.LeftEx;var width=right-left;var offset=left+width*index/count;return offset;};this.GetLeftExtendMultiDayXData=function(x,obj,border){var dayBorder=border.DayBorder;for(var i=0;i<dayBorder.length;++i){var client=dayBorder[i];if(x>=client.Left&&x<=client.LeftEx){if(!obj[i])return null;var count=obj[i].TotalCount-1;var left=client.Left;var right=client.LeftEx;var width=right-left;var index=(x-left)*(count*1.0/width);return{DayIndex:parseInt(i),DataIndex:index};}}};this.GetLeftExtendXData=function(x,obj){var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetLeftExtendMultiDayXData(x,obj,border);var count=obj.TotalCount-1;if(count<0)count=0;var left=border.Left;var right=border.LeftEx;if(x<=left)return 0;if(x>=right)return count;var width=right-left;return(x-left)*(count*1.0/width);};this.MoveXIndexLeft=function(step,obj){JSConsole.Chart.Log("[MinuteFrame::MoveXIndexLeft] obj ",obj);if(obj.DataType==2)//多日数据
@@ -2400,13 +2404,15 @@ if(item.Message[0]!=null&&borderTop<10*pixelTatio&&this.IsShowYText[0]===true){i
2400
2404
  this.newMethod();delete this.newMethod;this.ClassName="OverlayMinuteFrame";this.IsShow=true;//坐标是否显示
2401
2405
  this.IsShareY=false;//使用和主框架公用Y轴
2402
2406
  this.IsCalculateYMaxMin=true;//是否计算Y最大最小值
2403
- this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){}this.SizeChange=false;this.XYSplit=false;};this.DrawToolbar=function(){return;};this.GetScaleTextWidth=function(){return{TextWidth:0};};//分割x,y轴坐标信息
2407
+ this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){}this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2408
+ };this.DrawToolbar=function(){return;};this.GetScaleTextWidth=function(){return{TextWidth:0};};//分割x,y轴坐标信息
2404
2409
  this.SplitXYCoordinate=function(){if(this.XYSplit==false)return;if(this.IsShareY)//和主图指标共享Y轴坐标
2405
2410
  {this.HorizontalMax=this.MainFrame.HorizontalMax;this.HorizontalMin=this.MainFrame.HorizontalMin;this.HorizontalInfo=[];for(var i=0;i<this.MainFrame.HorizontalInfo.length;++i){var item=this.MainFrame.HorizontalInfo[i];this.HorizontalInfo.push(item);}}else//独立Y轴坐标
2406
2411
  {if(this.YSplitOperator!=null)this.YSplitOperator.Operator();}// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
2407
2412
  };}function OverlayMinuteHScreenFrame(){this.newMethod=MinuteHScreenFrame;//派生
2408
2413
  this.newMethod();delete this.newMethod;this.ClassName="OverlayMinuteHScreenFrame";this.IsShow=true;//坐标是否显示
2409
- this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){}this.SizeChange=false;this.XYSplit=false;};//分割x,y轴坐标信息
2414
+ this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){}this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2415
+ };//分割x,y轴坐标信息
2410
2416
  this.SplitXYCoordinate=function(){if(this.XYSplit==false)return;if(this.IsShareY)//和主图指标共享Y轴坐标
2411
2417
  {this.HorizontalMax=this.MainFrame.HorizontalMax;this.HorizontalMin=this.MainFrame.HorizontalMin;this.HorizontalInfo=[];for(var i in this.MainFrame.HorizontalInfo){var item=this.MainFrame.HorizontalInfo[i];this.HorizontalInfo.push(item);}}else//独立Y轴坐标
2412
2418
  {if(this.YSplitOperator!=null)this.YSplitOperator.Operator();}// if (this.XSplitOperator!=null) this.XSplitOperator.Operator(); 子坐标和主坐标X轴一致 所以不用计算
@@ -2471,7 +2477,8 @@ this.IsOverlayMaxMin=function(obj){if(!this.ChartKLine)return false;if(!this.Cha
2471
2477
  if(obj.Text.TextAlign==='right')obj.X-=textWidth;var max=this.ChartKLine.Max,min=this.ChartKLine.Min;var isOverlayMax=false,isOverlayMin=false;var textHeight=20;//字体高度
2472
2478
  if(max.X>=obj.X&&max.X<=obj.X+textWidth)//最大值X 坐标不在 刻度文字范围内
2473
2479
  {var y1=max.Y+textHeight,y2=max.Y-textHeight;if(y1>=obj.Y-textHeight&&y1<=obj.Y+textHeight||y2>=obj.Y-textHeight&&y2<=obj.Y+textHeight)isOverlayMax=true;}if(isOverlayMax==true)return true;if(min.X>=obj.X&&min.X<=obj.X+textWidth){var y1=min.Y+textHeight,y2=min.Y-textHeight;if(y1>=obj.Y-textHeight&&y1<=obj.Y+textHeight||y2>=obj.Y-textHeight&&y2<=obj.Y+textHeight)isOverlayMin=true;}return isOverlayMax||isOverlayMin;};//分割x,y轴坐标信息
2474
- this.SplitXYCoordinate=function(){if(this.XYSplit==false){if(this.XSplit){if(this.XSplitOperator)this.XSplitOperator.Operator();if(this.YSplitOperator&&this.YSplitOperator.CustomCoordinate)this.YSplitOperator.CustomCoordinate();}return;}if(this.YSplitOperator!=null)this.YSplitOperator.Operator();if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.Logarithmic)this.SplitLogarithmicXYCoordinate();};this.SplitLogarithmicXYCoordinate=function(){var up=this.Logarithmic.Up;var down=this.Logarithmic.Down;var logHeight=0;//对数额外高度
2480
+ this.SplitXYCoordinate=function(){if(this.XYSplit==false){if(this.XSplit){if(this.XSplitOperator)this.XSplitOperator.Operator();}if(this.YCustomSplit){//计算自定义刻度
2481
+ if(this.YSplitOperator&&this.YSplitOperator.CustomCoordinate)this.YSplitOperator.CustomCoordinate();}return;}if(this.YSplitOperator!=null)this.YSplitOperator.Operator();if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.Logarithmic)this.SplitLogarithmicXYCoordinate();};this.SplitLogarithmicXYCoordinate=function(){var up=this.Logarithmic.Up;var down=this.Logarithmic.Down;var logHeight=0;//对数额外高度
2475
2482
  var count=0;var maxCount=Math.max(up.length,down.length);var aryLogHeight=[];for(var i=0;i<maxCount;++i){aryLogHeight[i]=i*2;}for(var i=0,j=aryLogHeight.length-1;i<up.length;++i,--j){var item=up[i];item.LogHeight=aryLogHeight[j];logHeight+=item.LogHeight;++count;}for(var i=0,j=aryLogHeight.length-1;i<down.length;++i,--j){var item=down[i];item.LogHeight=aryLogHeight[j];logHeight+=item.LogHeight;++count;}var heightRate=2*GetDevicePixelRatio();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();var height=bottom-top;var perHeight=(height-logHeight*heightRate)/count;if(perHeight<0){perHeight=0;heightRate=height/logHeight;}if(this.CoordinateType==1)//反转坐标
2476
2483
  {var itemTop=top;for(var i=down.length-1;i>=0;--i)//上部
2477
2484
  {var item=down[i];item.Height=perHeight+heightRate*item.LogHeight;item.Top=itemTop;item.Bottom=item.Top+item.Height;itemTop=item.Bottom;}var itemBottom=bottom;for(var i=up.length-1;i>=0;--i)//下部
@@ -2527,7 +2534,8 @@ this.Title=null;this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;this.T
2527
2534
  this.BlankWidth=0;this.Style=0;//0=Y轴在BlankWidth 1=Y轴在左边
2528
2535
  this.YLineExtend=[{Width:2},null];//[0]=左 [1]=右 { Width:5, Color:颜色, }
2529
2536
  this.Buttons=[];this.CloseButton=CloneData(g_JSChartResource.Buttons.CloseOverlayIndex);this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);this.DrawSelectedBorder=null;this.KLineFrame_ReloadResource=this.ReloadResource;this.ReloadResource=function(resource){this.KLineFrame_ReloadResource(resource);if(!resource){this.CloseButton=CloneData(g_JSChartResource.Buttons.CloseOverlayIndex);this.ModifyIndexParamButton=CloneData(g_JSChartResource.Buttons.ModifyIndexParam);this.PenBorder=g_JSChartResource.OverlayFrame.BolderPen;//'rgb(0,0,0)'
2530
- this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;}};this.Draw=function(){this.Buttons=[];if(this.ChartBorder.IsShowTitleOnly)return;this.SplitXYCoordinate();if(this.IsShow){this.DrawVertical();this.DrawHorizontal();this.DrawTitle();}this.SizeChange=false;this.XYSplit=false;this.XSplit=false;};//Y轴刻度线 x坐标
2537
+ this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;}};this.Draw=function(){this.Buttons=[];if(this.ChartBorder.IsShowTitleOnly)return;this.SplitXYCoordinate();if(this.IsShow){this.DrawVertical();this.DrawHorizontal();this.DrawTitle();}this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2538
+ };//Y轴刻度线 x坐标
2531
2539
  this.GetXHorizontal=function(){var border=this.ChartBorder.GetBorder();var x=border.Right;x+=this.RightOffset;if(this.Style==1){}else{x+=this.BlankWidth;}return x;};this.GetHorizontalWidth=function(){var width=null;if(this.YRightTextInfo&&IFrameSplitOperator.IsNumber(this.TextWidthIndex))width=this.YRightTextInfo.AryOverlayWidth[this.TextWidthIndex];return width;};this.DrawTitle=function()//画标题
2532
2540
  {if(!this.IsShowTitle)return;if(!this.Title)return;var border=this.ChartBorder.GetBorder();var top=this.ChartBorder.GetTopTitle();var bottom=border.Bottom;var xText=this.GetXHorizontal();var leftLine=null,rightLine=null;if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){rightLine=this.YLineExtend[1];leftLine=this.YLineExtend[0];}if(this.Style==1){this.Canvas.textBaseline="bottom";if(rightLine&&rightLine.Width>0)xText+=rightLine.Width+1;else xText+=1;}else{this.Canvas.textBaseline="top";if(leftLine&&leftLine.Width>0)xText-=leftLine.Width;else xText-=2;}var yText=top+(bottom-top)/2;this.Canvas.fillStyle=this.TitleColor;this.Canvas.font=this.TitleFont;this.Canvas.textAlign="center";this.Canvas.save();this.Canvas.translate(xText,yText);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(this.Title,0,0);this.Canvas.restore();};this.GetScaleTextWidth=function(){if(!this.IsShow)return null;var border=this.ChartBorder.GetBorder();var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
2533
2541
  if(this.IsHScreen){var borderBottom=this.ChartBorder.Bottom;var isDrawRight=borderBottom>10*pixelTatio&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}else{var borderRight=this.ChartBorder.Right;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}if(!isDrawRight)return null;var width={Left:null,Right:0};for(var i=0;i<this.HorizontalInfo.length;++i){var textWidth=null;var item=this.HorizontalInfo[i];if(!item)continue;if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;textWidth=this.Canvas.measureText(item.Message[1]).width;if(this.YTextPadding&&IFrameSplitOperator.IsNumber(this.YTextPadding[1]))textWidth+=this.YTextPadding[1];if(width.Right<textWidth)width.Right=textWidth;}}if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){var line=this.YLineExtend[1];if(line&&line.Width>0)width.Right+=line.Width;}return{TextWidth:width};};//同步主图坐标
@@ -2705,7 +2713,8 @@ this.IsShareY=false;//使用和主框架公用Y轴
2705
2713
  this.IsCalculateYMaxMin=true;//是否计算Y最大最小值
2706
2714
  this.RightOffset=50;this.PenBorder=g_JSChartResource.OverlayFrame.BolderPen;//'rgb(0,0,0)'
2707
2715
  this.IsShow=true;//坐标是否显示
2708
- this.Title=null;this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){this.DrawVertical();this.DrawHorizontal();this.DrawTitle();}this.SizeChange=false;this.XYSplit=false;};this.DrawTitle=function()//画标题
2716
+ this.Title=null;this.TitleColor=g_JSChartResource.OverlayFrame.TitleColor;this.TitleFont=g_JSChartResource.OverlayFrame.TitleFont;this.Draw=function(){this.SplitXYCoordinate();if(this.IsShow){this.DrawVertical();this.DrawHorizontal();this.DrawTitle();}this.SizeChange=false;this.XYSplit=false;this.XSplit=false;this.YCustomSplit=false;//自定义Y轴分割线
2717
+ };this.DrawTitle=function()//画标题
2709
2718
  {}/*
2710
2719
  if (!this.Title) return;
2711
2720
  var top = this.ChartBorder.GetTopTitle();
@@ -5098,7 +5107,7 @@ this.Custom;this.RightTextFormat=0;//右边刻度显示模式 0=百分比 1=价
5098
5107
  this.BeforeOpenData;this.IsBeforeData=false;this.AfterCloseData;this.IsAfterData=false;this.MultiDayBeforeOpenData;this.MultiDayAfterCloseData;this.DayOffset;this.AverageData;//均线
5099
5108
  this.DayCount=1;this.GlobalOption;this.HQChart;this.IsEnableDragY=function(){return false;};this.Operator=function(){this.Frame.HorizontalInfo=[];this.Frame.CustomHorizontalInfo=[];if(!this.Data)return;var range=this.GetMaxMin();if(this.Symbol&&MARKET_SUFFIX_NAME.IsUSA(this.Symbol.toUpperCase())){this.USASplit(range);}else if(this.SplitType==2){this.USASplit(range);}else{this.DefaultSplit(range);}this.CustomCoordinate();this.ReservedHeight({Max:this.Frame.HorizontalMax,Min:this.Frame.HorizontalMin});//预留高度
5100
5109
  if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE);if(event&&event.Callback){var data={ID:this.Frame.Identify,Frame:this.Frame};event.Callback(event,data,this);}}};this.CustomCoordinate=function()//自定义刻度
5101
- {var data=this.InvokeCustomYCoordinateCallback();if(data&&data.PreventDefault==true)return;if(!this.Custom)return;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);for(var i in this.Custom){var item=this.Custom[i];if(item.Type==1)this.CustomFixedCoordinate(item);else if(item.Type==0){var latestItem=this.GetLatestPrice(defaultfloatPrecision,item);if(latestItem)this.Frame.CustomHorizontalInfo.push(latestItem);}}};this.GetLatestPrice=function(floatPrecision,option){if(!this.Data||!this.Data.Data)return null;if(this.Data.Data.length<=0)return null;var price=this.Data.Data[this.Data.Data.length-1];if(!IFrameSplitOperator.IsNumber(price)||!IFrameSplitOperator.IsNumber(this.YClose))return null;var info=new CoordinateInfo();info.Type=0;info.Value=price;info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;info.LineType=2;//虚线
5110
+ {this.Frame.CustomHorizontalInfo=[];var data=this.InvokeCustomYCoordinateCallback();if(data&&data.PreventDefault==true)return;if(!this.Custom)return;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);for(var i in this.Custom){var item=this.Custom[i];if(item.Type==1)this.CustomFixedCoordinate(item);else if(item.Type==0){var latestItem=this.GetLatestPrice(defaultfloatPrecision,item);if(latestItem)this.Frame.CustomHorizontalInfo.push(latestItem);}}};this.GetLatestPrice=function(floatPrecision,option){if(!this.Data||!this.Data.Data)return null;if(this.Data.Data.length<=0)return null;var price=this.Data.Data[this.Data.Data.length-1];if(!IFrameSplitOperator.IsNumber(price)||!IFrameSplitOperator.IsNumber(this.YClose))return null;var info=new CoordinateInfo();info.Type=0;info.Value=price;info.TextColor=g_JSChartResource.FrameLatestPrice.TextColor;info.LineType=2;//虚线
5102
5111
  var strPrice=price.toFixed(floatPrecision);if(option.DateTime=='HH:MM'){var latestItem=this.Frame.Data.Data[this.Frame.Data.Data.length-1];var strTime=IFrameSplitOperator.FormatTimeString(latestItem.Time,option.DateTime);var aryText=[{Text:strPrice},{Text:strTime}];if(option.Position=='left')info.Message[0]=aryText;else info.Message[1]=aryText;}else{if(option.Position=='left')info.Message[0]=strPrice;else info.Message[1]=strPrice;}if(price>this.YClose)info.LineColor=g_JSChartResource.FrameLatestPrice.UpBarColor;else if(price<this.YClose)info.LineColor=g_JSChartResource.FrameLatestPrice.DownBarColor;else info.LineColor=g_JSChartResource.FrameLatestPrice.UnchagneBarColor;if(IFrameSplitOperator.IsNumber(option.LineType))info.LineType=option.LineType;if(IFrameSplitOperator.IsPlusNumber(option.LineWidth))info.LineWidth=option.LineWidth;if(option.LineDash)info.LineDash=option.LineDash;if(option.IsShowLine==false)info.LineType=-1;if(option.PositionEx===1)info.ExtendData={Custom:{Position:1}};//强制画在内部
5103
5112
  return info;};this.CustomFixedCoordinate=function(option)//固定坐标刻度
5104
5113
  {var defaultfloatPrecision=GetfloatPrecision(this.Symbol);for(var i=0;i<option.Data.length;++i){var item=option.Data[i];var info=new CoordinateInfo();info.Type=1;info.TextColor=item.TextColor;info.LineColor=item.Color;info.LineType=2;//虚线
@@ -5868,7 +5877,7 @@ var sColorChange=[];for(var i=1;i<7;i+=2){sColorChange.push(parseInt("0x"+color.
5868
5877
  {Name:"涂鸦线段",ClassName:'ChartDrawGraffitiLine',Create:function Create(){return new ChartDrawGraffitiLine();}},{Name:"固定范围成交量分布图",ClassName:"ChartDrawVolProfile",Create:function Create(){return new ChartDrawVolProfile();}},{Name:"DisjointChannel",ClassName:"ChartDrawDisjontChannel",Create:function Create(){return new ChartDrawDisjontChannel();}},{Name:"FlatTop",ClassName:"ChartDrawFlatTop",Create:function Create(){return new ChartDrawFlatTop();}},{Name:"水平线2",ClassName:"ChartDrawHLine",Create:function Create(){return new ChartDrawHLine();}},{Name:"MonitorLine",ClassName:"ChartDrawMonitorLine",Create:function Create(){return new ChartDrawMonitorLine();}},//trading view样式
5869
5878
  {Name:"Note",ClassName:"ChartDrawNote",Create:function Create(){return new ChartDrawNote();}},{Name:"AnchoredText",ClassName:"ChartDrawAnchoredText",Create:function Create(){return new ChartDrawAnchoredText();}},{Name:"PriceLabel",ClassName:"ChartDrawPriceLabel",Create:function Create(){return new ChartDrawPriceLabel();}},{Name:"PriceNote",ClassName:"ChartDrawPriceNote",Create:function Create(){return new ChartDrawPriceNote();}},{Name:"FibWedge",ClassName:"ChartDrawFibWedge",Create:function Create(){return new ChartDrawFibWedge();}},{Name:"FibRetracement",ClassName:"ChartFibRetracement",Create:function Create(){return new ChartFibRetracement();}},//斐波那契回测
5870
5879
  {Name:"FibSpeedResistanceFan",ClassName:"ChartFibSpeedResistanceFan",Create:function Create(){return new ChartFibSpeedResistanceFan();}},//斐波那契扇形
5871
- {Name:"PriceRange",ClassName:"ChartPriceRange",Create:function Create(){return new ChartPriceRange();}},{Name:"DateRange",ClassName:"ChartDateRange",Create:function Create(){return new ChartDateRange();}},{Name:"InfoLine",ClassName:"ChartInfoLine",Create:function Create(){return new ChartInfoLine();}},{Name:"TrendAngle",ClassName:"ChartTrendAngle",Create:function Create(){return new ChartTrendAngle();}},{Name:"ArrowMarker",ClassName:"ChartArrowMarker",Create:function Create(){return new ChartArrowMarker();}}];IChartDrawPicture.MapIonFont=new _map2.default([["icon-arrow_up",{Text:'\uE683',Color:'#318757',Family:"iconfont"}],["icon-arrow_down",{Text:'\uE681',Color:'#db563e',Family:"iconfont"}],["icon-arrow_right",{Text:'\uE682',Color:'#318757',Family:"iconfont"}],["icon-arrow_left",{Text:'\uE680',Color:'#318757',Family:"iconfont"}]]);IChartDrawPicture.GetDrawPictureByName=function(value){for(var i in IChartDrawPicture.ArrayDrawPricture){var item=IChartDrawPicture.ArrayDrawPricture[i];if(item.Name==value)return item;}return null;};IChartDrawPicture.GetDrawPictureByClassName=function(value){for(var i in IChartDrawPicture.ArrayDrawPricture){var item=IChartDrawPicture.ArrayDrawPricture[i];if(item.ClassName==value)return item;}return null;};//注册一个新的画图工具 {Name:中文名字, ClassName:类名, Create:function()}
5880
+ {Name:"PriceRange",ClassName:"ChartPriceRange",Create:function Create(){return new ChartPriceRange();}},{Name:"DateRange",ClassName:"ChartDateRange",Create:function Create(){return new ChartDateRange();}},{Name:"DatePriceRange",ClassName:"ChartDatePriceRange",Create:function Create(){return new ChartDatePriceRange();}},{Name:"InfoLine",ClassName:"ChartInfoLine",Create:function Create(){return new ChartInfoLine();}},{Name:"TrendAngle",ClassName:"ChartTrendAngle",Create:function Create(){return new ChartTrendAngle();}},{Name:"ArrowMarker",ClassName:"ChartArrowMarker",Create:function Create(){return new ChartArrowMarker();}}];IChartDrawPicture.MapIonFont=new _map2.default([["icon-arrow_up",{Text:'\uE683',Color:'#318757',Family:"iconfont"}],["icon-arrow_down",{Text:'\uE681',Color:'#db563e',Family:"iconfont"}],["icon-arrow_right",{Text:'\uE682',Color:'#318757',Family:"iconfont"}],["icon-arrow_left",{Text:'\uE680',Color:'#318757',Family:"iconfont"}]]);IChartDrawPicture.GetDrawPictureByName=function(value){for(var i in IChartDrawPicture.ArrayDrawPricture){var item=IChartDrawPicture.ArrayDrawPricture[i];if(item.Name==value)return item;}return null;};IChartDrawPicture.GetDrawPictureByClassName=function(value){for(var i in IChartDrawPicture.ArrayDrawPricture){var item=IChartDrawPicture.ArrayDrawPricture[i];if(item.ClassName==value)return item;}return null;};//注册一个新的画图工具 {Name:中文名字, ClassName:类名, Create:function()}
5872
5881
  IChartDrawPicture.RegisterDrawPicture=function(obj){if(!obj.Name||!obj.ClassName||!obj.Create)return false;var item={Name:obj.Name,ClassName:obj.ClassName,Create:obj.Create};IChartDrawPicture.ArrayDrawPricture.push(item);JSConsole.Chart.Log('[IChartDrawPicture.RegisterDrawPicture] registered new draw picture class. item=',item);return true;};//注册一个新图标 {Name:, Text: , Color:, Family:}
5873
5882
  IChartDrawPicture.RegisterIonFont=function(obj){if(!obj.Name||!obj.Text||!obj.Family)return false;var isOverwirte=IChartDrawPicture.MapIonFont.has(obj.Name);IChartDrawPicture.MapIonFont.set(obj.Name,obj);JSConsole.Chart.Log('[IChartDrawPicture.RegisterIonFont] registered new icon font, obj=, isOverwirte=',obj,isOverwirte);return true;};IChartDrawPicture.CreateChartDrawPicture=function(obj)//创建画图工具
5874
5883
  {var item=IChartDrawPicture.GetDrawPictureByClassName(obj.ClassName);if(!item)return null;var chartDraw=item.Create();//TODO:后面都放到每一个SetOptin里面
@@ -5923,11 +5932,11 @@ var angle=Math.atan2(ptStart.Y-ptEnd.Y,ptStart.X-ptEnd.X)*180/Math.PI,angle1=(an
5923
5932
  }
5924
5933
  */var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);this.DrawPoint([drawPoint[0]]);//画点
5925
5934
  this.Canvas.restore();};}function ChartArrowMarker(){this.newMethod=IChartDrawPicture;//派生
5926
- this.newMethod();delete this.newMethod;this.ClassName='ChartArrowMarker';this.IsPointIn=this.IsPointIn_XYValue_Line;this.InsideAngle=25;this.InsideWidth=70;this.OutAngle=35;this.OutWidth=100;this.GetXYCoordinate=this.GetXYCoordinate_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.Super_SetOption=this.SetOption;//父类函数
5935
+ this.newMethod();delete this.newMethod;this.ClassName='ChartArrowMarker';this.IsPointIn=this.IsPointIn_XYValue_Line;this.InsideLineConfig={Angle:25,MaxWidth:70,WidthRate:0.3};this.InsideWidth=70;this.OutLineConfig={Angle:35,MaxWidth:100,WidthRate:0.4};this.OutWidth=100;this.GetXYCoordinate=this.GetXYCoordinate_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.Super_SetOption=this.SetOption;//父类函数
5927
5936
  this.SetOption=function(option){this.Super_SetOption(option);if(option.AreaColor)this.AreaColor=option.AreaColor;else this.AreaColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.6);};this.CalculatePoint=function(angle,ptStart,ptEnd,lineWidth){var theta=angle;//三角斜边一直线夹角
5928
5937
  var headlen=lineWidth;//三角斜边长度
5929
- var angle=Math.atan2(ptStart.Y-ptEnd.Y,ptStart.X-ptEnd.X)*180/Math.PI,angle1=(angle+theta)*Math.PI/180,angle2=(angle-theta)*Math.PI/180,topX=headlen*Math.cos(angle1),topY=headlen*Math.sin(angle1),botX=headlen*Math.cos(angle2),botY=headlen*Math.sin(angle2);return{Top:{X:topX+ptEnd.X,Y:topY+ptEnd.Y},Bottom:{X:botX+ptEnd.X,Y:botY+ptEnd.Y}};};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:true,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=2)return;this.ClipFrame();var ptStart=drawPoint[0];var ptEnd=drawPoint[1];//计算箭头 的两条边线坐标
5930
- var outArrow=this.CalculatePoint(this.OutAngle,ptStart,ptEnd,this.OutWidth);var insideArrow=this.CalculatePoint(this.InsideAngle,ptStart,ptEnd,this.InsideWidth);this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(insideArrow.Top.X,insideArrow.Top.Y);this.Canvas.lineTo(outArrow.Top.X,outArrow.Top.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.lineTo(outArrow.Bottom.X,outArrow.Bottom.Y);this.Canvas.lineTo(insideArrow.Bottom.X,insideArrow.Bottom.Y);this.Canvas.lineTo(ptStart.X,ptStart.Y);this.Canvas.strokeStyle=this.LineColor;this.Canvas.stroke();this.Canvas.closePath();this.Canvas.fillStyle=this.AreaColor;this.Canvas.fill();/*
5938
+ var angle=Math.atan2(ptStart.Y-ptEnd.Y,ptStart.X-ptEnd.X)*180/Math.PI,angle1=(angle+theta)*Math.PI/180,angle2=(angle-theta)*Math.PI/180,topX=headlen*Math.cos(angle1),topY=headlen*Math.sin(angle1),botX=headlen*Math.cos(angle2),botY=headlen*Math.sin(angle2);return{Top:{X:topX+ptEnd.X,Y:topY+ptEnd.Y},Bottom:{X:botX+ptEnd.X,Y:botY+ptEnd.Y}};};this.CalculateLineWidth=function(ptStart,ptEnd){var a=ptStart.X-ptEnd.X;var b=ptStart.Y-ptEnd.Y;var c=Math.sqrt(a*a+b*b);this.InsideWidth=c*this.InsideLineConfig.WidthRate;this.OutWidth=c*this.OutLineConfig.WidthRate;if(this.InsideWidth>this.InsideLineConfig.MaxWidth)this.InsideWidth=this.InsideLineConfig.MaxWidth;if(this.OutWidth>this.OutLineConfig.MaxWidth)this.OutWidth=this.OutLineConfig.MaxWidth;};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:true,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=2)return;this.ClipFrame();var ptStart=drawPoint[0];var ptEnd=drawPoint[1];this.CalculateLineWidth(ptStart,ptEnd);//计算箭头 的两条边线坐标
5939
+ var outArrow=this.CalculatePoint(this.OutLineConfig.Angle,ptStart,ptEnd,this.OutWidth);var insideArrow=this.CalculatePoint(this.InsideLineConfig.Angle,ptStart,ptEnd,this.InsideWidth);this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(insideArrow.Top.X,insideArrow.Top.Y);this.Canvas.lineTo(outArrow.Top.X,outArrow.Top.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.lineTo(outArrow.Bottom.X,outArrow.Bottom.Y);this.Canvas.lineTo(insideArrow.Bottom.X,insideArrow.Bottom.Y);this.Canvas.lineTo(ptStart.X,ptStart.Y);this.Canvas.strokeStyle=this.LineColor;this.Canvas.stroke();this.Canvas.closePath();this.Canvas.fillStyle=this.AreaColor;this.Canvas.fill();/*
5931
5940
  if (this.IsSelected)
5932
5941
  {
5933
5942
  this.Canvas.strokeStyle='rgba(255,0,0,0.5)';
@@ -6400,7 +6409,11 @@ var startValue=this.Frame.GetYData(ptStart.Y,false);var endValue=this.Frame.GetY
6400
6409
  this.newMethod();delete this.newMethod;this.ClassName='ChartDateRange';this.PointCount=2;this.Font=12*GetDevicePixelRatio()+"px 微软雅黑";this.TextColor=this.LineColor;this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.PointToValue_Default=this.PointToValue;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.LineWidth=1;this.EnableBGColor=true;this.BGColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.15);this.ExtendLine={Top:false,Bottom:false};//延长线
6401
6410
  this.Label={TextColor:"rgb(0,0,0)",BGColor:"rgb(211,211,211)",EnableBGColor:true,LeftMargin:5,RightMargin:5};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var bCheckXY=true;var drawPoint=this.CalculateDrawPoint({IsCheckX:bCheckXY,IsCheckY:bCheckXY});if(!drawPoint)return;if(drawPoint.length!=2)return;this.ClipFrame();var ptStart=drawPoint[0];var ptEnd=drawPoint[1];this.SetLineWidth();this.DrawRange(ptStart,ptEnd);this.RestoreLineWidth();this.DrawPoint(drawPoint);//画点
6402
6411
  this.Canvas.restore();};this.DrawRange=function(ptStart,ptEnd){var yTop=Math.min(ptStart.Y,ptEnd.Y);var yBottom=Math.max(ptStart.Y,ptEnd.Y);var xLeft=Math.min(ptStart.X,ptEnd.X);var xRight=Math.max(ptStart.X,ptEnd.X);var height=yBottom-yTop;var width=xRight-xLeft;var yCenter=ptStart.Y+(ptEnd.Y-ptStart.Y)/2;var xCenter=ptStart.X+(ptEnd.X-ptStart.X)/2;if(this.ExtendLine.Top)yTop=this.Frame.ChartBorder.GetTopEx();if(this.ExtendLine.Bottom)yBottom=this.Frame.ChartBorder.GetBottomEx();if(this.EnableBGColor){var rtBG={Left:xLeft,Top:yTop,Right:xRight,Bottom:yBottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(xLeft),yTop);this.Canvas.lineTo(ToFixedPoint(xLeft),yBottom);this.Canvas.moveTo(ToFixedPoint(xRight),yTop);this.Canvas.lineTo(ToFixedPoint(xRight),yBottom);this.Canvas.moveTo(ToFixedPoint(xLeft),ToFixedPoint(yCenter));this.Canvas.lineTo(ToFixedPoint(xRight),ToFixedPoint(yCenter));this.Canvas.stroke();this.LinePoint.push({Start:{X:xLeft,Y:yTop},End:{X:xLeft,Y:yBottom}});this.LinePoint.push({Start:{X:xRight,Y:yTop},End:{X:xRight,Y:yBottom}});this.LinePoint.push({Start:{X:xLeft,Y:yCenter},End:{X:xRight,Y:yCenter}});this.DrawArrow({X:ptStart.X,Y:ToFixedPoint(yCenter)},{X:ptEnd.X,Y:ToFixedPoint(yCenter)});//文字输出
6403
- var bottom=this.Frame.ChartBorder.GetBottomEx();var startIndex=this.Frame.GetXData(ptStart.X,false);var endIndex=this.Frame.GetXData(ptEnd.X,false);var barCount=endIndex-startIndex+1;var text=barCount+' bars';this.Canvas.font=this.Font;var textHeight=this.GetFontHeight();var textWidth=this.Canvas.measureText(text).width+4+(this.Label.LeftMargin+this.Label.RightMargin);var rtTextBG={Left:xCenter-textWidth/2,Top:ptEnd.Y+4,Width:textWidth,Height:textHeight+2};rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;if(rtTextBG.Bottom>=bottom){rtTextBG.Bottom=bottom;rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;}if(this.Label.EnableBGColor){var path=new Path2D();path.roundRect(ToFixedPoint(rtTextBG.Left),ToFixedPoint(rtTextBG.Top),ToFixedRect(rtTextBG.Width),ToFixedRect(rtTextBG.Height),[3]);this.Canvas.fillStyle=this.Label.BGColor;this.Canvas.fill(path);}this.Canvas.fillStyle=this.Label.TextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,rtTextBG.Bottom-2);};}//线段信息统计
6412
+ var bottom=this.Frame.ChartBorder.GetBottomEx();var top=this.Frame.ChartBorder.GetTopEx();var startIndex=this.Frame.GetXData(ptStart.X,false);var endIndex=this.Frame.GetXData(ptEnd.X,false);var startValue=this.Frame.GetYData(ptStart.Y,false);var endValue=this.Frame.GetYData(ptEnd.Y,false);var diffValue=endValue-startValue;var barCount=endIndex-startIndex+1;var text=barCount+' bars';this.Canvas.font=this.Font;var textHeight=this.GetFontHeight();var textWidth=this.Canvas.measureText(text).width+4+(this.Label.LeftMargin+this.Label.RightMargin);var rtTextBG={Left:xCenter-textWidth/2,Top:ptEnd.Y+4,Width:textWidth,Height:textHeight+2};if(diffValue>0)rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;else rtTextBG.Top=ptEnd.Y+4;rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;if(diffValue>0){if(rtTextBG.Top<=top){rtTextBG.Top=top;rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;}}else{if(rtTextBG.Bottom>=bottom){rtTextBG.Bottom=bottom;rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;}}if(this.Label.EnableBGColor){var path=new Path2D();path.roundRect(ToFixedPoint(rtTextBG.Left),ToFixedPoint(rtTextBG.Top),ToFixedRect(rtTextBG.Width),ToFixedRect(rtTextBG.Height),[3]);this.Canvas.fillStyle=this.Label.BGColor;this.Canvas.fill(path);}this.Canvas.fillStyle=this.Label.TextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,rtTextBG.Bottom-2);};}function ChartDatePriceRange(){this.newMethod=IChartDrawPicture;//派生
6413
+ this.newMethod();delete this.newMethod;this.ClassName='ChartDatePriceRange';this.PointCount=2;this.Font=12*GetDevicePixelRatio()+"px 微软雅黑";this.TextColor=this.LineColor;this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.PointToValue_Default=this.PointToValue;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.LineWidth=1;this.EnableBGColor=true;this.BGColor=IChartDrawPicture.ColorToRGBA(this.LineColor,0.15);this.ExtendLine={Top:false,Bottom:false};//延长线
6414
+ this.Label={TextColor:"rgb(0,0,0)",BGColor:"rgb(211,211,211)",EnableBGColor:true,LeftMargin:5,RightMargin:5};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var bCheckXY=true;var drawPoint=this.CalculateDrawPoint({IsCheckX:bCheckXY,IsCheckY:bCheckXY});if(!drawPoint)return;if(drawPoint.length!=2)return;this.ClipFrame();var ptStart=drawPoint[0];var ptEnd=drawPoint[1];this.SetLineWidth();this.DrawRange(ptStart,ptEnd);this.RestoreLineWidth();this.DrawPoint(drawPoint);//画点
6415
+ this.Canvas.restore();};this.DrawRange=function(ptStart,ptEnd){var yTop=Math.min(ptStart.Y,ptEnd.Y);var yBottom=Math.max(ptStart.Y,ptEnd.Y);var xLeft=Math.min(ptStart.X,ptEnd.X);var xRight=Math.max(ptStart.X,ptEnd.X);var height=yBottom-yTop;var width=xRight-xLeft;var yCenter=ptStart.Y+(ptEnd.Y-ptStart.Y)/2;var xCenter=ptStart.X+(ptEnd.X-ptStart.X)/2;if(this.ExtendLine.Top)yTop=this.Frame.ChartBorder.GetTopEx();if(this.ExtendLine.Bottom)yBottom=this.Frame.ChartBorder.GetBottomEx();if(this.EnableBGColor){var rtBG={Left:xLeft,Top:yTop,Right:xRight,Bottom:yBottom};rtBG.Width=rtBG.Right-rtBG.Left;rtBG.Height=rtBG.Bottom-rtBG.Top;this.Canvas.fillStyle=this.BGColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(xLeft),yTop);this.Canvas.lineTo(ToFixedPoint(xLeft),yBottom);this.Canvas.moveTo(ToFixedPoint(xRight),yTop);this.Canvas.lineTo(ToFixedPoint(xRight),yBottom);this.Canvas.moveTo(ToFixedPoint(xLeft),ToFixedPoint(yCenter));this.Canvas.lineTo(ToFixedPoint(xRight),ToFixedPoint(yCenter));this.Canvas.moveTo(ToFixedPoint(xCenter),ToFixedPoint(yTop));this.Canvas.lineTo(ToFixedPoint(xCenter),ToFixedPoint(yBottom));this.Canvas.stroke();this.LinePoint.push({Start:{X:xLeft,Y:yTop},End:{X:xLeft,Y:yBottom}});this.LinePoint.push({Start:{X:xRight,Y:yTop},End:{X:xRight,Y:yBottom}});this.LinePoint.push({Start:{X:xLeft,Y:yCenter},End:{X:xRight,Y:yCenter}});this.DrawArrow({X:ptStart.X,Y:ToFixedPoint(yCenter)},{X:ptEnd.X,Y:ToFixedPoint(yCenter)});this.DrawArrow({X:ToFixedPoint(xCenter),Y:ptStart.Y},{X:ToFixedPoint(xCenter),Y:ptEnd.Y});//文字输出
6416
+ var bottom=this.Frame.ChartBorder.GetBottomEx();var top=this.Frame.ChartBorder.GetTopEx();var startIndex=this.Frame.GetXData(ptStart.X,false);var endIndex=this.Frame.GetXData(ptEnd.X,false);var barCount=endIndex-startIndex+1;var startValue=this.Frame.GetYData(ptStart.Y,false);var endValue=this.Frame.GetYData(ptEnd.Y,false);var diffValue=endValue-startValue;var rate=diffValue/startValue*100;var aryText=[diffValue.toFixed(2)+' ('+rate.toFixed(2)+'%)',barCount+' bars'];this.Canvas.font=this.Font;var textHeight=this.GetFontHeight();var textWidth=0;for(var i=0;i<aryText.length;++i){var text=aryText[i];var value=this.Canvas.measureText(text).width;if(textWidth<value)textWidth=value;}textWidth+=this.Label.LeftMargin+this.Label.RightMargin;var rtTextBG={Left:xCenter-textWidth/2,Top:ptEnd.Y+4,Width:textWidth,Height:aryText.length*textHeight+2};if(diffValue>0)rtTextBG.Top=ptEnd.Y-rtTextBG.Height-4;else rtTextBG.Top=ptEnd.Y+4;rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;if(diffValue>0){if(rtTextBG.Top<=top){rtTextBG.Top=top;rtTextBG.Bottom=rtTextBG.Top+rtTextBG.Height;}}else{if(rtTextBG.Bottom>=bottom){rtTextBG.Bottom=bottom;rtTextBG.Top=rtTextBG.Bottom-rtTextBG.Height;}}if(this.Label.EnableBGColor){var path=new Path2D();path.roundRect(ToFixedPoint(rtTextBG.Left),ToFixedPoint(rtTextBG.Top),ToFixedRect(rtTextBG.Width),ToFixedRect(rtTextBG.Height),[3]);this.Canvas.fillStyle=this.Label.BGColor;this.Canvas.fill(path);}this.Canvas.fillStyle=this.Label.TextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var yText=rtTextBG.Bottom-2;for(var i=0;i<aryText.length;++i){var text=aryText[i];this.Canvas.fillText(text,rtTextBG.Left+2+this.Label.LeftMargin,yText);yText-=textHeight;}};}//线段信息统计
6404
6417
  function ChartInfoLine(){this.newMethod=IChartDrawPicture;//派生
6405
6418
  this.newMethod();delete this.newMethod;this.ClassName='ChartInfoLine';this.PointCount=2;this.Font=12*GetDevicePixelRatio()+"px 微软雅黑";this.IsPointIn=this.IsPointIn_XYValue_Line;this.GetXYCoordinate=this.GetXYCoordinate_default;this.IsShowYCoordinate=false;this.CopyData=this.CopyData_default;this.OnlyMoveXIndex=true;this.IsSupportMagnet=true;this.LabelConfig={Font:12*GetDevicePixelRatio()+'px \u5FAE\u8F6F\u96C5\u9ED1',BGColor:"rgba(135, 206 ,250,0.95)",Mergin:{Left:10,Right:10,Top:10,Bottom:8},LineSpace:5,//行间距
6406
6419
  TextAlign:1//对齐方式 0=left 1=right
@@ -13357,7 +13370,7 @@ JSPopMenu.SEPARATOR_LINE_NAME="MENU_SEPARATOR";//分割线
13357
13370
  CMD_DELETE_DRAW_CHART_ID:6,CMD_CHANGE_FONT_COLOR_ID:7,//切换字体颜色
13358
13371
  CMD_CHANGE_BG_COLOR_ID:8,//切换背景色
13359
13372
  CMD_CHANGE_BORDER_COLOR_ID:9//边框颜色
13360
- };function JSDialogDrawTool(){this.AryChartGroup=[{Title:"线段",AryChart:[{Title:'线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"线段"}},{Title:'线段信息',ClassName:'hqchart_drawtool icon-infoline',Type:0,Data:{ID:"InfoLine"}},{Title:'射线',ClassName:'hqchart_drawtool icon-draw_rays',Type:0,Data:{ID:"射线"}},{Title:"趋势线角度",ClassName:"hqchart_drawtool icon-qushixianjiaodu",Type:0,Data:{ID:"TrendAngle"}},{Title:'标价线',ClassName:'hqchart_drawtool icon-price_line',Type:0,Data:{ID:"标价线"}},{Title:'垂直线',ClassName:'hqchart_drawtool icon-vertical_line',Type:0,Data:{ID:"垂直线"}},{Title:'十字线',ClassName:'hqchart_drawtool icon-tubiao_shizixian',Type:0,Data:{ID:"十字线"}},{Title:'箭头',ClassName:'hqchart_drawtool icon-bottom-arrow-solid',Type:0,Data:{ID:"箭头"}},{Title:'大箭头',ClassName:'hqchart_drawtool icon-big_arrow',Type:0,Data:{ID:"ArrowMarker"}},{Title:'趋势线',ClassName:'hqchart_drawtool icon-draw_trendline',Type:0,Data:{ID:"趋势线"}},{Title:'水平线',ClassName:'hqchart_drawtool icon-draw_hline',Type:0,Data:{ID:"水平线"}},{Title:'水平射线',ClassName:'hqchart_drawtool icon-tubiao_shuipingshexian',Type:0,Data:{ID:"水平射线"}},{Title:'涂鸦线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"涂鸦线段"}},{Title:'阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线"}},{Title:'通达信阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线2"}},{Title:'江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线"}},{Title:'通达信江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线2"}}]},{Title:"通道",AryChart:[{Title:'平行线',ClassName:'hqchart_drawtool icon-draw_parallel_lines',Type:0,Data:{ID:"平行线"}},{Title:'水平线段',ClassName:'hqchart_drawtool icon-draw_hlinesegment',Type:0,Data:{ID:"水平线段"}},{Title:'平行射线',ClassName:'hqchart_drawtool icon-draw_p_rays_lines',Type:0,Data:{ID:"平行射线"}},{Title:'平行通道',ClassName:'hqchart_drawtool icon-draw_parallelchannel',Type:0,Data:{ID:"平行通道"}},{Title:'价格通道线',ClassName:'hqchart_drawtool icon-draw_pricechannel',Type:0,Data:{ID:"价格通道线"}},{Title:'箱型线',ClassName:'hqchart_drawtool icon-draw_box',Type:0,Data:{ID:"箱型线"}},{Title:"不相交通道",ClassName:"hqchart_drawtool icon-buxiangjiaojiao",Type:0,Data:{ID:"DisjointChannel"}},{Title:"平滑顶/底",ClassName:"hqchart_drawtool icon-tubiao_buxiangjiaotongdao",Type:0,Data:{ID:"FlatTop"}},{Title:"波段线",ClassName:'hqchart_drawtool icon-draw_waveband',Type:0,Data:{ID:"波段线"}},{Title:"百分比线",ClassName:'hqchart_drawtool icon-PercentageLine',Type:0,Data:{ID:"百分比线"}},{Title:"黄金分割",ClassName:'hqchart_drawtool icon-GoldenSection',Type:0,Data:{ID:"黄金分割"}},{Title:"线形回归线",ClassName:'hqchart_drawtool icon-linear_3',Type:0,Data:{ID:"线形回归线"}},{Title:"线形回归带",ClassName:'hqchart_drawtool icon-linear_1',Type:0,Data:{ID:"线形回归带"}},{Title:"延长线形回归带",ClassName:'hqchart_drawtool icon-linear_2',Type:0,Data:{ID:"延长线形回归带"}}]},{Title:"形状",AryChart:[{Title:'圆弧线',ClassName:'hqchart_drawtool icon-draw_arc',Type:0,Data:{ID:"圆弧线"}},{Title:'矩形',ClassName:'hqchart_drawtool icon-rectangle',Type:0,Data:{ID:"矩形"}},{Title:'平行四边形',ClassName:'hqchart_drawtool icon-draw_quadrangle',Type:0,Data:{ID:"平行四边形"}},{Title:'三角形',ClassName:'hqchart_drawtool icon-draw_triangle',Type:0,Data:{ID:"三角形"}},{Title:'圆',ClassName:'hqchart_drawtool icon-draw_circle',Type:0,Data:{ID:"圆"}},{Title:'对称角度',ClassName:'hqchart_drawtool icon-draw_symangle',Type:0,Data:{ID:"对称角度"}}]},{Title:"波浪线",AryChart:[{Title:'M头W底',ClassName:'hqchart_drawtool icon-draw_wavemw',Type:0,Data:{ID:"M头W底"}},{Title:'头肩型',ClassName:'hqchart_drawtool icon-draw_head_shoulders_bt',Type:0,Data:{ID:"头肩型"}},{Title:'波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"波浪尺"}},{Title:'AB波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"AB波浪尺"}}]},{Title:"斐波那契",AryChart:[{Title:'斐波那契周期线',ClassName:'hqchart_drawtool icon-feibonaqizhouqixian',Type:0,Data:{ID:"斐波那契周期线"}},{Title:'斐波那契楔形',ClassName:'hqchart_drawtool icon-feibonaqiqixing',Type:0,Data:{ID:"FibWedge"}},{Title:'斐波那契回撤',ClassName:'hqchart_drawtool icon-feibonaqihuiche',Type:0,Data:{ID:"FibRetracement"}},{Title:'斐波那契速度阻力扇',ClassName:'hqchart_drawtool icon-feibonaqisuduzulishan',Type:0,Data:{ID:"FibSpeedResistanceFan"}}]},{Title:"测量工具",AryChart:[{Title:'价格范围',ClassName:'hqchart_drawtool icon-shijianfanwei',Type:0,Data:{ID:"PriceRange"}},{Title:'时间范围',ClassName:'hqchart_drawtool icon-jiagefanwei',Type:0,Data:{ID:"DateRange"}},{Title:"监测线",ClassName:"hqchart_drawtool icon-jiance",Type:0,Data:{ID:"MonitorLine"}}]},{Title:"文字",AryChart:[{Title:"文字",ClassName:'hqchart_drawtool icon-draw_text',Type:0,Data:{ID:"文本"}},{Title:"锚点文字",ClassName:'hqchart_drawtool icon-maodianwenzi',Type:0,Data:{ID:"AnchoredText"}},{Title:"注释",ClassName:'hqchart_drawtool icon-maodian ',Type:0,Data:{ID:"Note"}},{Title:'价格标签',ClassName:'hqchart_drawtool icon-Tooltip',Type:0,Data:{ID:"PriceLabel"}},{Title:'价格注释',ClassName:'hqchart_drawtool icon-tooltiptext',Type:0,Data:{ID:"PriceNote"}},{Title:'向上箭头',ClassName:'iconfont icon-arrow_up',Type:0,Data:{ID:"icon-arrow_up"}},{Title:'向下箭头',ClassName:'iconfont icon-arrow_down',Type:0,Data:{ID:"icon-arrow_down"}},{Title:'向左箭头',ClassName:'iconfont icon-arrow_left',Type:0,Data:{ID:"icon-arrow_left"}},{Title:'向右箭头',ClassName:'iconfont icon-arrow_right',Type:0,Data:{ID:"icon-arrow_right"}}]}];this.ToolConfig={Title:"工具",AryTool:[{Title:"选中",ClassName:'hqchart_drawtool icon-arrow',Type:1,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID}},{Title:'尺子',ClassName:'hqchart_drawtool icon-ruler',Type:0,Data:{ID:"尺子"}},{Title:"磁铁",ClassName:'hqchart_drawtool icon-xifu',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ENABLE_MAGNET_ID}},{Title:"点击切换颜色",ClassName:'hqchart_drawtool icon-fangkuai',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID}},{Title:"擦除画线",ClassName:'hqchart_drawtool icon-a-xiangpicachuxiangpica',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ERASE_DRAW_CHART_ID}},{Title:"删除所有画线",ClassName:'hqchart_drawtool icon-recycle_bin',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_DRAW_CHART_ID}}]};this.DivDialog=null;this.AryDivChart=[];this.HQChart=null;this.LineColor='rgb(255,140,0)';this.LineColorIndex=0;this.RandomLineColor=["rgb(255,69,0)","rgb(0,191,255)","rgb(255,0,255)","rgb(255,105,180)"];this.LineWidth=1*GetDevicePixelRatio();this.ColumnCount=5;this.DragTitle=null;this.Inital=function(hqchart){this.LineColor=g_JSChartResource.DrawPicture.LineColor[0];this.RandomLineColor.splice(0,0,this.LineColor);this.HQChart=hqchart;};this.Create=function(){var _this77=this;var divDom=document.createElement("div");divDom.className='UMyChart_DrawTool_Dialog_Div';var divTitle=document.createElement("div");divTitle.className='UMyChart_DrawTool_Title_Div';divTitle.innerText="画图工具";divTitle.onmousedown=function(e){_this77.OnMouseDownTitle(e);};var divClose=document.createElement("div");divClose.className='UMyChart_DrawTool_Close_Div';divClose.innerText="x";divClose.onmousedown=function(e){_this77.Close(e);};divTitle.appendChild(divClose);divDom.appendChild(divTitle);var table=document.createElement("table");table.className="UMyChart_DrawTool_Table";divDom.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_DrawTool_Tbody";table.appendChild(tbody);for(var i=0;i<this.AryChartGroup.length;++i){var item=this.AryChartGroup[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.AryChart))continue;this.CreateChartGroupItem(item,tbody);var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_End_Tr';tbody.appendChild(trDom);}//工具栏
13373
+ };function JSDialogDrawTool(){this.AryChartGroup=[{Title:"线段",AryChart:[{Title:'线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"线段"}},{Title:'线段信息',ClassName:'hqchart_drawtool icon-infoline',Type:0,Data:{ID:"InfoLine"}},{Title:'射线',ClassName:'hqchart_drawtool icon-draw_rays',Type:0,Data:{ID:"射线"}},{Title:"趋势线角度",ClassName:"hqchart_drawtool icon-qushixianjiaodu",Type:0,Data:{ID:"TrendAngle"}},{Title:'标价线',ClassName:'hqchart_drawtool icon-price_line',Type:0,Data:{ID:"标价线"}},{Title:'垂直线',ClassName:'hqchart_drawtool icon-vertical_line',Type:0,Data:{ID:"垂直线"}},{Title:'十字线',ClassName:'hqchart_drawtool icon-tubiao_shizixian',Type:0,Data:{ID:"十字线"}},{Title:'箭头',ClassName:'hqchart_drawtool icon-bottom-arrow-solid',Type:0,Data:{ID:"箭头"}},{Title:'大箭头',ClassName:'hqchart_drawtool icon-big_arrow',Type:0,Data:{ID:"ArrowMarker"}},{Title:'趋势线',ClassName:'hqchart_drawtool icon-draw_trendline',Type:0,Data:{ID:"趋势线"}},{Title:'水平线',ClassName:'hqchart_drawtool icon-draw_hline',Type:0,Data:{ID:"水平线"}},{Title:'水平射线',ClassName:'hqchart_drawtool icon-tubiao_shuipingshexian',Type:0,Data:{ID:"水平射线"}},{Title:'涂鸦线段',ClassName:'hqchart_drawtool icon-draw_line',Type:0,Data:{ID:"涂鸦线段"}},{Title:'阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线"}},{Title:'通达信阻速线',ClassName:'hqchart_drawtool icon-draw_resline',Type:0,Data:{ID:"阻速线2"}},{Title:'江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线"}},{Title:'通达信江恩角度线',ClassName:'hqchart_drawtool icon-jiangenjiaoduxian',Type:0,Data:{ID:"江恩角度线2"}}]},{Title:"通道",AryChart:[{Title:'平行线',ClassName:'hqchart_drawtool icon-draw_parallel_lines',Type:0,Data:{ID:"平行线"}},{Title:'水平线段',ClassName:'hqchart_drawtool icon-draw_hlinesegment',Type:0,Data:{ID:"水平线段"}},{Title:'平行射线',ClassName:'hqchart_drawtool icon-draw_p_rays_lines',Type:0,Data:{ID:"平行射线"}},{Title:'平行通道',ClassName:'hqchart_drawtool icon-draw_parallelchannel',Type:0,Data:{ID:"平行通道"}},{Title:'价格通道线',ClassName:'hqchart_drawtool icon-draw_pricechannel',Type:0,Data:{ID:"价格通道线"}},{Title:'箱型线',ClassName:'hqchart_drawtool icon-draw_box',Type:0,Data:{ID:"箱型线"}},{Title:"不相交通道",ClassName:"hqchart_drawtool icon-buxiangjiaojiao",Type:0,Data:{ID:"DisjointChannel"}},{Title:"平滑顶/底",ClassName:"hqchart_drawtool icon-tubiao_buxiangjiaotongdao",Type:0,Data:{ID:"FlatTop"}},{Title:"波段线",ClassName:'hqchart_drawtool icon-draw_waveband',Type:0,Data:{ID:"波段线"}},{Title:"百分比线",ClassName:'hqchart_drawtool icon-PercentageLine',Type:0,Data:{ID:"百分比线"}},{Title:"黄金分割",ClassName:'hqchart_drawtool icon-GoldenSection',Type:0,Data:{ID:"黄金分割"}},{Title:"线形回归线",ClassName:'hqchart_drawtool icon-linear_3',Type:0,Data:{ID:"线形回归线"}},{Title:"线形回归带",ClassName:'hqchart_drawtool icon-linear_1',Type:0,Data:{ID:"线形回归带"}},{Title:"延长线形回归带",ClassName:'hqchart_drawtool icon-linear_2',Type:0,Data:{ID:"延长线形回归带"}}]},{Title:"形状",AryChart:[{Title:'圆弧线',ClassName:'hqchart_drawtool icon-draw_arc',Type:0,Data:{ID:"圆弧线"}},{Title:'矩形',ClassName:'hqchart_drawtool icon-rectangle',Type:0,Data:{ID:"矩形"}},{Title:'平行四边形',ClassName:'hqchart_drawtool icon-draw_quadrangle',Type:0,Data:{ID:"平行四边形"}},{Title:'三角形',ClassName:'hqchart_drawtool icon-draw_triangle',Type:0,Data:{ID:"三角形"}},{Title:'圆',ClassName:'hqchart_drawtool icon-draw_circle',Type:0,Data:{ID:"圆"}},{Title:'对称角度',ClassName:'hqchart_drawtool icon-draw_symangle',Type:0,Data:{ID:"对称角度"}}]},{Title:"波浪线",AryChart:[{Title:'M头W底',ClassName:'hqchart_drawtool icon-draw_wavemw',Type:0,Data:{ID:"M头W底"}},{Title:'头肩型',ClassName:'hqchart_drawtool icon-draw_head_shoulders_bt',Type:0,Data:{ID:"头肩型"}},{Title:'波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"波浪尺"}},{Title:'AB波浪尺',ClassName:'hqchart_drawtool icon-waveruler',Type:0,Data:{ID:"AB波浪尺"}}]},{Title:"斐波那契",AryChart:[{Title:'斐波那契周期线',ClassName:'hqchart_drawtool icon-feibonaqizhouqixian',Type:0,Data:{ID:"斐波那契周期线"}},{Title:'斐波那契楔形',ClassName:'hqchart_drawtool icon-feibonaqiqixing',Type:0,Data:{ID:"FibWedge"}},{Title:'斐波那契回撤',ClassName:'hqchart_drawtool icon-feibonaqihuiche',Type:0,Data:{ID:"FibRetracement"}},{Title:'斐波那契速度阻力扇',ClassName:'hqchart_drawtool icon-feibonaqisuduzulishan',Type:0,Data:{ID:"FibSpeedResistanceFan"}}]},{Title:"测量工具",AryChart:[{Title:'价格范围',ClassName:'hqchart_drawtool icon-shijianfanwei',Type:0,Data:{ID:"PriceRange"}},{Title:'时间范围',ClassName:'hqchart_drawtool icon-jiagefanwei',Type:0,Data:{ID:"DateRange"}},{Title:"价格和时间范围",ClassName:"hqchart_drawtool icon-jiagefanwei",Type:0,Data:{ID:"DatePriceRange"}},{Title:"监测线",ClassName:"hqchart_drawtool icon-jiance",Type:0,Data:{ID:"MonitorLine"}}]},{Title:"文字",AryChart:[{Title:"文字",ClassName:'hqchart_drawtool icon-draw_text',Type:0,Data:{ID:"文本"}},{Title:"锚点文字",ClassName:'hqchart_drawtool icon-maodianwenzi',Type:0,Data:{ID:"AnchoredText"}},{Title:"注释",ClassName:'hqchart_drawtool icon-maodian ',Type:0,Data:{ID:"Note"}},{Title:'价格标签',ClassName:'hqchart_drawtool icon-Tooltip',Type:0,Data:{ID:"PriceLabel"}},{Title:'价格注释',ClassName:'hqchart_drawtool icon-tooltiptext',Type:0,Data:{ID:"PriceNote"}},{Title:'向上箭头',ClassName:'iconfont icon-arrow_up',Type:0,Data:{ID:"icon-arrow_up"}},{Title:'向下箭头',ClassName:'iconfont icon-arrow_down',Type:0,Data:{ID:"icon-arrow_down"}},{Title:'向左箭头',ClassName:'iconfont icon-arrow_left',Type:0,Data:{ID:"icon-arrow_left"}},{Title:'向右箭头',ClassName:'iconfont icon-arrow_right',Type:0,Data:{ID:"icon-arrow_right"}}]}];this.ToolConfig={Title:"工具",AryTool:[{Title:"选中",ClassName:'hqchart_drawtool icon-arrow',Type:1,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID}},{Title:'尺子',ClassName:'hqchart_drawtool icon-ruler',Type:0,Data:{ID:"尺子"}},{Title:"磁铁",ClassName:'hqchart_drawtool icon-xifu',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ENABLE_MAGNET_ID}},{Title:"点击切换颜色",ClassName:'hqchart_drawtool icon-fangkuai',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID}},{Title:"擦除画线",ClassName:'hqchart_drawtool icon-a-xiangpicachuxiangpica',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_ERASE_DRAW_CHART_ID}},{Title:"删除所有画线",ClassName:'hqchart_drawtool icon-recycle_bin',Type:2,Data:{ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_DRAW_CHART_ID}}]};this.DivDialog=null;this.AryDivChart=[];this.HQChart=null;this.LineColor='rgb(255,140,0)';this.LineColorIndex=0;this.RandomLineColor=["rgb(255,69,0)","rgb(0,191,255)","rgb(255,0,255)","rgb(255,105,180)"];this.LineWidth=1*GetDevicePixelRatio();this.ColumnCount=5;this.DragTitle=null;this.Inital=function(hqchart){this.LineColor=g_JSChartResource.DrawPicture.LineColor[0];this.RandomLineColor.splice(0,0,this.LineColor);this.HQChart=hqchart;};this.Create=function(){var _this77=this;var divDom=document.createElement("div");divDom.className='UMyChart_DrawTool_Dialog_Div';var divTitle=document.createElement("div");divTitle.className='UMyChart_DrawTool_Title_Div';divTitle.innerText="画图工具";divTitle.onmousedown=function(e){_this77.OnMouseDownTitle(e);};var divClose=document.createElement("div");divClose.className='UMyChart_DrawTool_Close_Div';divClose.innerText="x";divClose.onmousedown=function(e){_this77.Close(e);};divTitle.appendChild(divClose);divDom.appendChild(divTitle);var table=document.createElement("table");table.className="UMyChart_DrawTool_Table";divDom.appendChild(table);var tbody=document.createElement("tbody");tbody.className="UMyChart_DrawTool_Tbody";table.appendChild(tbody);for(var i=0;i<this.AryChartGroup.length;++i){var item=this.AryChartGroup[i];if(!IFrameSplitOperator.IsNonEmptyArray(item.AryChart))continue;this.CreateChartGroupItem(item,tbody);var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_End_Tr';tbody.appendChild(trDom);}//工具栏
13361
13374
  this.CreateToolGroup(tbody);this.DivDialog=divDom;document.body.appendChild(divDom);};this.Destroy=function(){this.AryDivChart=[];document.body.remove(this.DivDialog);this.DivDialog=null;};this.CreateChartGroupItem=function(groupItem,tbody){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_Tr';tbody.appendChild(trDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Group_Td";tdDom.innerText=groupItem.Title;tdDom.colSpan=this.ColumnCount;trDom.appendChild(tdDom);var chartCount=groupItem.AryChart.length;for(var i=0,j=0;i<chartCount;){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Tr';for(j=0;j<this.ColumnCount&&i<chartCount;++j,++i){var item=groupItem.AryChart[i];this.CreateChartItem(item,trDom);}tbody.appendChild(trDom);}};this.CreateChartItem=function(item,trDom){var _this78=this;var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Td";tdDom.title=item.Title;trDom.appendChild(tdDom);var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.classList.add("UMyChart_DrawTool_Span");tdDom.appendChild(spanDom);var data={Item:item,TD:tdDom,Span:spanDom};tdDom.onmousedown=function(e){_this78.OnClickItem(e,data);};//点击
13362
13375
  this.AryDivChart.push(data);};this.OnClickItem=function(e,data){console.log('[JSDialogDrawTool::OnClickChartItem] ',data);if(!data.Item||!data.Item.Data)return;var type=data.Item.Type;var id=data.Item.Data.ID;if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID){this.OnChangeLineColor(data);}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_DELETE_ALL_DRAW_CHART_ID){this.DeleteAllChart();}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_ERASE_DRAW_CHART_ID){this.ClearAllSelectedChart();this.ClearCurrnetDrawPicture();this.EnableEraseChart(true);}else if(type==1&&id==JS_DRAWTOOL_MENU_ID.CMD_SELECTED_ID){this.ClearAllSelectedChart();this.ClearCurrnetDrawPicture();this.EnableEraseChart(false);}else if(type==2&&id==JS_DRAWTOOL_MENU_ID.CMD_ENABLE_MAGNET_ID){this.ChangeMagnet(data);}else if(type==0){this.ClearAllSelectedChart();this.EnableEraseChart(false);data.Span.classList.remove("UMyChart_DrawTool_Span");data.Span.classList.add("UMyChart_DrawTool_Span_Selected");this.CreateDrawPicture(data);}};//清空选中状态
13363
13376
  this.ClearAllSelectedChart=function(){for(var i=0;i<this.AryDivChart.length;++i){var item=this.AryDivChart[i];if(item.Item.Type==2)continue;item.Span.classList.remove("UMyChart_DrawTool_Span_Selected");item.Span.classList.add("UMyChart_DrawTool_Span");}};this.CreateToolGroup=function(tbody){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Group_Tr';tbody.appendChild(trDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Group_Td";tdDom.innerText=this.ToolConfig.Title;tdDom.colSpan=this.ColumnCount;trDom.appendChild(tdDom);var chartCount=this.ToolConfig.AryTool.length;for(var i=0,j=0;i<chartCount;){var trDom=document.createElement("tr");trDom.className='UMyChart_DrawTool_Tr';for(j=0;j<this.ColumnCount&&i<chartCount;++j,++i){var item=this.ToolConfig.AryTool[i];this.CreateToolItem(item,trDom);}tbody.appendChild(trDom);}};this.CreateToolItem=function(item,trDom){var _this79=this;var tdDom=document.createElement("td");tdDom.className="UMyChart_DrawTool_Td";tdDom.title=item.Title;trDom.appendChild(tdDom);var spanDom=document.createElement("span");spanDom.className=item.ClassName;spanDom.classList.add("UMyChart_DrawTool_Span");tdDom.appendChild(spanDom);var data={Item:item,TD:tdDom,Span:spanDom};if(item.Type==2&&item.Data.ID==JS_DRAWTOOL_MENU_ID.CMD_CHANGE_LINE_COLOR_ID)//颜色
@@ -13397,7 +13410,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13397
13410
  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);};}/********************************************************************************
13398
13411
  * 版本信息输出
13399
13412
  *
13400
- */var HQCHART_VERSION="1.1.13599";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13413
+ */var HQCHART_VERSION="1.1.13605";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
13401
13414
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13402
13415
  // BaseIndex:BaseIndex,
13403
13416
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13600",
3
+ "version": "1.1.13606",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -112,6 +112,7 @@ function JSDialogDrawTool()
112
112
  [
113
113
  { Title: '价格范围', ClassName: 'hqchart_drawtool icon-shijianfanwei', Type:0, Data:{ ID:"PriceRange" } },
114
114
  { Title: '时间范围', ClassName: 'hqchart_drawtool icon-jiagefanwei', Type:0, Data:{ ID:"DateRange" } },
115
+ { Title: "价格和时间范围", ClassName:"hqchart_drawtool icon-jiagefanwei", Type:0, Data:{ ID:"DatePriceRange" } },
115
116
  { Title: "监测线", ClassName:"hqchart_drawtool icon-jiance", Type:0, Data:{ ID:"MonitorLine"} },
116
117
  ]
117
118
  },