hqchart 1.1.13725 → 1.1.13728

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.
@@ -2346,7 +2346,7 @@ this.GetYData=function(y,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromD
2346
2346
  this.GetXData=function(x){if(x<=this.ChartBorder.GetLeft())return 0;if(x>=this.ChartBorder.GetRight())return this.XPointCount;return(x-this.ChartBorder.GetLeft())*(this.XPointCount*1.0/this.ChartBorder.GetWidth());};//选中的画图工具X,Y轴坐标信息
2347
2347
  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();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";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=this.GetXData(item.X,false);var index=Math.round(index);var kItem=this.GetKItem(index);if(kItem){var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);if(ChartData.IsMinutePeriod(option.Period))text+=" "+IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");else if(ChartData.IsMilliSecondPeriod(option.Period))text+=" "+IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM:SS.fff");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){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;var index=this.Data.DataOffset+currentIndex;return this.Data.Data[index];};this.DrawPictureYCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var top=border.TopEx;var bottom=border.BottomEx;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var defaultfloatPrecision=2;if(option&&option.Symbol)defaultfloatPrecision=GetfloatPrecision(option.Symbol);var textWidth=0;for(var i=0;i<range.Points.length;++i){var item=range.Points[i];var Value=this.GetYData(item.Y);var text=Value.toFixed(defaultfloatPrecision);var value=this.Canvas.measureText(text).width;if(textWidth<value)textWidth=value;range.Points[i].Text=text;}textWidth+=this.YTextPadding[1]+2;if(range.Y){var yRange=range.Y;var yTop=yRange.Min.Y;var yBottom=yRange.Max.Y;if(yRange.Min.Y<top)yTop=top;if(yRange.Max.Y>bottom)yBottom=bottom;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(right,yTop,textWidth+5,yBottom-yTop);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.Y<top||item.Y>bottom)continue;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(right,item.Y-fontHeight/2,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yText=item.Y+fontHeight/2;this.Canvas.fillText(item.Text,right+this.YTextPadding[1],yText);}};this.DrawPicturePointYCoordinate=function(drawPicture,option){if(this.IsHScreen)return;if(!drawPicture.GetYCoordinatePoint)return;var aryPoint=drawPicture.GetYCoordinatePoint();if(!IFrameSplitOperator.IsNonEmptyArray(aryPoint))return;var border=this.GetBorder();var top=border.TopEx;var bottom=border.BottomEx;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";var defaultfloatPrecision=2;if(option&&option.Symbol)defaultfloatPrecision=GetfloatPrecision(option.Symbol);for(var i=0;i<aryPoint.length;++i){var item=aryPoint[i];if(!item)continue;if(item.Y<top||item.Y>bottom)continue;var text=item.YValue.toFixed(defaultfloatPrecision);var textWidth=this.Canvas.measureText(text).width+2;textWidth+=this.YTextPadding[1];this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(right,item.Y-fontHeight/2,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yText=item.Y+fontHeight/2;this.Canvas.fillText(text,right+this.YTextPadding[1],yText);}};//字体外部设置好
2348
2348
  this.GetCustomItemTextInfo=function(item,bLeft,pixelTatio){var text=bLeft?item.Message[0]:item.Message[1];var aryText=[];var width=0;if(Array.isArray(text)){for(var i=0;i<text.length;++i){var item=text[i];if(item.Type===1){aryText.push({Type:item.Type});}else{var value=this.Canvas.measureText(text[i].Text).width;if(value>width)width=value;var outItem={Text:text[i].Text,Width:value+2*pixelTatio};if(item.TextColor)outItem.TextColor=item.TextColor;aryText.push(outItem);}}if(width>0)width+=2*pixelTatio;}else{width=this.Canvas.measureText(text).width+2*pixelTatio;aryText.push({Text:text,Width:width});}return{MaxWidth:width,Text:aryText};};this.DrawCustomItem=function(item,mapTextRect)//显示自定义Y刻度
