hqchart 1.1.13001 → 1.1.13009

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.
@@ -1202,7 +1202,7 @@ if(IFrameSplitOperator.IsBool(option.CorssCursorInfo.IsFixXLastTime))chart.Chart
1202
1202
  }if(item.Height>=0)chart.Frame.SubFrame[i].Height=item.Height;if(item.Custom)chart.Frame.SubFrame[i].Frame.YSplitOperator.Custom=item.Custom;if(item.RightTextFormat>0)chart.Frame.SubFrame[i].Frame.YSplitOperator.RightTextFormat=item.RightTextFormat;if(IFrameSplitOperator.IsNumber(item.TitleHeight))chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;if(IFrameSplitOperator.IsNumber(item.BorderLine))chart.Frame.SubFrame[i].Frame.BorderLine=item.BorderLine;if(IFrameSplitOperator.IsBool(item.EnableRemoveZero))chart.Frame.SubFrame[i].Frame.YSplitOperator.EnableRemoveZero=item.EnableRemoveZero;if(IFrameSplitOperator.IsNumber(item.FloatPrecision))chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;if(IFrameSplitOperator.IsBool(item.IsShowXLine))chart.Frame.SubFrame[i].Frame.IsShowXLine=item.IsShowXLine;if(IFrameSplitOperator.IsBool(item.IsShowYLine))chart.Frame.SubFrame[i].Frame.IsShowYLine=item.IsShowYLine;if(IFrameSplitOperator.IsNumber(item.YTextBaseline))chart.Frame.SubFrame[i].Frame.YTextBaseline=item.YTextBaseline;if(IFrameSplitOperator.IsBool(item.IsShowIndexTitle))chart.Frame.SubFrame[i].Frame.IsShowIndexTitle=item.IsShowIndexTitle;if(item.TopSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.TopSpace=item.TopSpace;if(item.BottomSpace>=0)chart.Frame.SubFrame[i].Frame.ChartBorder.BottomSpace=item.BottomSpace;//是否显示关闭集合竞价按钮
1203
1203
  if(IFrameSplitOperator.IsNumber(item.CloseBeforeButton))chart.Frame.SubFrame[i].Frame.IsShowCloseButton=item.CloseBeforeButton;if(item.ClientBGColor)subFrame.ClientBGColor=item.ClientBGColor;}chart.UpdateXShowText();}if(option.ExtendChart){for(var i=0;i<option.ExtendChart.length;++i){var item=option.ExtendChart[i];chart.CreateExtendChart(item.Name,item);}}//叠加股票