2349
- {if(!item.Message[1]&&!item.Message[0])return;if(item.Value>this.HorizontalMax||item.Value<this.HorizontalMin){this.SendDrawCountDownEvent({IsShow:false});return;}var border=this.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=18*pixelTatio;var textHeight=defaultTextHeight;var y=this.GetYFromData(item.Value);var position=0;var emptyBGColor;if(item.ExtendData&&item.ExtendData.Custom){var customItem=item.ExtendData.Custom;if(IFrameSplitOperator.IsNumber(customItem.Position))position=customItem.Position;if(customItem.EmptyBGColor)emptyBGColor=customItem.EmptyBGColor;}if(item.Message[0])// 左
2349
+ {if(!item.Message[1]&&!item.Message[0])return;if(item.Value>this.HorizontalMax||item.Value<this.HorizontalMin){this.SendDrawCountDownEvent({IsShow:false});return;}var border=this.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=border.Top;var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var titleHeight=this.ChartBorder.TitleHeight;if(this.IsHScreen){borderLeft=this.ChartBorder.Top;borderRight=this.ChartBorder.Bottom;top=border.Top;bottom=border.Bottom;}var pixelTatio=GetDevicePixelRatio();var defaultTextHeight=18*pixelTatio;var textHeight=defaultTextHeight;var y;if(item.Value=="Top")y=top;else if(item.Value=="Bottom")y=bottom;else y=this.GetYFromData(item.Value);var position=0;var emptyBGColor;if(item.ExtendData&&item.ExtendData.Custom){var customItem=item.ExtendData.Custom;if(IFrameSplitOperator.IsNumber(customItem.Position))position=customItem.Position;if(customItem.EmptyBGColor)emptyBGColor=customItem.EmptyBGColor;}if(item.Message[0])// 左
2350
2350
  {if(borderLeft<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,true,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+')';//内部刻度 背景增加透明度
2351
2351
  var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){var bgTop=top;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{if(itemText.Type===1){}else{var bgTop=yText-textHeight/2-1*pixelTatio;var textLeft=left+1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft+1*pixelTatio,yText);if(i==0)this.DrawLine(textLeft+itemText.Width,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else{if(item.Font!=null)this.Canvas.font=item.Font;this.Canvas.textAlign="right";this.Canvas.textBaseline="middle";var textInfo=this.GetCustomItemTextInfo(item,true,pixelTatio);var textWidth=textInfo.MaxWidth;var fontHeight=this.GetFontHeight();textHeight=fontHeight>defaultTextHeight?fontHeight:defaultTextHeight;var yText=y;for(var i=0;i<textInfo.Text.length;++i){var itemText=textInfo.Text[i];if(this.IsHScreen){if(i==0)var bgTop=top-itemText.Width;else var bgTop=top-textWidth;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(bgTop+itemText.Width,bottom,yText,item.LineColor,item.LineType,item);yText-=textHeight+1*pixelTatio;}else{var bgTop=yText-textHeight/2-1*pixelTatio;if(i==0){var rectLeft=left-itemText.Width;var textLeft=left;}else{var rectLeft=left-textWidth;var textLeft=left-(textWidth-itemText.Width);}if(emptyBGColor){this.Canvas.fillStyle=emptyBGColor;this.Canvas.fillRect(rectLeft-1,bgTop,itemText.Width+1,textHeight);this.Canvas.strokeStyle=item.LineColor;this.Canvas.strokeRect(ToFixedPoint(rectLeft-1),ToFixedPoint(bgTop),ToFixedPoint(itemText.Width+1),ToFixedPoint(textHeight));this.Canvas.fillStyle=item.LineColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}else{this.Canvas.fillStyle=item.LineColor;this.Canvas.fillRect(rectLeft,bgTop,itemText.Width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(itemText.Text,textLeft-1*pixelTatio,yText);}if(i==0)this.DrawLine(left,right,yText,item.LineColor,item.LineType,item);yText+=textHeight+1*pixelTatio;}}}}else if(item.Message[1])//右
2352
2352
  {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+')';//内部刻度 背景增加透明度
@@ -2430,7 +2430,8 @@ var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=
2430
2430
  this.SplitXYCoordinate=function(){if(this.XYSplit==false){//计算自定义刻度
2431
2431
  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轴数值
2432
2432
  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轴刻度定制显示
2433
- {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);//自定义刻度
2433
+ {if(this.IsMinSize)return;for(var i in this.CustomHorizontalInfo){var item=this.CustomHorizontalInfo[i];switch(item.Type){case 0:case 1:case 10://自定义的
2434
+ this.DrawCustomItem(item);//自定义刻度
2434
2435
  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)//多日数据
2435
2436
  {var dayIndex=obj.IndexData.DayIndex;var dataIndex=obj.IndexData.DataIndex-step;var itemIndex=-1;if(obj.IndexData.Type==20)itemIndex=0;else if(obj.IndexData.Type==10)itemIndex=1;else if(obj.IndexData.Type==30)itemIndex=2;else return false;for(var i=dayIndex,j=itemIndex;i>=0;--i){var dayItem=obj.Data[i];for(;j>=0;--j){var dataItem=dayItem[j];if(!dataItem.DayItem||!dataItem.DayItem.Data)continue;if(dataIndex==null)dataIndex=dataItem.DayItem.Data.length-1;for(;dataIndex>=0;--dataIndex){var item=dataItem.DayItem.Data[dataIndex];if(!item)continue;if(dataItem.Type==10){var cursorIndex=this.MinuteCount*i+dataIndex;obj.Point.X=this.GetXFromIndex(cursorIndex);obj.Point.Y=this.GetYFromData(item.Close);obj.IndexData.CursorIndex=cursorIndex;obj.IndexData.DayIndex=i;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}else if(dataItem.Type==20){if(!IFrameSplitOperator.IsNumber(item.Price))continue;obj.Point.X=this.GetLeftExtendXFromIndex(dataIndex,dataItem.DayItem);obj.Point.Y=this.GetLeftExtendYFromData(item.Price);obj.IndexData.CursorIndex=-1;obj.IndexData.DayIndex=i;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}else if(dataItem.Type==30){if(!IFrameSplitOperator.IsNumber(item.Price))continue;obj.Point.X=this.GetRightExtendXFromIndex(dataIndex,dataItem.DayItem);obj.Point.Y=this.GetRightExtendYFromData(item.Price);obj.IndexData.CursorIndex=-1;obj.IndexData.DayIndex=i;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}}dataIndex=null;}j=2;}return false;}else if(obj.DataType==1)//单日
2436
2437
  {var dayIndex=obj.IndexData.DayIndex;var dataIndex=obj.IndexData.DataIndex-step;var itemIndex=-1;if(obj.IndexData.Type==2)itemIndex=0;else if(obj.IndexData.Type==1)itemIndex=1;else if(obj.IndexData.Type==3)itemIndex=2;else return false;for(var i=itemIndex;i>=0;--i){var dataItem=obj.Data[i];if(!dataItem||!dataItem.DayItem||!dataItem.DayItem.Data)continue;if(dataIndex==null)dataIndex=dataItem.DayItem.Data.length-1;for(;dataIndex>=0;--dataIndex){if(dataItem.Type==1){var offset=dataItem.DayItem.DataOffset;var item=dataItem.DayItem.Data[dataIndex+offset];if(!item)continue;var cursorIndex=dataIndex;obj.Point.X=this.GetXFromIndex(cursorIndex);obj.Point.Y=this.GetYFromData(item.Close);obj.IndexData.CursorIndex=cursorIndex;obj.IndexData.DayIndex=0;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}else if(dataItem.Type==2){var item=dataItem.DayItem.Data[dataIndex];if(!item)continue;if(!IFrameSplitOperator.IsNumber(item.Price))continue;obj.Point.X=this.GetLeftExtendXFromIndex(dataIndex,dataItem.DayItem);obj.Point.Y=this.GetLeftExtendYFromData(item.Price);obj.IndexData.CursorIndex=-1;obj.IndexData.DayIndex=0;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}else if(dataItem.Type==3){var item=dataItem.DayItem.Data[dataIndex];if(!item)continue;if(!IFrameSplitOperator.IsNumber(item.Price))continue;obj.Point.X=this.GetRightExtendXFromIndex(dataIndex,dataItem.DayItem);obj.Point.Y=this.GetRightExtendYFromData(item.Price);obj.IndexData.CursorIndex=-1;obj.IndexData.DayIndex=0;obj.IndexData.DataIndex=dataIndex;obj.IndexData.Type=dataItem.Type;return true;}}dataIndex=null;}}};this.MoveXIndexRight=function(step,obj){JSConsole.Chart.Log("[MinuteFrame::MoveXIndexRight] obj ",obj);if(obj.DataType==2)//多日数据
@@ -2585,6 +2586,7 @@ case 1://固定价格刻度
2585
2586
  this.DrawCustomItem(item,mapTextRect);break;case 2://当前屏最后一个K线价格刻度
2586
2587
  case 3://主图K线涨幅刻度
2587
2588
  case 4://叠加K线涨幅刻度
2589
+ case 10://自定义的
2588
2590
  this.DrawCustomItem(item,mapTextRect);break;}}};//Y轴面积背景
2589
2591
  this.DrawCustomHorizontalArea=function(){if(this.IsMinSize)return;if(this.ChartBorder.IsShowTitleOnly)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.CustomHorizontalInfo))return;for(var i=0;i<this.CustomHorizontalInfo.length;++i){var item=this.CustomHorizontalInfo[i];if(item.Type==5)this.DrawCustomAreaItem(item);}};this.DrawCustomVerticalItem=function(item){this.Canvas.save();if(item.Data.Line.Type==1)this.Canvas.setLineDash([5,5]);//虚线
2590
2592
  this.Canvas.strokeStyle=item.Data.Line.Color;this.Canvas.beginPath();if(item.IsHScreen){this.Canvas.moveTo(item.Top,ToFixedPoint(item.X));this.Canvas.lineTo(item.Bottom,ToFixedPoint(item.X));}else{this.Canvas.moveTo(ToFixedPoint(item.X),item.Top);this.Canvas.lineTo(ToFixedPoint(item.X),item.Bottom);}this.Canvas.stroke();this.Canvas.restore();};this.DrawCustomVertical=function()//X轴定制刻度显示
@@ -12668,7 +12670,7 @@ for(var i=0;i<data.data.length;++i){var item=data.data[i];var symbol=item[0];if(
12668
12670
  var bUpdate=false;var aryStock=chart.ShowSymbol;for(var i=0;i<aryStock.length;++i){if(setUpdateSymbol.has(aryStock[i].Symbol)){bUpdate=true;break;}}if(bUpdate)this.Draw();};//读取单条股票json数据
12669
12671
  this.ReadStockJsonData=function(stock,item){//0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本 16=涨停价 17=跌停价
12670
12672
  //18=内盘 19=外盘 20=现量 21=涨幅% 22=涨跌 23=换手率% 24=振幅% 25=流通市值 26=总市值
12671
- //30=全局扩展数据 31=当前板块扩展数据
12673
+ //30=全局扩展数据 31=当前板块扩展数据 36=日期字段
12672
12674
  //88=价格颜色类型
12673
12675
  if(IFrameSplitOperator.IsString(item[1]))stock.Name=item[1];if(IFrameSplitOperator.IsNumber(item[2]))stock.YClose=item[2];if(IFrameSplitOperator.IsNumber(item[3]))stock.Open=item[3];if(IFrameSplitOperator.IsNumber(item[4]))stock.High=item[4];if(IFrameSplitOperator.IsNumber(item[5]))stock.Low=item[5];if(IFrameSplitOperator.IsNumber(item[6]))stock.Price=item[6];if(IFrameSplitOperator.IsNumber(item[7]))stock.Vol=item[7];if(IFrameSplitOperator.IsNumber(item[8]))stock.Amount=item[8];if(IFrameSplitOperator.IsNumber(item[9]))stock.BuyPrice=item[9];if(IFrameSplitOperator.IsNumber(item[10]))stock.BuyVol=item[10];if(IFrameSplitOperator.IsNumber(item[11]))stock.SellPrice=item[11];if(IFrameSplitOperator.IsNumber(item[12]))stock.SellVol=item[12];if(IFrameSplitOperator.IsNumber(item[13]))stock.AvPrice=item[13];//均价
12674
12676
  if(IFrameSplitOperator.IsNumber(item[14]))stock.OutShares=item[14];//流通股
@@ -12798,7 +12800,7 @@ this.OnClickHeader=function(clickData,e){var _this60=this;var header=clickData.H
12798
12800
  {var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_REPORT_LOCAL_SORT);if(event&&event.Callback){var sendData={Column:header.Column,SortInfo:sortInfo,SymbolList:this.Data.Data,Result:null};event.Callback(event,sendData,this);if(Array.isArray(sendData.Result))this.Data.Data=sendData.Result;}else{this.Data.Data.sort(function(left,right){return _this60.LocalSort(left,right,header.Column,sortInfo.Sort);});}}else if(header.Column.Sort==2)//远程排序
12799
12801
  {if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Data.YOffset=0;this.ResetReportSelectStatus();this.RequestStockSortData(header.Column,sortInfo.Field,sortInfo.Sort);//远程排序
12800
12802
  return;}}this.Data.YOffset=0;this.ResetReportSelectStatus();this.SortInfo.Field=sortInfo.Field;this.SortInfo.Sort=sortInfo.Sort;this.Draw();this.DelayUpdateStockData();}}};this.PopupHeaderMenu=function(clickData,e){var _this61=this;if(!this.JSPopMenu)return;if(!this.GetEventCallback)return;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_REPORT_HEADER_MENU);if(!event||!event.Callback)return;var header=clickData.Header;var column=header.Column;var menuData={Menu:null,Position:JSPopMenu.POSITION_ID.DROPDOWN_MENU_ID};menuData.ClickCallback=function(data){_this61.OnClickHeaderMenu(column,data);};var sendData={MenuData:menuData,Column:column,Index:header.Index,PreventDefault:false,e:e};event.Callback(event,sendData,this);if(sendData.PreventDefault==true)return;if(!menuData.Menu)return;this.PopupMenuByDrapdown(menuData,header.Rect);};//下拉菜单
12801
- this.PopupMenuByDrapdown=function(menuData,rtButton){if(!this.JSPopMenu)return;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtButton.Left/pixelRatio,Right:rtButton.Right/pixelRatio,Bottom:rtButton.Bottom/pixelRatio,Top:rtButton.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByDrapdown(rtCell);};this.GetTabPopMenu=function(tabItem){var aryMenu=[];if(IFrameSplitOperator.IsNonEmptyArray(tabItem.ArySubMenu)){for(var i=0;i<tabItem.ArySubMenu.length;++i){var item=tabItem.ArySubMenu[i];var menuItem={Name:item.Title,Data:{ID:item.CommandID,Args:[item.ID]}};aryMenu.push(menuItem);}}return aryMenu;};this.PopupTabMenu=function(menuData,tab,e){if(!this.JSPopMenu)return;var rtTab=tab.Rect;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtTab.Left/pixelRatio,Right:rtTab.Right/pixelRatio,Bottom:rtTab.Bottom/pixelRatio,Top:rtTab.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByTab(rtCell);if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};//点击标签
12803
+ this.PopupMenuByDrapdown=function(menuData,rtButton){if(!this.JSPopMenu)return;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtButton.Left/pixelRatio,Right:rtButton.Right/pixelRatio,Bottom:rtButton.Bottom/pixelRatio,Top:rtButton.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByDrapdown(rtCell);};this.GetTabPopMenu=function(tabItem){var aryMenu=[];if(IFrameSplitOperator.IsNonEmptyArray(tabItem.ArySubMenu)){for(var i=0;i<tabItem.ArySubMenu.length;++i){var item=tabItem.ArySubMenu[i];var menuItem={Name:item.Title,Data:{ID:item.CommandID,Args:[item.ID]}};if(item.Text)menuItem.Text=item.Text;aryMenu.push(menuItem);}}return aryMenu;};this.PopupTabMenu=function(menuData,tab,e){if(!this.JSPopMenu)return;var rtTab=tab.Rect;var pixelRatio=GetDevicePixelRatio();var rtCell={Left:rtTab.Left/pixelRatio,Right:rtTab.Right/pixelRatio,Bottom:rtTab.Bottom/pixelRatio,Top:rtTab.Top/pixelRatio};rtCell.Width=rtCell.Right-rtCell.Left;rtCell.Height=rtCell.Bottom-rtCell.Top;var rtClient=this.UIElement.getBoundingClientRect();var rtScroll=GetScrollPosition();var offsetLeft=rtClient.left+rtScroll.Left;var offsetTop=rtClient.top+rtScroll.Top;rtCell.Left+=offsetLeft;rtCell.Right+=offsetLeft;rtCell.Top+=offsetTop;rtCell.Bottom+=offsetTop;this.JSPopMenu.CreatePopMenu(menuData);this.JSPopMenu.PopupMenuByTab(rtCell);if(e.preventDefault)e.preventDefault();if(e.stopPropagation)e.stopPropagation();};//点击标签
12802
12804
  this.OnClickTab=function(tabData,e){var _this62=this;if(!tabData.Tab)return;var redraw=false;var pixelTatio=GetDevicePixelRatio();var x=(e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;var y=(e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;var uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};if(tabData.Tab.IsMenu){var menuData={Menu:this.GetTabPopMenu(tabData.Tab),Position:JSPopMenu.POSITION_ID.TAB_MENU_ID};menuData.ClickCallback=function(data){_this62.OnClickTabPopMenu(tabData,data);};var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_REPORT_TABMENU);if(event&&event.Callback){var sendData={MenuData:menuData,Tab:tabData,PreventDefault:false,e:e};event.Callback(event,sendData,this);if(sendData.PreventDefault==true)return;}this.PopupTabMenu(menuData,tabData.Tab,e);}else{var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_REPORT_TAB);if(event&&event.Callback){var sendData={Data:tabData,IsSide:{X:x,Y:x},UIElement:uiElement,e:e,Redraw:redraw,PreventDefault:false};event.Callback(event,sendData,this);if(IFrameSplitOperator.IsBool(sendData.Redraw))redraw=sendData.Redraw;if(sendData.PreventDefault==true)return;}if(tabData.Tab.CommandID==JSCHART_MENU_ID.CMD_REPORT_CHANGE_BLOCK_ID){this.ExecuteMenuCommand(tabData.Tab.CommandID,[tabData.Tab.ID]);this.SetSelectedTab(tabData.Index);redraw=true;}}if(redraw)this.Draw();};this.OnClickTabPopMenu=function(tabData,data){JSConsole.Chart.Log('[JSReportChartContainer::OnClickTabPopMenu] ',tabData,data);var cmdID=data.Data.ID;//命令ID
12803
12805
  var aryArgs=data.Data.Args;//参数
12804
12806
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_MENU_COMMAND);//回调通知外部
@@ -13645,7 +13647,7 @@ this.CreatePopMenu=function(data){this.Clear();if(!IFrameSplitOperator.IsNonEmpt
13645
13647
  this.Clear=function(){this.Data.Menu=[];this.Data.Position=JSPopMenu.POSITION_ID.RIGHT_MENU_ID;this.ClickCallback=null;if(!this.RootDOM)return;document.body.removeChild(this.RootDOM);this.RootDOM=null;this.TBodyDOM=null;for(var i=0;i<this.ArySubRootDOM.length;++i){document.body.removeChild(this.ArySubRootDOM[i]);}this.ArySubRootDOM=[];};this.CreateMenu=function(parentItem,item){var _this77=this;var trDom=document.createElement("tr");trDom.className='UMyChart_MenuItem_Tr';if(item.Disable===true)trDom.classList.add('UMyChart_DrawTool_Disable_Tr');var prtTdDom=null;for(var i=0;i<this.AryTDClassName.length;++i){var tdDom=document.createElement("td");tdDom.className=this.AryTDClassName[i];if(i==0)//图标
13646
13648
  {if(item.Checked){var spanDom=document.createElement("span");spanDom.className=this.CheckedClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}else if(i==1)//内容
13647
13649
  {tdDom.innerText=item.Name;}else if(i==2)//快捷方式
13648
- {}else if(i==3)//箭头
13650
+ {if(item.Text)tdDom.innerText=item.Text;}else if(i==3)//箭头
13649
13651
  {if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu)){var spanDom=document.createElement("span");spanDom.className=this.RightArrowClassName;spanDom.style["font-size"]="10px";tdDom.appendChild(spanDom);}}trDom.appendChild(tdDom);}if(IFrameSplitOperator.IsNonEmptyArray(item.SubMenu))//子菜单
13650
13652
  {var subRoot=document.createElement("div");subRoot.className="UMyChart_PopSubMenu";var subTable=document.createElement("table");subTable.className="UMyChart_PopMenu_Table";subRoot.appendChild(subTable);var subTbody=document.createElement("tbody");subTbody.className="UMyChart_PopMenu_TBody";subTable.appendChild(subTbody);var subRootData={Root:subRoot,TBody:subTbody,Table:subTable};subRoot.JSMenuData=subRootData;var preTrDom=null;for(var i=0;i<item.SubMenu.length;++i){var subItem=item.SubMenu[i];if(subItem.Name==JSPopMenu.SEPARATOR_LINE_NAME){var trSeparator=this.CreateSeparatorTr();if(trSeparator)subTbody.appendChild(trSeparator);continue;}var subTrDom=this.CreateMenu(subRootData,subItem);preTrDom=subTrDom;subTbody.appendChild(subTrDom);}trDom.onmouseover=function(e){_this77.OnMouseOver(e,parentItem,trDom,subRoot);};document.body.appendChild(subRoot);this.ArySubRootDOM.push(subRoot);}else{if(item.Disable===true){}else{trDom.onmousedown=function(e){_this77.OnClickMenu(e,item,false);};//菜单点击
13651
13653
  trDom.onmouseover=function(e){_this77.OnMouseOver(e,parentItem);};}}return trDom;};this.CreateSeparatorTr=function(){var trSeparator=document.createElement("tr");trSeparator.className='UMyChart_MenuItem_Tr_Separator';var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Status_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);var tdDom=document.createElement("td");tdDom.className="UMyChart_MenuItem_Td_Separator";trSeparator.appendChild(tdDom);return trSeparator;};//弹tab菜单
@@ -13775,7 +13777,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13775
13777
  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);};}/********************************************************************************
13776
13778
  * 版本信息输出
13777
13779
  *
13778
- */var HQCHART_VERSION="1.1.13724";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();//把给外界调用的方法暴露出来
13780
+ */var HQCHART_VERSION="1.1.13727";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();//把给外界调用的方法暴露出来
13779
13781
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13780
13782
  // BaseIndex:BaseIndex,