1204
1204
  if(option.Overlay){for(var i=0;i<option.Overlay.length;++i){var item=option.Overlay[i];chart.OverlaySymbol(item.Symbol,item);}}if(option.MinuteLine){if(option.MinuteLine.IsDrawAreaPrice==false)chart.ChartPaint[0].IsDrawArea=false;if(option.MinuteLine.IsShowLead==false)chart.IsShowLead=false;if(option.MinuteLine.IsShowAveragePrice==false){chart.ChartPaint[1].IsShow=false;chart.TitlePaint[0].IsShowAveragePrice=false;//标题栏均线也不显示
1205
- for(var i=0;i<chart.ExtendChartPaint.length;++i){var item=chart.ExtendChartPaint[i];if(item.ClassName=="MinuteTooltipPaint")item.IsShowAveragePrice=false;}}if(option.MinuteLine.SplitType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.SplitType=option.MinuteLine.SplitType;}if(option.MinuteVol){var item=option.MinuteVol;if(IFrameSplitOperator.IsNumber(item.BarColorType))chart.ChartPaint[2].BarColorType=item.BarColorType;}if(option.MinuteTitle){var item=option.MinuteTitle;if(IFrameSplitOperator.IsBool(item.IsShowName))chart.TitlePaint[0].IsShowName=item.IsShowName;if(IFrameSplitOperator.IsBool(item.IsShowDate))chart.TitlePaint[0].IsShowDate=item.IsShowDate;if(IFrameSplitOperator.IsBool(item.IsShowTime))chart.TitlePaint[0].IsShowTime=item.IsShowTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData))chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat))chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;if(IFrameSplitOperator.IsNumber(item.TitleBaseLine))chart.TitlePaint[0].TitleBaseLine=item.TitleBaseLine;if(item.TimeFormat)chart.TitlePaint[0].TimeFormat=item.TimeFormat;}if(option.CorssCursorTouchEnd===true)chart.CorssCursorTouchEnd=option.CorssCursorTouchEnd;if(option.IsShowBeforeData===true)chart.IsShowBeforeData=option.IsShowBeforeData;//分钟数据指标从第3个指标窗口设置
1205
+ for(var i=0;i<chart.ExtendChartPaint.length;++i){var item=chart.ExtendChartPaint[i];if(item.ClassName=="MinuteTooltipPaint")item.IsShowAveragePrice=false;}}if(option.MinuteLine.SplitType>0)chart.Frame.SubFrame[0].Frame.YSplitOperator.SplitType=option.MinuteLine.SplitType;}if(option.MinuteVol){var item=option.MinuteVol;if(IFrameSplitOperator.IsNumber(item.BarColorType))chart.ChartPaint[2].BarColorType=item.BarColorType;}if(option.MinuteTitle){var item=option.MinuteTitle;if(IFrameSplitOperator.IsBool(item.IsShowName))chart.TitlePaint[0].IsShowName=item.IsShowName;if(IFrameSplitOperator.IsBool(item.IsShowDate))chart.TitlePaint[0].IsShowDate=item.IsShowDate;if(IFrameSplitOperator.IsBool(item.IsShowTime))chart.TitlePaint[0].IsShowTime=item.IsShowTime;if(IFrameSplitOperator.IsBool(item.IsTitleShowLatestData))chart.IsTitleShowLatestData=item.IsTitleShowLatestData;if(IFrameSplitOperator.IsBool(item.IsAlwaysShowLastData))chart.TitlePaint[0].IsAlwaysShowLastData=item.IsAlwaysShowLastData;if(IFrameSplitOperator.IsNumber(item.ShowLastDataFormat))chart.TitlePaint[0].ShowLastDataFormat=item.ShowLastDataFormat;if(IFrameSplitOperator.IsNumber(item.TitleBaseLine))chart.TitlePaint[0].TitleBaseLine=item.TitleBaseLine;if(item.TimeFormat)chart.TitlePaint[0].TimeFormat=item.TimeFormat;}if(IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd))chart.CorssCursorTouchEnd=option.CorssCursorTouchEnd;if(IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor))chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;if(option.IsShowBeforeData===true)chart.IsShowBeforeData=option.IsShowBeforeData;//分钟数据指标从第3个指标窗口设置
1206
1206
  if(IFrameSplitOperator.IsNonEmptyArray(option.Windows)){var scriptData=new JSIndexScript();for(var i=0;i<option.Windows.length;++i){var index=2+i;var item=option.Windows[i];if(item.Script){chart.WindowIndex[index]=new ScriptIndex(item.Name,item.Script,item.Args,item);//脚本执行
1207
1207
  }else if(item.API)//使用API挂接指标数据 API:{ Name:指标名字, Script:指标脚本可以为空, Args:参数可以为空, Url:指标执行地址 }
1208
1208
  {var apiItem=item.API;chart.WindowIndex[index]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexItem=JSIndexMap.Get(item.Index);if(indexItem){chart.WindowIndex[index]=indexItem.Create();//创建子窗口的指标
@@ -1953,6 +1953,7 @@ this.LineColor=g_JSChartResource.FrameSplitPen;//线段颜色
1953
1953
  this.LineDash=null;//当线段类型==2时 可以设置虚线样式
1954
1954
  this.LineType=1;//线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
1955
1955
  this.LineWidth;//线段宽度
1956
+ this.ExtendLine;//延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
1956
1957
  this.ExtendData;//扩展属性
1957
1958
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
1958
1959
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -2151,7 +2152,8 @@ var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i
2151
2152
  {if(borderRight<10||position==1){if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2152
2153
  var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom-itemText.Width;var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Right:right,Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:true};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=right-itemText.Width;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);//文本背景区域
2153
2154
  if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(left,textLeft,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}if(item.Type==3||item.Type==4){if(item.Title){var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-itemText.Width-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-textWidth-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,false,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var preTextRect=null;if(mapTextRect&&mapTextRect.has(3))preTextRect=mapTextRect.get(3);var yText=y;var rtText={};for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=bottom;//bgTop+=(textWidth-itemText.Width);
2154
- var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Left:right,Right:this.ChartBorder.GetChartWidth(),Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:false};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var textLeft=right;rtText.Left=textLeft;if(preTextRect&&bgTop<preTextRect.Rect.Bottom){yText=preTextRect.Rect.Bottom;bgTop=yText-textHeight/2-1*pixelTatio;}}else{var textLeft=right+textWidth-itemText.Width;}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(textLeft),ToFixedPoint(bgTop),ToFixedRect(itemText.Width+1),ToFixedRect(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft+2*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,y,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2155
+ var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,itemText.Width);this.DrawHScreenText({X:yText,Y:bgTop},{Text:itemText.Text,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});if(i==0)this.DrawLine(top,bgTop,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){if(this.GetEventCallback){var bgTop=yText-textHeight/2-1*pixelTatio;var sendData={Top:bgTop,Left:right,Right:this.ChartBorder.GetChartWidth(),Height:null,IsShow:true,BGColor:item.LineColor,TextColor:item.TextColor,PixelTatio:pixelTatio,Position:"Right",IsInside:false};if(this.SendDrawCountDownEvent(sendData)){if(IFrameSplitOperator.IsPlusNumber(sendData.Height))yText+=textHeight+1*pixelTatio;}}}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var textLeft=right;rtText.Left=textLeft;if(preTextRect&&bgTop<preTextRect.Rect.Bottom){yText=preTextRect.Rect.Bottom;bgTop=yText-textHeight/2-1*pixelTatio;}}else{var textLeft=right+textWidth-itemText.Width;}if(item.ExtendLine&&item.ExtendLine[1])//右侧延长线
2156
+ {var exLine=item.ExtendLine[1];if(IFrameSplitOperator.IsNumber(exLine.Width)){if(i==0)this.DrawLine(right,right+exLine.Width,y,item.LineColor,item.LineType,item);textLeft+=exLine.Width;}}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(textLeft),ToFixedPoint(bgTop),ToFixedRect(itemText.Width+1),ToFixedRect(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft+2*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);if(itemText.TextColor)this.Canvas.fillStyle=itemText.TextColor;else this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,y,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;rtText.Bottom=yText;}}}if(mapTextRect&&IFrameSplitOperator.IsNumber(rtText.Left)&&IFrameSplitOperator.IsNumber(rtText.Bottom)){mapTextRect.set(3,{Rect:rtText,Item:item});}if(item.Type==3||item.Type==4){if(item.Title){var bgColor=item.LineColor;var rgb=this.RGBToStruct(item.LineColor);if(rgb)bgColor='rgba('+rgb.R+', '+rgb.G+', '+rgb.B+', '+g_JSChartResource.FrameLatestPrice.BGAlpha+')';//内部刻度 背景增加透明度
2155
2157
  var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.SendDrawCountDownEvent=function(sendData){if(!this.GetEventCallback)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_COUNTDOWN);if(!event||!event.Callback)return false;event.Callback(event,sendData,this);return true;};this.DrawDotLine=function(left,right,y,color,option){var pixelTatio=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=color;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth))this.Canvas.lineWidth=option.LineWidth*pixelTatio;if(option.LineDash)this.Canvas.setLineDash(option.LineDash);else this.Canvas.setLineDash([5*pixelTatio,5*pixelTatio]);//虚线
2156
2158
  this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.restore();};this.DrawLine=function(left,right,y,color,lineType,option){if(lineType==-1)return;if(lineType==0){var pixelRatio=GetDevicePixelRatio();this.Canvas.strokeStyle=color;var bChangeLineWidth=false;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth)){this.Canvas.lineWidth=option.LineWidth*pixelRatio;bChangeLineWidth=true;}this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}else{this.DrawDotLine(left,right,y,color,option);}};this.DrawHScreenText=function(center,data){this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=data.Color;this.Canvas.save();this.Canvas.translate(center.X,center.Y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(data.Text,data.XOffset,data.YOffset);this.Canvas.restore();};this.RGBToStruct=function(rgb){if(/^(rgb|RGB)/.test(rgb)){var aColor=rgb.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");var result={};if(aColor.length!=3)return null;result.R=Number(aColor[0]);result.G=Number(aColor[1]);result.B=Number(aColor[2]);return result;}return null;};this.GetMulitTextMaxWidth=function(aryData){var width=null;for(var i=0;i<aryData.length;++i){var item=aryData[i];var text=item.Text;if(!text)continue;var value=this.Canvas.measureText(text).width;if(width==null)width=value;else if(width<value)width=value;}return width;};this.GetScaleTextWidth=function(){var border=this.ChartBorder.GetBorder();var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
2157
2159
  if(this.IsHScreen){var borderTop=this.ChartBorder.Top;var borderBottom=this.ChartBorder.Bottom;var isDrawLeft=borderTop>10*pixelTatio&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderBottom>10*pixelTatio&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}else{var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var isDrawLeft=borderLeft>10&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}if(!isDrawRight&&!isDrawLeft)return null;var width={Left:null,Right:null};var rightExtendWidth=0;var isYPercentage=false;//是否是百分比坐标
@@ -4088,7 +4090,7 @@ this.newMethod();delete this.newMethod;this.ClassName="ChartMultiSVGIcon";this.I
4088
4090
  this.IconSize={Max:g_JSChartResource.DRAWICON.Icon.MaxSize,Min:g_JSChartResource.DRAWICON.Icon.MinSize,//图标的最大最小值
4089
4091
  Zoom:{Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type,Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value//放大倍数
4090
4092
  }};this.Family;this.Color=g_JSChartResource.DefaultTextColor;this.IsHScreen=false;this.IconRect=[];//0=序号,1=区域
4091
- this.Draw=function(){this.IconRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(!this.Data||this.Data.length<=0)return;if(!this.Family||!this.Icon)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Icon))return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;this.DataWidth=this.ChartFrame.DataWidth;this.DistanceWidth=this.ChartFrame.DistanceWidth;var border=this.GetBorder();if(this.IsHScreen){var left=border.TopEx;var right=border.BottomEx;}else{var left=border.LeftEx;var right=border.RightEx;}var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=fontSize+'px '+this.Family;for(var i=0;i<this.Icon.length;++i){var item=this.Icon[i];if(!IFrameSplitOperator.IsNumber(item.Index))continue;var index=item.Index-offset;if(index>=0&&index<xPointCount){var x=this.ChartFrame.GetXFromIndex(index);var y=this.ChartFrame.GetYFromData(item.Value);if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.Color;var textWidth=this.Canvas.measureText(item.Text).width;this.Canvas.textAlign='center';var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);if(x+textWidth/2>=right){this.Canvas.textAlign='right';x+=this.DataWidth/2;rtIcon.X=x-fontSize;}else if(x-textWidth/2<left){this.Canvas.textAlign='left';x-=this.DataWidth/2;rtIcon.X=x;}if(item.Baseline==1){this.Canvas.textBaseline='top';rtIcon.Y=y;}else if(item.Baseline==2){this.Canvas.textBaseline='bottom';rtIcon.Y=y-fontSize;}else{this.Canvas.textBaseline='middle';rtIcon.Y=y-fontSize/2;}if(this.IsHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(item.Symbol,0,0);this.Canvas.restore();}else{if(IFrameSplitOperator.IsNumber(item.YMove))y+=item.YMove;this.Canvas.fillText(item.Symbol,x,y);if(item.Text)this.IconRect.push({Index:i,Rect:rtIcon,Item:item});}if(item.Line){var kItem=this.Data.Data[item.Index];var price=item.Line.KData=="H"?kItem.High:kItem.Low;var yPrice=this.ChartFrame.GetYFromData(price);var yText=y;if(Array.isArray(item.Line.Offset)&&item.Line.Offset.length==2){if(yText>yPrice)//文字在下方
4093
+ this.Draw=function(){this.IconRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize)return;if(!this.Data||this.Data.length<=0)return;if(!this.Family||!this.Icon)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.Icon))return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var offset=this.Data.DataOffset;this.DataWidth=this.ChartFrame.DataWidth;this.DistanceWidth=this.ChartFrame.DistanceWidth;var border=this.GetBorder();if(this.IsHScreen){var left=border.TopEx;var right=border.BottomEx;}else{var left=border.LeftEx;var right=border.RightEx;}var fontSize=this.GetDynamicIconSize(this.DataWidth,this.DistanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=fontSize+'px '+this.Family;for(var i=0;i<this.Icon.length;++i){var item=this.Icon[i];if(!IFrameSplitOperator.IsNumber(item.Index))continue;var index=item.Index-offset;if(index>=0&&index<xPointCount){var x=this.ChartFrame.GetXFromIndex(index);var y=this.ChartFrame.GetYFromData(item.Value);if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.Color;var textWidth=this.Canvas.measureText(item.Symbol).width;this.Canvas.textAlign='center';var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);if(x+textWidth/2>=right){this.Canvas.textAlign='right';x+=this.DataWidth/2;rtIcon.X=x-fontSize;}else if(x-textWidth/2<left){this.Canvas.textAlign='left';x-=this.DataWidth/2;rtIcon.X=x;}if(item.Baseline==1){this.Canvas.textBaseline='top';rtIcon.Y=y;}else if(item.Baseline==2){this.Canvas.textBaseline='bottom';rtIcon.Y=y-fontSize;}else{this.Canvas.textBaseline='middle';rtIcon.Y=y-fontSize/2;}if(this.IsHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(item.Symbol,0,0);this.Canvas.restore();}else{if(IFrameSplitOperator.IsNumber(item.YMove))y+=item.YMove;this.Canvas.fillText(item.Symbol,x,y);if(item.Text)this.IconRect.push({Index:i,Rect:rtIcon,Item:item});}if(item.Line){var kItem=this.Data.Data[item.Index];var price=item.Line.KData=="H"?kItem.High:kItem.Low;var yPrice=this.ChartFrame.GetYFromData(price);var yText=y;if(Array.isArray(item.Line.Offset)&&item.Line.Offset.length==2){if(yText>yPrice)//文字在下方
4092
4094
  {yText-=item.Line.Offset[1];yPrice+=item.Line.Offset[0];}else if(yText<yPrice){yText+=item.Line.Offset[1];yPrice-=item.Line.Offset[0];}}this.Canvas.save();if(item.Line.Dash)this.Canvas.setLineDash(item.Line.Dash);//虚线
4093
4095
  if(item.Line.Width>0)this.Canvas.lineWidth=item.Line.Width;//线宽
4094
4096
  this.Canvas.strokeStyle=item.Line.Color;this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(yText,ToFixedPoint(x));this.Canvas.lineTo(yPrice,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yText);this.Canvas.lineTo(ToFixedPoint(x),yPrice);}this.Canvas.stroke();this.Canvas.restore();}}}};this.GetTooltipData=function(x,y,tooltip){if(!IFrameSplitOperator.IsNonEmptyArray(this.IconRect))return false;for(var i=0;i<this.IconRect.length;++i){var item=this.IconRect[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.X,rect.Y,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){JSConsole.Chart.Log('[ChartMultiSVGIcon::GetTooltipData] icon ',item);tooltip.Data=item;tooltip.ChartPaint=this;tooltip.Type=4;//指标
@@ -4959,9 +4961,9 @@ if(!isLast||option.PositionEx===1){var config={};if(!isLast)config.EmptyBGColor=
4959
4961
  info.ExtendData={Custom:config};}return info;};this.GetFirstOpenPrice=function()//获取显示第1个数据的开盘价
4960
4962
  {if(!this.Data)return null;var xPointCount=this.Frame.XPointCount;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;if(ChartData.IsTickPeriod(this.Period))return data.YClose;else return data.Open;}return null;};this.GetLast2ndClose=function()//获取最后第2根K线收盘加
4961
4963
  {if(!this.Data)return null;if(this.Data.Data.length<=0)return null;var xPointCount=this.Frame.XPointCount;var endIndex=this.Data.DataOffset+xPointCount-1;if(endIndex>=this.Data.Data.length)endIndex=this.Data.Data.length-1;var price=null;for(var i=endIndex,count=0;i>=0&&i<this.Data.Data.length;--i){var data=this.Data.Data[i];if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;if(count==0)price=data.Open;else if(count==1)price=data.Close;++count;if(count>=2)break;}return price;};this.CustomFixedCoordinate=function(option)//固定坐标刻度
4962
- {var defaultfloatPrecision=GetfloatPrecision(this.Symbol);for(var i in option.Data){var item=option.Data[i];var info=new CoordinateInfo();info.Type=1;info.TextColor=item.TextColor;info.LineColor=item.Color;info.LineType=2;//虚线
4964
+ {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;//虚线
4963
4965
  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;info.Value=item.Value;var text;if(item.Text)text=item.Text;else text=info.Value.toFixed(defaultfloatPrecision);if(option.Position=='left')info.Message[0]=text;else info.Message[1]=text;if(option.PositionEx===1)info.ExtendData={Custom:{Position:1}};//强制画在内部
4964
- this.Frame.CustomHorizontalInfo.push(info);}};//////////////////////
4966
+ if(IFrameSplitOperator.IsNonEmptyArray(item.ExtendLine))info.ExtendLine=item.ExtendLine.slice();this.Frame.CustomHorizontalInfo.push(info);}};//////////////////////
4965
4967
  // data.Min data.Max data.Interval data.Count
4966
4968
  //
4967
4969
  this.IntegerCoordinateSplit2=function(data){var splitItem=this.FrameSplitData2.Find(data.Interval);if(!splitItem)return false;if(data.Interval==splitItem.FixInterval)return true;//调整到整数倍数,不能整除的 +1
@@ -7588,7 +7590,7 @@ var touches=this.GetToucheData(e,this.IsForceLandscape);var pt=this.PointAbsolut
7588
7590
  if(this.FinishChartDrawPicturePoint())this.DrawDynamicInfo({Corss:false,Tooltip:false});}if(e.cancelable)e.preventDefault();return;}else{var drawPictrueData={};var pixelTatio=GetDevicePixelRatio();//鼠标移动坐标是原始坐标 需要乘以放大倍速
7589
7591
  drawPictrueData.X=touches[0].clientX-uielement.getBoundingClientRect().left;drawPictrueData.Y=touches[0].clientY-uielement.getBoundingClientRect().top;if(this.GetChartDrawPictureByPoint(drawPictrueData)){drawPictrueData.ChartDrawPicture.Status=20;drawPictrueData.ChartDrawPicture.ValueToPoint();drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;drawPictrueData.ChartDrawPicture.IsSelected=true;this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;var _event2=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE);//选中画图工具事件
7590
7592
  if(_event2&&_event2.Callback){var sendData={DrawPicture:drawPictrueData.ChartDrawPicture};_event2.Callback(_event2,sendData,this);}if(e.cancelable)e.preventDefault();return;}}}else{if(this.EnableScrollUpDown==true){this.DragTimer=setTimeout(function(){if(drag.Click.X==drag.LastMove.X&&drag.Click.Y==drag.LastMove.Y){var mouseDrag=self.MouseDrag;self.MouseDrag=null;T_ShowCorssCursor();self.PreventTouchEvent(e);}},800);}this.MouseDrag=drag;this.PhoneTouchInfo={Start:{X:touches[0].clientX,Y:touches[0].clientY},End:{X:touches[0].clientX,Y:touches[0].clientY}};this.SelectChartDrawPicture=null;if(this.EnableScrollUpDown==false)T_ShowCorssCursor();//移动十字光标
7591
- }if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[MinuteChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
7593
+ else if(this.IsClickShowCorssCursor)T_ShowCorssCursor();}if(this.EnableZoomIndexWindow){this.PhoneDBClick.AddTouchStart(touches[0].clientX,touches[0].clientY,Date.now());JSConsole.Chart.Log("[MinuteChartContainer::OnTouchStart] PhoneDBClick ",this.PhoneDBClick);}this.TouchEvent({EventID:JSCHART_EVENT_ID.ON_PHONE_TOUCH,FunctionName:"OnTouchStart"},e);}else if(this.IsPhonePinching(e)){var phonePinch={"Start":{},"Last":{}};var touches=this.GetToucheData(e,this.IsForceLandscape);phonePinch.Start={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};this.PhonePinch=phonePinch;this.SelectChartDrawPicture=null;}};this.OnTouchMove=function(e){if(this.ChartSplashPaint&&this.ChartSplashPaint.IsEnableSplash==true)return;var touches=this.GetToucheData(e,this.IsForceLandscape);if(this.IsPhoneDragging(e)){var drag=this.MouseDrag;if(drag==null){var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}else{var moveAngle=this.GetMoveAngle(drag.LastMove,{X:touches[0].clientX,Y:touches[0].clientY});var moveSetp=Math.abs(drag.LastMove.X-touches[0].clientX);var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);moveSetp=parseInt(moveSetp);if(this.CurrentChartDrawPicture){var drawPicture=this.CurrentChartDrawPicture;if(drawPicture.Status==1||drawPicture.Status==2){if(moveSetp<5&&moveUpDown<5)return;if(this.SetChartDrawPictureSecondPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==3){if(this.SetChartDrawPictureThirdPoint(touches[0].clientX,touches[0].clientY,true)){this.DrawDynamicInfo();}}else if(drawPicture.Status==20)//画图工具移动
7592
7594
  {if(moveSetp<5&&moveUpDown<5)return;if(this.MoveChartDrawPicture(touches[0].clientX-drag.LastMove.X,touches[0].clientY-drag.LastMove.Y,true)){this.DrawDynamicInfo();}}drag.LastMove.X=touches[0].clientX;drag.LastMove.Y=touches[0].clientY;}else{//上下滚动
7593
7595
  if((moveUpDown>0&&moveSetp<=3||moveAngle<=this.TouchMoveMinAngle)&&this.EnableScrollUpDown==true){this.StopDragTimer();return;}this.PreventTouchEvent(e);this.MouseDrag=null;var pixelTatio=GetDevicePixelRatio();var x=touches[0].clientX-uielement.getBoundingClientRect().left*pixelTatio;var y=touches[0].clientY-uielement.getBoundingClientRect().top*pixelTatio;this.OnMouseMove(x,y,e);}}if(this.PhoneTouchInfo){this.PhoneTouchInfo.End.X=touches[0].clientX;this.PhoneTouchInfo.End.Y=touches[0].clientY;}}else if(this.IsPhonePinching(e)){this.PreventTouchEvent(e);var phonePinch=this.PhonePinch;if(!phonePinch)return;var yHeight=Math.abs(touches[0].pageY-touches[1].pageY);var yLastHeight=Math.abs(phonePinch.Last.Y-phonePinch.Last.Y2);var yStep=yHeight-yLastHeight;var xHeight=Math.abs(touches[0].pageX-touches[1].pageX);var xLastHeight=Math.abs(phonePinch.Last.X-phonePinch.Last.X2);var xStep=xHeight-xLastHeight;var minStep=this.ZoomStepPixel;if(Math.abs(xStep)>minStep){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MINUTE_TOUCH_ZOOM);if(event&&event.Callback){var data={XStep:xStep,YStep:yStep,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault){this.PhonePinch=null;this.StopDragTimer();return;}}}phonePinch.Last={"X":touches[0].pageX,"Y":touches[0].pageY,"X2":touches[1].pageX,"Y2":touches[1].pageY};}if(this.EnableScrollUpDown==false){e.preventDefault();}else{if(drag==null){this.PreventTouchEvent(e);//十字光标出来了,阻止消息
7594
7596
  }else{this.StopDragTimer();//上下推动图片,停止定时器,消息传递下去
@@ -12624,7 +12626,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
12624
12626
  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);};}/********************************************************************************
12625
12627
  * 版本信息输出
12626
12628
  *
12627
- */var HQCHART_VERSION="1.1.13000";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12629
+ */var HQCHART_VERSION="1.1.13008";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12628
12630
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
12629
12631
  // BaseIndex:BaseIndex,