13781
13783
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13725",
3
+ "version": "1.1.13728",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -12230,8 +12230,11 @@ function AverageWidthFrame()
12230
12230
  var pixelTatio = GetDevicePixelRatio();
12231
12231
  var defaultTextHeight=18*pixelTatio;
12232
12232
  var textHeight=defaultTextHeight;
12233
+ var y;
12234
+ if (item.Value=="Top") y=top;
12235
+ else if (item.Value=="Bottom") y=bottom;
12236
+ else y = this.GetYFromData(item.Value);
12233
12237
 
12234
- var y = this.GetYFromData(item.Value);
12235
12238
  var position=0;
12236
12239
  var emptyBGColor;
12237
12240
  if (item.ExtendData && item.ExtendData.Custom)
@@ -13770,6 +13773,7 @@ function MinuteFrame()
13770
13773
  {
13771
13774
  case 0:
13772
13775
  case 1:
13776
+ case 10://自定义的
13773
13777
  this.DrawCustomItem(item); //自定义刻度
13774
13778
  break;
13775
13779
  }
@@ -16408,6 +16412,7 @@ function KLineFrame()
16408
16412
  case 2: //当前屏最后一个K线价格刻度
16409
16413
  case 3: //主图K线涨幅刻度
16410
16414
  case 4: //叠加K线涨幅刻度