12630
12632
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13001",
3
+ "version": "1.1.13009",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -1029,7 +1029,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1029
1029
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
1030
1030
  }
1031
1031
 
1032
- if (option.CorssCursorTouchEnd===true) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
1032
+ if (IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd)) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
1033
+ if (IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor)) chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;
1033
1034
  if (option.IsShowBeforeData===true) chart.IsShowBeforeData=option.IsShowBeforeData;
1034
1035
 
1035
1036
  //分钟数据指标从第3个指标窗口设置
@@ -9100,6 +9101,7 @@ function CoordinateInfo()
9100
9101
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
9101
9102
  this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
9102
9103
  this.LineWidth; //线段宽度
9104
+ this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
9103
9105
  this.ExtendData; //扩展属性
9104
9106
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
9105
9107
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -11529,6 +11531,16 @@ function AverageWidthFrame()
11529
11531
  var textLeft=right+textWidth-itemText.Width;
11530
11532
  }
11531
11533
 
11534
+ if (item.ExtendLine && item.ExtendLine[1]) //右侧延长线
11535
+ {
11536
+ var exLine=item.ExtendLine[1];
11537
+ if (IFrameSplitOperator.IsNumber(exLine.Width))
11538
+ {
11539
+ if (i==0) this.DrawLine(right,right+exLine.Width,y,item.LineColor,item.LineType,item);
11540
+ textLeft+=exLine.Width;
11541
+ }
11542
+ }
11543
+
11532
11544
  if (emptyBGColor)
11533
11545
  {
11534
11546
  this.Canvas.fillStyle=emptyBGColor;
@@ -36620,7 +36632,7 @@ function ChartMultiSVGIcon()
36620
36632
  if (item.Color) this.Canvas.fillStyle = item.Color;
36621
36633
  else this.Canvas.fillStyle = this.Color;
36622
36634
 
36623
- var textWidth=this.Canvas.measureText(item.Text).width;
36635
+ var textWidth=this.Canvas.measureText(item.Symbol).width;
36624
36636
  this.Canvas.textAlign='center';
36625
36637
  var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
36626
36638
  if (x+textWidth/2>=right)
@@ -44738,7 +44750,7 @@ function FrameSplitKLinePriceY()
44738
44750
  this.CustomFixedCoordinate=function(option) //固定坐标刻度
44739
44751
  {
44740
44752
  var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
44741
- for(var i in option.Data)
44753
+ for(var i=0; i<option.Data.length; ++i)
44742
44754
  {
44743
44755
  var item=option.Data[i];
44744
44756
  var info=new CoordinateInfo();
@@ -44759,6 +44771,7 @@ function FrameSplitKLinePriceY()
44759
44771
  else info.Message[1]=text;
44760
44772
 
44761
44773
  if (option.PositionEx===1) info.ExtendData={ Custom:{ Position:1 } }; //强制画在内部
44774
+ if (IFrameSplitOperator.IsNonEmptyArray(item.ExtendLine)) info.ExtendLine=item.ExtendLine.slice();
44762
44775
 
44763
44776
  this.Frame.CustomHorizontalInfo.push(info);
44764
44777
  }
@@ -73124,6 +73137,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
73124
73137
 
73125
73138
  if (this.EnableScrollUpDown==false)
73126
73139
  T_ShowCorssCursor(); //移动十字光标
73140
+ else if (this.IsClickShowCorssCursor)
73141
+ T_ShowCorssCursor();
73127
73142
  }
73128
73143
 
73129
73144
  if (this.EnableZoomIndexWindow)
@@ -4921,7 +4921,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4921
4921
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
4922
4922
  }