16415
+ case 10://自定义的
16411
16416
  this.DrawCustomItem(item, mapTextRect);
16412
16417
  break;
16413
16418
  }
@@ -129,7 +129,7 @@ function JSPopMenu()
129
129
  }
130
130
  else if (i==2) //快捷方式
131
131
  {
132
-
132
+ if (item.Text) tdDom.innerText=item.Text;
133
133
  }
134
134
  else if (i==3) //箭头
135
135
  {
@@ -1347,7 +1347,7 @@ function JSReportChartContainer(uielement)
1347
1347
  {
1348
1348
  //0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本 16=涨停价 17=跌停价
1349
1349
  //18=内盘 19=外盘 20=现量 21=涨幅% 22=涨跌 23=换手率% 24=振幅% 25=流通市值 26=总市值
1350
- //30=全局扩展数据 31=当前板块扩展数据
1350
+ //30=全局扩展数据 31=当前板块扩展数据 36=日期字段
1351
1351
 
1352
1352
  //88=价格颜色类型
1353
1353
 
@@ -3248,6 +3248,7 @@ function JSReportChartContainer(uielement)
3248
3248
  {
3249
3249
  var item=tabItem.ArySubMenu[i];
3250
3250
  var menuItem={ Name:item.Title, Data:{ ID:item.CommandID, Args:[item.ID]} };
3251
+ if (item.Text) menuItem.Text=item.Text;
3251
3252
 
3252
3253
  aryMenu.push(menuItem);
3253
3254
  }
@@ -16155,8 +16155,11 @@ function AverageWidthFrame()
16155
16155
  var pixelTatio = GetDevicePixelRatio();
16156
16156
  var defaultTextHeight=18*pixelTatio;
16157
16157
  var textHeight=defaultTextHeight;
16158
+ var y;
16159
+ if (item.Value=="Top") y=top;
16160
+ else if (item.Value=="Bottom") y=bottom;
16161
+ else y = this.GetYFromData(item.Value);
16158
16162
 
16159
- var y = this.GetYFromData(item.Value);
16160
16163
  var position=0;
16161
16164
  var emptyBGColor;
16162
16165
  if (item.ExtendData && item.ExtendData.Custom)
@@ -17695,6 +17698,7 @@ function MinuteFrame()
17695
17698
  {
17696
17699
  case 0:
17697
17700
  case 1:
17701
+ case 10://自定义的
17698
17702
  this.DrawCustomItem(item); //自定义刻度
17699
17703
  break;
17700
17704
  }
@@ -20333,6 +20337,7 @@ function KLineFrame()
20333
20337
  case 2: //当前屏最后一个K线价格刻度
20334
20338
  case 3: //主图K线涨幅刻度
20335
20339
  case 4: //叠加K线涨幅刻度
20340
+ case 10://自定义的
20336
20341
  this.DrawCustomItem(item, mapTextRect);
20337
20342
  break;
20338
20343
  }
@@ -128152,7 +128157,7 @@ function JSReportChartContainer(uielement)
128152
128157
  {
128153
128158
  //0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本 16=涨停价 17=跌停价
128154
128159
  //18=内盘 19=外盘 20=现量 21=涨幅% 22=涨跌 23=换手率% 24=振幅% 25=流通市值 26=总市值
128155
- //30=全局扩展数据 31=当前板块扩展数据
128160
+ //30=全局扩展数据 31=当前板块扩展数据 36=日期字段
128156
128161
 
128157
128162
  //88=价格颜色类型
128158
128163
 
@@ -130053,6 +130058,7 @@ function JSReportChartContainer(uielement)
130053
130058
  {
130054
130059
  var item=tabItem.ArySubMenu[i];
130055
130060
  var menuItem={ Name:item.Title, Data:{ ID:item.CommandID, Args:[item.ID]} };
130061
+ if (item.Text) menuItem.Text=item.Text;
130056
130062
 
130057
130063
  aryMenu.push(menuItem);
130058
130064
  }
@@ -138326,7 +138332,7 @@ function ScrollBarBGChart()
138326
138332
 
138327
138333
 
138328
138334
 
138329
- var HQCHART_VERSION="1.1.13724";
138335
+ var HQCHART_VERSION="1.1.13727";
138330
138336
 
138331
138337
  function PrintHQChartVersion()
138332
138338
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13724";
8
+ var HQCHART_VERSION="1.1.13727";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -16199,8 +16199,11 @@ function AverageWidthFrame()
16199
16199
  var pixelTatio = GetDevicePixelRatio();
16200
16200
  var defaultTextHeight=18*pixelTatio;
16201
16201
  var textHeight=defaultTextHeight;
16202
+ var y;
16203
+ if (item.Value=="Top") y=top;
16204
+ else if (item.Value=="Bottom") y=bottom;
16205
+ else y = this.GetYFromData(item.Value);
16202
16206
 
16203
- var y = this.GetYFromData(item.Value);
16204
16207
  var position=0;
16205
16208
  var emptyBGColor;
16206
16209
  if (item.ExtendData && item.ExtendData.Custom)
@@ -17739,6 +17742,7 @@ function MinuteFrame()
17739
17742
  {
17740
17743
  case 0:
17741
17744
  case 1:
17745
+ case 10://自定义的
17742
17746
  this.DrawCustomItem(item); //自定义刻度
17743
17747
  break;
17744
17748
  }
@@ -20377,6 +20381,7 @@ function KLineFrame()
20377
20381
  case 2: //当前屏最后一个K线价格刻度
20378
20382
  case 3: //主图K线涨幅刻度
20379
20383
  case 4: //叠加K线涨幅刻度
20384
+ case 10://自定义的
20380
20385
  this.DrawCustomItem(item, mapTextRect);
20381
20386
  break;
20382
20387
  }
@@ -128196,7 +128201,7 @@ function JSReportChartContainer(uielement)
128196
128201
  {
128197
128202
  //0=证券代码 1=股票名称 2=昨收 3=开 4=高 5=低 6=收 7=成交量 8=成交金额, 9=买价 10=买量 11=卖价 12=卖量 13=均价 14=流通股 15=总股本 16=涨停价 17=跌停价
128198
128203
  //18=内盘 19=外盘 20=现量 21=涨幅% 22=涨跌 23=换手率% 24=振幅% 25=流通市值 26=总市值
128199
- //30=全局扩展数据 31=当前板块扩展数据
128204
+ //30=全局扩展数据 31=当前板块扩展数据 36=日期字段
128200
128205
 
128201
128206
  //88=价格颜色类型
128202
128207
 
@@ -130097,6 +130102,7 @@ function JSReportChartContainer(uielement)
130097
130102
  {
130098
130103
  var item=tabItem.ArySubMenu[i];
130099
130104
  var menuItem={ Name:item.Title, Data:{ ID:item.CommandID, Args:[item.ID]} };
130105
+ if (item.Text) menuItem.Text=item.Text;
130100
130106
 
130101
130107
  aryMenu.push(menuItem);
130102
130108
  }
@@ -140900,7 +140906,7 @@ function JSPopMenu()
140900
140906
  }
140901
140907
  else if (i==2) //快捷方式
140902
140908
  {
140903
-
140909
+ if (item.Text) tdDom.innerText=item.Text;
140904
140910
  }
140905
140911
  else if (i==3) //箭头
140906
140912
  {
@@ -142857,7 +142863,7 @@ function HQChartScriptWorker()
142857
142863
 
142858
142864
 
142859
142865
 
142860
- var HQCHART_VERSION="1.1.13724";
142866
+ var HQCHART_VERSION="1.1.13727";
142861
142867
 
142862
142868
  function PrintHQChartVersion()
142863
142869
  {