4923
4923
 
4924
- if (option.CorssCursorTouchEnd===true) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
4924
+ if (IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd)) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
4925
+ if (IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor)) chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;
4925
4926
  if (option.IsShowBeforeData===true) chart.IsShowBeforeData=option.IsShowBeforeData;
4926
4927
 
4927
4928
  //分钟数据指标从第3个指标窗口设置
@@ -12992,6 +12993,7 @@ function CoordinateInfo()
12992
12993
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
12993
12994
  this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
12994
12995
  this.LineWidth; //线段宽度
12996
+ this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
12995
12997
  this.ExtendData; //扩展属性
12996
12998
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
12997
12999
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -15421,6 +15423,16 @@ function AverageWidthFrame()
15421
15423
  var textLeft=right+textWidth-itemText.Width;
15422
15424
  }
15423
15425
 
15426
+ if (item.ExtendLine && item.ExtendLine[1]) //右侧延长线
15427
+ {
15428
+ var exLine=item.ExtendLine[1];
15429
+ if (IFrameSplitOperator.IsNumber(exLine.Width))
15430
+ {
15431
+ if (i==0) this.DrawLine(right,right+exLine.Width,y,item.LineColor,item.LineType,item);
15432
+ textLeft+=exLine.Width;
15433
+ }
15434
+ }
15435
+
15424
15436
  if (emptyBGColor)
15425
15437
  {
15426
15438
  this.Canvas.fillStyle=emptyBGColor;
@@ -40512,7 +40524,7 @@ function ChartMultiSVGIcon()
40512
40524
  if (item.Color) this.Canvas.fillStyle = item.Color;
40513
40525
  else this.Canvas.fillStyle = this.Color;
40514
40526
 
40515
- var textWidth=this.Canvas.measureText(item.Text).width;
40527
+ var textWidth=this.Canvas.measureText(item.Symbol).width;
40516
40528
  this.Canvas.textAlign='center';
40517
40529
  var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40518
40530
  if (x+textWidth/2>=right)
@@ -48630,7 +48642,7 @@ function FrameSplitKLinePriceY()
48630
48642
  this.CustomFixedCoordinate=function(option) //固定坐标刻度
48631
48643
  {
48632
48644
  var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
48633
- for(var i in option.Data)
48645
+ for(var i=0; i<option.Data.length; ++i)
48634
48646
  {
48635
48647
  var item=option.Data[i];
48636
48648
  var info=new CoordinateInfo();
@@ -48651,6 +48663,7 @@ function FrameSplitKLinePriceY()
48651
48663
  else info.Message[1]=text;
48652
48664
 
48653
48665
  if (option.PositionEx===1) info.ExtendData={ Custom:{ Position:1 } }; //强制画在内部
48666
+ if (IFrameSplitOperator.IsNonEmptyArray(item.ExtendLine)) info.ExtendLine=item.ExtendLine.slice();
48654
48667
 
48655
48668
  this.Frame.CustomHorizontalInfo.push(info);
48656
48669
  }
@@ -77016,6 +77029,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77016
77029
 
77017
77030
  if (this.EnableScrollUpDown==false)
77018
77031
  T_ShowCorssCursor(); //移动十字光标
77032
+ else if (this.IsClickShowCorssCursor)
77033
+ T_ShowCorssCursor();
77019
77034
  }
77020
77035
 
77021
77036
  if (this.EnableZoomIndexWindow)
@@ -129545,7 +129560,7 @@ function ScrollBarBGChart()
129545
129560
 
129546
129561
 
129547
129562
 
129548
- var HQCHART_VERSION="1.1.13000";
129563
+ var HQCHART_VERSION="1.1.13008";
129549
129564
 
129550
129565
  function PrintHQChartVersion()
129551
129566
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13000";
8
+ var HQCHART_VERSION="1.1.13008";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4965,7 +4965,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4965
4965
  if (item.TimeFormat) chart.TitlePaint[0].TimeFormat=item.TimeFormat;
4966
4966
  }
4967
4967
 
4968
- if (option.CorssCursorTouchEnd===true) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
4968
+ if (IFrameSplitOperator.IsBool(option.CorssCursorTouchEnd)) chart.CorssCursorTouchEnd = option.CorssCursorTouchEnd;
4969
+ if (IFrameSplitOperator.IsBool(option.IsClickShowCorssCursor)) chart.IsClickShowCorssCursor=option.IsClickShowCorssCursor;
4969
4970
  if (option.IsShowBeforeData===true) chart.IsShowBeforeData=option.IsShowBeforeData;
4970
4971
 
4971
4972
  //分钟数据指标从第3个指标窗口设置
@@ -13036,6 +13037,7 @@ function CoordinateInfo()
13036
13037
  this.LineDash=null; //当线段类型==2时 可以设置虚线样式
13037
13038
  this.LineType=1; //线段类型 -1=不画线段 2=虚线, 8,9=集合竞价坐标
13038
13039
  this.LineWidth; //线段宽度
13040
+ this.ExtendLine; //延长线长度[ ] { Width:长度 } [0]=左 [1]=右 实例: [null, { Width: 50}];
13039
13041
  this.ExtendData; //扩展属性
13040
13042
  //百分比 { PriceColor:, PercentageColor:, SplitColor:, Font: }
13041
13043
  //自定义刻度 { Custom:{ Position: 1=强制内部 }}
@@ -15465,6 +15467,16 @@ function AverageWidthFrame()
15465
15467
  var textLeft=right+textWidth-itemText.Width;
15466
15468
  }
15467
15469
 
15470
+ if (item.ExtendLine && item.ExtendLine[1]) //右侧延长线
15471
+ {
15472
+ var exLine=item.ExtendLine[1];
15473
+ if (IFrameSplitOperator.IsNumber(exLine.Width))
15474
+ {
15475
+ if (i==0) this.DrawLine(right,right+exLine.Width,y,item.LineColor,item.LineType,item);
15476
+ textLeft+=exLine.Width;
15477
+ }
15478
+ }
15479
+
15468
15480
  if (emptyBGColor)
15469
15481
  {
15470
15482
  this.Canvas.fillStyle=emptyBGColor;
@@ -40556,7 +40568,7 @@ function ChartMultiSVGIcon()
40556
40568
  if (item.Color) this.Canvas.fillStyle = item.Color;
40557
40569
  else this.Canvas.fillStyle = this.Color;
40558
40570
 
40559
- var textWidth=this.Canvas.measureText(item.Text).width;
40571
+ var textWidth=this.Canvas.measureText(item.Symbol).width;
40560
40572
  this.Canvas.textAlign='center';
40561
40573
  var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40562
40574
  if (x+textWidth/2>=right)
@@ -48674,7 +48686,7 @@ function FrameSplitKLinePriceY()
48674
48686
  this.CustomFixedCoordinate=function(option) //固定坐标刻度
48675
48687
  {
48676
48688
  var defaultfloatPrecision=GetfloatPrecision(this.Symbol);
48677
- for(var i in option.Data)
48689
+ for(var i=0; i<option.Data.length; ++i)
48678
48690
  {
48679
48691
  var item=option.Data[i];
48680
48692
  var info=new CoordinateInfo();
@@ -48695,6 +48707,7 @@ function FrameSplitKLinePriceY()
48695
48707
  else info.Message[1]=text;
48696
48708
 
48697
48709
  if (option.PositionEx===1) info.ExtendData={ Custom:{ Position:1 } }; //强制画在内部
48710
+ if (IFrameSplitOperator.IsNonEmptyArray(item.ExtendLine)) info.ExtendLine=item.ExtendLine.slice();
48698
48711
 
48699
48712
  this.Frame.CustomHorizontalInfo.push(info);
48700
48713
  }
@@ -77060,6 +77073,8 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
77060
77073
 
77061
77074
  if (this.EnableScrollUpDown==false)
77062
77075
  T_ShowCorssCursor(); //移动十字光标
77076
+ else if (this.IsClickShowCorssCursor)
77077
+ T_ShowCorssCursor();
77063
77078
  }
77064
77079
 
77065
77080
  if (this.EnableZoomIndexWindow)
@@ -129703,7 +129718,7 @@ function HQChartScriptWorker()
129703
129718
 
129704
129719
 
129705
129720
 
129706
- var HQCHART_VERSION="1.1.13000";
129721
+ var HQCHART_VERSION="1.1.13008";
129707
129722
 
129708
129723
  function PrintHQChartVersion()
129709
129724
  {