hqchart 1.1.15319 → 1.1.15326

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.
@@ -2900,7 +2900,7 @@ var textRightPrev=null;//上一次刻度输出右边x坐标
2900
2900
  for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];var x=null;if(mapX&&mapX.has(item.Value))x=mapX.get(item.Value);else x=this.GetXFromIndex(item.Value);if(item.XOffset&&item.XOffset[0]){var subItem=item.XOffset[0];if(subItem.Position===1){x-=this.DataWidth/2;x-=this.DistanceWidth/2;}else if(subItem.Position===2){x+=this.DataWidth/2;x+=this.DistanceWidth/2;}}if(x>right)break;if(xPrev!=null&&Math.abs(x-xPrev)<this.MinXDistance)continue;var item=this.VerticalInfo[i];var xFixed=ToFixedPoint(x);if(this.IsShowXLine){if(item.LineType==2)//虚线
2901
2901
  {this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;if(item.LineDash)this.Canvas.setLineDash(item.LineDash);else this.Canvas.setLineDash([5*pixelRatio,5*pixelRatio]);this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else if(item.LineType==3){}else if(item.LineType>0)//实线
2902
2902
  {if(g_JSChartResource.FrameXLineDash){this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.setLineDash(g_JSChartResource.FrameXLineDash);//虚线
2903
- this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&this.DrawDayVertical){this.DrawDayVertical(item,x,border);}if(item.Message[0]!=null&&this.ChartBorder.Bottom>5*pixelRatio){if(IFrameSplitOperator.IsObject(item.Message[0])){var textObj=item.Message[0];if(!textObj.Font)textObj.Font=item.Font;if(!textObj.TextColor)textObj.TextColor=item.TextColor;var drawInfo=this.GetMultiLineVTextSize(textObj);if(drawInfo){drawInfo.XCenter=x;var rtBottom={Left:0,Right:right,Top:bottom+2*pixelRatio,Bottom:border.Height};rtBottom.Width=rtBottom.Right-rtBottom.Left;rtBottom.Height=rtBottom.Bottom-rtBottom.Top;drawInfo.RectBottom=rtBottom;drawInfo.TextRightPrev=textRightPrev;this.DrawMultiLineVText(drawInfo);if(drawInfo.TextRight)textRightPrev=drawInfo.TextRight;}}else{if(item.Font)this.Canvas.font=item.Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(item.Message[0]).width;var textHeight=this.Canvas.measureText("擎").width;if(bottomTextExtend&&bottomTextExtend.Align==1){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else{if(x<testWidth/2){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else if(x+testWidth/2>=this.ChartBorder.GetChartWidth()){this.Canvas.textAlign="right";this.Canvas.textBaseline="top";textLeft=x-testWidth;}else{this.Canvas.textAlign="center";this.Canvas.textBaseline="top";textLeft=x-testWidth/2;}}if(textRightPrev==null||textLeft>textRightPrev){var yText=bottom;if(item.LineType==3){var lineLength=this.ShortXLineLength*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2*pixelRatio;}if(bottomLineExtend){if(bottomLineExtend.Mode===1){if(item.Value>1){if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,bottom);this.Canvas.lineTo(xFixed,border.ChartHeight);this.Canvas.stroke();x+=1;}}else if(bottomLineExtend.Mode===2){if(bottomLineExtend.Width>=1){var lineLength=bottomLineExtend.Width;if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2;}}}//item.TextBGColor="rgb(0,255,0)";
2903
+ this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();this.Canvas.setLineDash([]);}else{this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,top);this.Canvas.lineTo(xFixed,bottom);this.Canvas.stroke();}}}if(item.BG&&this.DrawDayVertical)this.DrawDayVertical(item,x,border);if(item.VBG&&this.DrawBGVertical)this.DrawBGVertical(item,x,border);if(item.Message[0]!=null&&this.ChartBorder.Bottom>5*pixelRatio){if(IFrameSplitOperator.IsObject(item.Message[0])){var textObj=item.Message[0];if(!textObj.Font)textObj.Font=item.Font;if(!textObj.TextColor)textObj.TextColor=item.TextColor;var drawInfo=this.GetMultiLineVTextSize(textObj);if(drawInfo){drawInfo.XCenter=x;var rtBottom={Left:0,Right:right,Top:bottom+2*pixelRatio,Bottom:border.Height};rtBottom.Width=rtBottom.Right-rtBottom.Left;rtBottom.Height=rtBottom.Bottom-rtBottom.Top;drawInfo.RectBottom=rtBottom;drawInfo.TextRightPrev=textRightPrev;this.DrawMultiLineVText(drawInfo);if(drawInfo.TextRight)textRightPrev=drawInfo.TextRight;}}else{if(item.Font)this.Canvas.font=item.Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(item.Message[0]).width;var textHeight=this.Canvas.measureText("擎").width;if(bottomTextExtend&&bottomTextExtend.Align==1){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else{if(x<testWidth/2){this.Canvas.textAlign="left";this.Canvas.textBaseline="top";textLeft=x;}else if(x+testWidth/2>=this.ChartBorder.GetChartWidth()){this.Canvas.textAlign="right";this.Canvas.textBaseline="top";textLeft=x-testWidth;}else{this.Canvas.textAlign="center";this.Canvas.textBaseline="top";textLeft=x-testWidth/2;}}if(textRightPrev==null||textLeft>textRightPrev){var yText=bottom;if(item.LineType==3){var lineLength=this.ShortXLineLength*pixelRatio;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2*pixelRatio;}if(bottomLineExtend){if(bottomLineExtend.Mode===1){if(item.Value>1){if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,bottom);this.Canvas.lineTo(xFixed,border.ChartHeight);this.Canvas.stroke();x+=1;}}else if(bottomLineExtend.Mode===2){if(bottomLineExtend.Width>=1){var lineLength=bottomLineExtend.Width;if(bottomLineExtend.Color)this.Canvas.strokeStyle=bottomLineExtend.Color;this.Canvas.beginPath();this.Canvas.moveTo(xFixed,yText);this.Canvas.lineTo(xFixed,yText+lineLength);this.Canvas.stroke();yText+=lineLength+2;}}}//item.TextBGColor="rgb(0,255,0)";
2904
2904
  if(item.TextBGColor)//文字背景色
2905
2905
  {var rtText={Left:textLeft,Top:yText+this.XBottomOffset,Width:testWidth,Height:textHeight};this.Canvas.fillStyle=item.TextBGColor;this.Canvas.fillRect(rtText.Left-1,rtText.Top,rtText.Width+2,rtText.Height);}this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(this.VerticalInfo[i].Message[0],x,yText+this.XBottomOffset);textRightPrev=textLeft+testWidth;}}}xPrev=x;}};//{Font:, AryText:[ { AryText:[{ Text:, Color: }], }, ] }
2906
2906
  this.GetMultiLineVTextSize=function(obj){if(obj.Font)this.Canvas.font=obj.Font;var lineHeight=this.Canvas.measureText('擎').width;var aryLine=[];for(var i=0;i<obj.AryText.length;++i){var item=obj.AryText[i];var lineInfo={Width:0,Height:lineHeight,AryText:[],Align:2,Margin:{Top:1,Bottom:1},YOffset:-1};if(item.Margin){if(IFrameSplitOperator.IsNumber(item.Margin.Top))lineInfo.Margin.Top=item.Margin.Top;if(IFrameSplitOperator.IsNumber(item.Margin.Bottom))lineInfo.Margin.Bottom=item.Margin.Bottom;}if(IFrameSplitOperator.IsNumber(item.YOffset))lineInfo.YOffset=item.YOffset;if(IFrameSplitOperator.IsNumber(item.Align))lineInfo.Align=item.Align;lineInfo.Height=lineHeight+lineInfo.Margin.Top+lineInfo.Margin.Bottom;for(var j=0;j<item.AryText.length;++j){var subItem=item.AryText[j];if(!subItem||!subItem.Text)continue;var width=this.Canvas.measureText(subItem.Text).width;var textItem={Width:width,Text:subItem.Text,Color:obj.TextColor,Margin:{Left:0,Right:0}};if(subItem.Color)textItem.Color=subItem.Color;if(subItem.Margin){if(IFrameSplitOperator.IsNumber(subItem.Margin.Left))textItem.Margin.Left=subItem.Margin.Left;if(IFrameSplitOperator.IsNumber(subItem.Margin.Right))textItem.Margin.Right=subItem.Margin.Right;}textItem.Width=width+textItem.Margin.Right+textItem.Margin.Left;lineInfo.Width+=textItem.Width;lineInfo.AryText.push(textItem);}aryLine.push(lineInfo);}if(aryLine.length<=0)return null;var width=0,height=0;for(var i=0;i<aryLine.length;++i){var item=aryLine[i];if(width<item.Width)width=item.Width;height+=item.Height;}if(width<=0||height<=0)return null;var drawInfo={Width:width,Height:height,AryLine:aryLine,Align:2};//Align 1=left 2=center 3=right
@@ -3000,7 +3000,7 @@ var top=ToFixedPoint(border.Top);var bottom=ToFixedPoint(border.Bottom);this.Can
3000
3000
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX);if(!event||!event.Callback)return;var sendData={Symbol:symbol,XIndex:xIndex,MinuteTimeStringData:g_MinuteTimeStringData};event.Callback(event,sendData,this);xIndex=sendData.XIndex;if(xIndex<0)return;var border=this.ChartBorder.GetBorder();var x=this.GetXFromIndex(xIndex);var rtNight={Left:border.Left,Top:border.TopEx,Right:x,Bottom:border.Bottom};rtNight.Width=rtNight.Right-rtNight.Left;rtNight.Height=rtNight.Bottom-rtNight.Top;this.Canvas.fillStyle=this.NightDayConfig.NightBGColor;this.Canvas.fillRect(rtNight.Left,rtNight.Top,rtNight.Width,rtNight.Height);if(this.Identify!=0)return;//显示 日盘夜盘文字
3001
3001
  this.Canvas.font=this.NightDayConfig.Font;this.Canvas.textBaseline="bottom";this.Canvas.textAlign='left';var aryTitle=[{Title:"夜盘",Position:1,Config:this.NightDayConfig.Night},{Title:"日盘",Position:0,Config:this.NightDayConfig.Day}];var textHeight=this.Canvas.measureText("擎").width;for(var i=0;i<aryTitle.length;++i){var item=aryTitle[i];var text=g_JSChartLocalization.GetText(item.Title,this.HQChart.LanguageID);var testWidth=this.Canvas.measureText(text).width;var rtItem={Width:testWidth+item.Config.Margin.Left+item.Config.Margin.Right,Height:textHeight+item.Config.Margin.Top+item.Config.Margin.Bottom,Bottom:border.Bottom};rtItem.Top=rtItem.Bottom-rtItem.Height;if(item.Position===1){rtItem.Right=x-1;rtItem.Left=rtItem.Right-rtItem.Width;}else{rtItem.Left=x+1;rtItem.Right=rtItem.Left+rtItem.Width;}if(item.Config.BGColor){this.Canvas.fillStyle=item.Config.BGColor;this.Canvas.fillRect(rtItem.Left,rtItem.Top,rtItem.Width,rtItem.Height);}if(item.Config.BorderColor){this.Canvas.strokeStyle=item.Config.BorderColor;this.Canvas.strokeRect(ToFixedPoint(rtItem.Left),ToFixedPoint(rtItem.Top),ToFixedRect(rtItem.Width),ToFixedRect(rtItem.Height));}this.Canvas.fillStyle=item.Config.Color;this.Canvas.fillText(text,rtItem.Left+item.Config.Margin.Left,rtItem.Bottom-item.Config.Margin.Bottom);}};//选中的画图工具X轴坐标信息
3002
3002
  this.DrawPictureXCoordinate=function(drawPicture,range,option){if(this.IsHScreen)return;if(!range)return;if(!IFrameSplitOperator.IsNonEmptyArray(range.Points))return;var border=this.GetBorder();var left=border.Left;var right=border.Right;this.Canvas.font=this.DrawPicture.Font;var fontHeight=this.GetFontHeight();if(range.X){var xRange=range.X;var xLeft=xRange.Min.X;var xRight=xRange.Max.X;if(xLeft<left)xLeft=left;if(xRight>right)xRight=right;this.Canvas.fillStyle=this.DrawPicture.BGColor;this.Canvas.fillRect(xLeft,border.Bottom,xRight-xLeft,fontHeight);}for(var i=0;i<range.Points.length;++i){var item=range.Points[i];if(item.X<left||item.X>right)continue;var index=parseInt(this.GetXData(item.X));var kItem=this.GetKItem(index,option);if(kItem){//var text=IFrameSplitOperator.FormatDateString(kItem.Date,null);
3003
- var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex,option){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;if(currentIndex<this.Data.Data.length){return this.Data.Data[currentIndex];}else{var kItem=this.Data.Data[this.Data.Data.length-1];var xDatetime=g_MinuteTimeStringData.GetTimeData(option.Symbol);var index=currentIndex%xDatetime.length;var timeItem=xDatetime[index];return{Date:kItem.Date,Time:timeItem};}};this.DrawDayVertical=function(dayItem,x,border){if(!dayItem.BG)return;var bgItem=dayItem.BG;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var maxWidth=xEnd-xStart;var bgHeight=this.ChartBorder.Bottom;if(IFrameSplitOperator.IsNumber(bgItem.Height))bgHeight=bgItem.Height;if(bgItem.Color){this.Canvas.fillStyle=bgItem.Color;var rtBG={Left:xStart,Width:maxWidth,Top:border.Bottom,Height:bgHeight};this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText))//[ [{Text:, Color:},], []]
3003
+ var text=IFrameSplitOperator.FormatTimeString(kItem.Time,"HH:MM");var textWidth=this.Canvas.measureText(text).width+2;var textLeft=item.X-textWidth/2;if(textLeft<left)textLeft=left;this.Canvas.fillStyle=this.DrawPicture.TextBGColor;this.Canvas.fillRect(textLeft,border.Bottom,textWidth,fontHeight);this.Canvas.fillStyle=this.DrawPicture.TextColor;var yCenter=border.Bottom+fontHeight;this.Canvas.fillText(text,textLeft+1,yCenter);}}};this.GetKItem=function(currentIndex,option){if(!this.Data)return null;if(!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return null;if(currentIndex<this.Data.Data.length){return this.Data.Data[currentIndex];}else{var kItem=this.Data.Data[this.Data.Data.length-1];var xDatetime=g_MinuteTimeStringData.GetTimeData(option.Symbol);var index=currentIndex%xDatetime.length;var timeItem=xDatetime[index];return{Date:kItem.Date,Time:timeItem};}};this.DrawBGVertical=function(dayItem,x,border){if(!dayItem.VBG)return;var bgItem=dayItem.VBG;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var maxWidth=xEnd-xStart;if(bgItem.Color){this.Canvas.fillStyle=bgItem.Color;var rtBG={Left:xStart,Width:maxWidth,Top:border.TopEx,Bottom:border.Bottom};rtBG.Height=rtBG.Bottom-rtBG.Top;rtBG.Right=rtBG.Left+rtBG.Width;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}};this.DrawDayVertical=function(dayItem,x,border){if(!dayItem.BG)return;var bgItem=dayItem.BG;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var maxWidth=xEnd-xStart;var bgHeight=this.ChartBorder.Bottom;if(IFrameSplitOperator.IsNumber(bgItem.Height))bgHeight=bgItem.Height;if(bgItem.Color){this.Canvas.fillStyle=bgItem.Color;var rtBG={Left:xStart,Width:maxWidth,Top:border.Bottom,Height:bgHeight};this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText))//[ [{Text:, Color:},], []]
3004
3004
  {if(dayItem.Font)this.Canvas.font=dayItem.Font;this.Canvas.textAlign="left";this.Canvas.textBaseline="top";var yText=border.Bottom+2;var lineHeight=this.Canvas.measureText("擎").width+2;for(var i=0,j=0;i<dayItem.AryText.length;++i){var aryText=dayItem.AryText[i];var itemWidth=0;var aryOut=[];for(j=0;j<aryText.length;++j){var item=aryText[j];var textWidth=this.Canvas.measureText(item.Text).width;if(itemWidth+textWidth>maxWidth)break;var newItem={Text:item.Text,Width:textWidth,Color:item.Color,Space:item.Space};itemWidth+=textWidth;item.Width=textWidth;if(item.Space>=1)itemWidth+=item.Space;aryOut.push(newItem);}var xText=xStart+(maxWidth-itemWidth)/2;for(var j=0;j<aryOut.length;++j){var item=aryOut[j];if(!IFrameSplitOperator.IsNumber(item.Width))break;if(item.Color)this.Canvas.fillStyle=item.Color;else if(dayItem.TextColor)this.Canvas.fillStyle=dayItem.TextColor;this.Canvas.fillText(item.Text,xText,yText);xText+=item.Width;if(item.Space>=1)xText+=item.Space;}yText+=lineHeight;}}};//分割x,y轴坐标信息
3005
3005
  this.SplitXYCoordinate=function(){if(this.XYSplit==false){//计算自定义刻度
3006
3006
  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轴数值
@@ -4919,14 +4919,17 @@ this.Price;this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize)retur
4919
4919
  {if(IFrameSplitOperator.IsNonEmptyArray(this.Line.LineDash))this.Canvas.setLineDash(this.Line.LineDash);else this.Canvas.setLineDash([3,5]);//虚线
4920
4920
  }if(IFrameSplitOperator.IsNumber(this.Line.Width))this.Canvas.lineWidth=this.Line.Width;var x=left+textWidth;this.Canvas.strokeStyle=this.Line.Color;this.Canvas.beginPath();this.Canvas.moveTo(x,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));this.Canvas.stroke();}this.Canvas.restore();};this.GetMaxMin=function(){var range={Min:null,Max:null};if(IFrameSplitOperator.IsNumber(this.Price)){range.Min=this.Price;range.Max=this.Price;}return range;};}// 柱子集合 支持横屏
4921
4921
  function ChartMultiBar(){this.newMethod=IChartPainting;//派生
4922
- this.newMethod();delete this.newMethod;this.ClassName="ChartMultiBar";this.Bars=[];// [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , Type: 0 实心 1 空心 }, ]
4922
+ this.newMethod();delete this.newMethod;this.ClassName="ChartMultiBar";this.Bars=[];// [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , AdWidth:{ Type: 高级宽度设置 Type:1=柱子宽度, 2=柱子+间距宽度, Value:倍数 } , Type: 0 实心 1 空心 }, ]
4923
4923
  this.IsHScreen=false;this.MapCache=null;//key=date/date-time value={ Data:[] }
4924
- this.GetKValue=ChartData.GetKValue;this.GetItem=function(kItem){if(!this.MapCache||this.MapCache.size<=0)return null;var key=this.BuildKey(kItem);if(!this.MapCache.has(key))return null;return this.MapCache.get(key);};this.BuildCacheData=function(){var mapData=new _map2.default();this.MapCache=mapData;if(!IFrameSplitOperator.IsNonEmptyArray(this.Bars))return;for(var i=0;i<this.Bars.length;++i){var groupItem=this.Bars[i];if(!groupItem||!IFrameSplitOperator.IsNonEmptyArray(groupItem.Point))continue;var clrConfig={Color:groupItem.Color,BGColor:null,Width:null,Name:groupItem.Name,Type:0};if(IFrameSplitOperator.IsNumber(groupItem.Width))clrConfig.Width=groupItem.Width;if(IFrameSplitOperator.IsNumber(groupItem.Type))clrConfig.Type=groupItem.Type;if(groupItem.BorderColor)clrConfig.BorderColor=groupItem.BorderColor;for(var j=0;j<groupItem.Point.length;++j){var point=groupItem.Point[j];var key=this.BuildKey(point);var item={Data:point,ColorConfig:clrConfig};if(mapData.has(key)){var mapItem=mapData.get(key);mapItem.Data.push(item);}else{mapData.set(key,{Data:[item]});}}}};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//k线数据
4924
+ this.GetKValue=ChartData.GetKValue;this.GetItem=function(kItem){if(!this.MapCache||this.MapCache.size<=0)return null;var key=this.BuildKey(kItem);if(!this.MapCache.has(key))return null;return this.MapCache.get(key);};this.BuildCacheData=function(){var mapData=new _map2.default();this.MapCache=mapData;if(!IFrameSplitOperator.IsNonEmptyArray(this.Bars))return;for(var i=0;i<this.Bars.length;++i){var groupItem=this.Bars[i];if(!groupItem||!IFrameSplitOperator.IsNonEmptyArray(groupItem.Point))continue;var clrConfig={Color:groupItem.Color,BGColor:null,Width:null,AdWidth:null,Name:groupItem.Name,Type:0};if(IFrameSplitOperator.IsNumber(groupItem.Width))clrConfig.Width=groupItem.Width;if(groupItem.AdWidth)clrConfig.AdWidth=groupItem.AdWidth;if(IFrameSplitOperator.IsNumber(groupItem.Type))clrConfig.Type=groupItem.Type;if(groupItem.BorderColor)clrConfig.BorderColor=groupItem.BorderColor;for(var j=0;j<groupItem.Point.length;++j){var point=groupItem.Point[j];var key=this.BuildKey(point);var item={Data:point,ColorConfig:clrConfig};if(mapData.has(key)){var mapItem=mapData.get(key);mapItem.Data.push(item);}else{mapData.set(key,{Data:[item]});}}}};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//k线数据
4925
4925
  if(!IFrameSplitOperator.IsNonEmptyArray(this.Bars))return;if(!this.MapCache||this.MapCache.size<=0)return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var isMinute=this.IsMinuteFrame();var border=this.GetBorder();if(this.IsHScreen){var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var chartLeft=border.TopEx;}else{var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var chartLeft=border.LeftEx;}//计算所有柱子位置
4926
- var mapBar=new _map2.default();for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];var key=this.BuildKey(kItem);if(!this.MapCache.has(key))continue;var mapItem=this.MapCache.get(key);if(!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data))continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}this.CalculateItem(mapItem,kItem,x,mapBar);}if(mapBar.size<=0)return;this.Canvas.save();this.ClipClient(this.IsHScreen);this.DrawAllBar(mapBar);this.Canvas.restore();};this.CalculateItem=function(groupItem,kItem,x,mapBar){for(var i=0;i<groupItem.Data.length;++i){var item=groupItem.Data[i];var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=this.GetKValue(kItem,item.Data.Value);if(!IFrameSplitOperator.IsNumber(value))continue;var value2=item.Data.Value2;if(IFrameSplitOperator.IsString(item.Data.Value2))value2=this.GetKValue(kItem,item.Data.Value2);if(!IFrameSplitOperator.IsNumber(value2))continue;var y=this.ChartFrame.GetYFromData(value,false);var y2=this.ChartFrame.GetYFromData(value2,false);var strConfig=(0,_stringify2.default)(item.ColorConfig);if(!mapBar.has(strConfig))mapBar.set(strConfig,{AryBar:[]});var mapItem=mapBar.get(strConfig);mapItem.AryBar.push({X:x,Y:y,Y2:y2,Data:item});}};this.DrawAllBar=function(mapBar){var pixelRatio=GetDevicePixelRatio();var dataWidth=this.ChartFrame.DataWidth;var _iteratorNormalCompletion8=true;var _didIteratorError8=false;var _iteratorError8=undefined;try{for(var _iterator8=(0,_getIterator3.default)(mapBar),_step8;!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done);_iteratorNormalCompletion8=true){var mapItem=_step8.value;var aryBar=mapItem[1].AryBar;if(!IFrameSplitOperator.IsNonEmptyArray(aryBar))continue;var config=null;var path=new Path2D();var pathBG=new Path2D();var count=0;var drawType=-1;//1=直线 2=实心 3=空心 4=边框+背景
4926
+ var mapBar=new _map2.default();for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];var key=this.BuildKey(kItem);if(!this.MapCache.has(key))continue;var mapItem=this.MapCache.get(key);if(!IFrameSplitOperator.IsNonEmptyArray(mapItem.Data))continue;if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}this.CalculateItem(mapItem,kItem,x,mapBar);}if(mapBar.size<=0)return;this.Canvas.save();this.ClipClient(this.IsHScreen);this.DrawAllBar(mapBar);this.Canvas.restore();};this.CalculateItem=function(groupItem,kItem,x,mapBar){for(var i=0;i<groupItem.Data.length;++i){var item=groupItem.Data[i];var value=item.Data.Value;if(IFrameSplitOperator.IsString(item.Data.Value))value=this.GetKValue(kItem,item.Data.Value);if(!IFrameSplitOperator.IsNumber(value))continue;var value2=item.Data.Value2;if(IFrameSplitOperator.IsString(item.Data.Value2))value2=this.GetKValue(kItem,item.Data.Value2);if(!IFrameSplitOperator.IsNumber(value2))continue;var y=this.ChartFrame.GetYFromData(value,false);var y2=this.ChartFrame.GetYFromData(value2,false);var strConfig=(0,_stringify2.default)(item.ColorConfig);if(!mapBar.has(strConfig))mapBar.set(strConfig,{AryBar:[]});var mapItem=mapBar.get(strConfig);mapItem.AryBar.push({X:x,Y:y,Y2:y2,Data:item});}};this.DrawAllBar=function(mapBar){var pixelRatio=GetDevicePixelRatio();var dataWidth=this.ChartFrame.DataWidth;//柱子宽度
4927
+ var distanceWidth=this.ChartFrame.DistanceWidth;//间距
4928
+ var _iteratorNormalCompletion8=true;var _didIteratorError8=false;var _iteratorError8=undefined;try{for(var _iterator8=(0,_getIterator3.default)(mapBar),_step8;!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done);_iteratorNormalCompletion8=true){var mapItem=_step8.value;var aryBar=mapItem[1].AryBar;if(!IFrameSplitOperator.IsNonEmptyArray(aryBar))continue;var config=null;var path=new Path2D();var pathBG=new Path2D();var count=0;var drawType=-1;//1=直线 2=实心 3=空心 4=边框+背景
4927
4929
  var barWidth=dataWidth;//默认K线宽度
4928
4930
  this.Canvas.beginPath();for(var i=0;i<aryBar.length;++i){var item=aryBar[i];if(!config){barWidth=dataWidth;//默认K线宽度
4929
- config=item.Data.ColorConfig;if(IFrameSplitOperator.IsNumber(config.Width))barWidth=config.Width*pixelRatio;if(barWidth>4){if(config.Type==0)drawType=2;//实心
4931
+ config=item.Data.ColorConfig;if(config.AdWidth&&IFrameSplitOperator.IsNumber(config.AdWidth.Value)&&IFrameSplitOperator.IsNumber(config.AdWidth.Type))//高级宽度设置 Type:1, 2, Value:倍数
4932
+ {var type=config.AdWidth.Type;var value=config.AdWidth.Value;if(type==1)barWidth=dataWidth*value;else if(type==2)barWidth=(dataWidth+distanceWidth)*value;}else if(IFrameSplitOperator.IsNumber(config.Width)){barWidth=config.Width*pixelRatio;}if(barWidth>4){if(config.Type==0)drawType=2;//实心
4930
4933
  else if(config.Type==1)drawType=3;//空心
4931
4934
  else if(config.Type==2)drawType=4;//边框+背景
4932
4935
  else continue;}else//太细了, 直线
@@ -15741,7 +15744,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15741
15744
  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);};}/********************************************************************************
15742
15745
  * 版本信息输出
15743
15746
  *
15744
- */var HQCHART_VERSION="1.1.15318";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();//把给外界调用的方法暴露出来
15747
+ */var HQCHART_VERSION="1.1.15325";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();//把给外界调用的方法暴露出来
15745
15748
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15746
15749
  // BaseIndex:BaseIndex,
15747
15750
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15319",
3
+ "version": "1.1.15326",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -15111,10 +15111,9 @@ function AverageWidthFrame()
15111
15111
  }
15112
15112
  }
15113
15113
 
15114
- if (item.BG && this.DrawDayVertical)
15115
- {
15116
- this.DrawDayVertical(item, x, border);
15117
- }
15114
+ if (item.BG && this.DrawDayVertical) this.DrawDayVertical(item, x, border);
15115
+
15116
+ if (item.VBG && this.DrawBGVertical) this.DrawBGVertical(item, x, border);
15118
15117
 
15119
15118
  if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
15120
15119
  {
@@ -17257,6 +17256,25 @@ function MinuteFrame()
17257
17256
  }
17258
17257
  }
17259
17258
 
17259
+ this.DrawBGVertical=function(dayItem, x, border)
17260
+ {
17261
+ if (!dayItem.VBG) return;
17262
+
17263
+ var bgItem=dayItem.VBG;
17264
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
17265
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
17266
+ var maxWidth=xEnd-xStart;
17267
+
17268
+ if (bgItem.Color)
17269
+ {
17270
+ this.Canvas.fillStyle=bgItem.Color;
17271
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.TopEx, Bottom:border.Bottom };
17272
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
17273
+ rtBG.Right=rtBG.Left+rtBG.Width;
17274
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
17275
+ }
17276
+ }
17277
+
17260
17278
  this.DrawDayVertical=function(dayItem, x, border)
17261
17279
  {
17262
17280
  if (!dayItem.BG) return;
@@ -45057,7 +45075,7 @@ function ChartMultiBar()
45057
45075
  delete this.newMethod;
45058
45076
 
45059
45077
  this.ClassName="ChartMultiBar";
45060
- this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , Type: 0 实心 1 空心 }, ]
45078
+ this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , AdWidth:{ Type: 高级宽度设置 Type:1=柱子宽度, 2=柱子+间距宽度, Value:倍数 } , Type: 0 实心 1 空心 }, ]
45061
45079
  this.IsHScreen=false;
45062
45080
 
45063
45081
  this.MapCache=null; //key=date/date-time value={ Data:[] }
@@ -45084,8 +45102,9 @@ function ChartMultiBar()
45084
45102
  var groupItem=this.Bars[i];
45085
45103
  if (!groupItem || !IFrameSplitOperator.IsNonEmptyArray(groupItem.Point)) continue;
45086
45104
 
45087
- var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, Name:groupItem.Name, Type:0 };
45105
+ var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, AdWidth:null, Name:groupItem.Name, Type:0 };
45088
45106
  if (IFrameSplitOperator.IsNumber(groupItem.Width)) clrConfig.Width=groupItem.Width;
45107
+ if (groupItem.AdWidth) clrConfig.AdWidth=groupItem.AdWidth;
45089
45108
  if (IFrameSplitOperator.IsNumber(groupItem.Type)) clrConfig.Type=groupItem.Type;
45090
45109
  if (groupItem.BorderColor) clrConfig.BorderColor=groupItem.BorderColor;
45091
45110
 
@@ -45200,7 +45219,8 @@ function ChartMultiBar()
45200
45219
  this.DrawAllBar=function(mapBar)
45201
45220
  {
45202
45221
  var pixelRatio=GetDevicePixelRatio();
45203
- var dataWidth=this.ChartFrame.DataWidth;
45222
+ var dataWidth=this.ChartFrame.DataWidth; //柱子宽度
45223
+ var distanceWidth=this.ChartFrame.DistanceWidth; //间距
45204
45224
  for(var mapItem of mapBar)
45205
45225
  {
45206
45226
  var aryBar=mapItem[1].AryBar;
@@ -45220,7 +45240,17 @@ function ChartMultiBar()
45220
45240
  {
45221
45241
  barWidth=dataWidth; //默认K线宽度
45222
45242
  config=item.Data.ColorConfig;
45223
- if (IFrameSplitOperator.IsNumber(config.Width)) barWidth=config.Width*pixelRatio;
45243
+ if (config.AdWidth && IFrameSplitOperator.IsNumber(config.AdWidth.Value) && IFrameSplitOperator.IsNumber(config.AdWidth.Type)) //高级宽度设置 Type:1, 2, Value:倍数
45244
+ {
45245
+ var type=config.AdWidth.Type;
45246
+ var value=config.AdWidth.Value;
45247
+ if (type==1) barWidth=dataWidth*value;
45248
+ else if (type==2) barWidth=(dataWidth+distanceWidth)*value;
45249
+ }
45250
+ else if (IFrameSplitOperator.IsNumber(config.Width))
45251
+ {
45252
+ barWidth=config.Width*pixelRatio;
45253
+ }
45224
45254
  if (barWidth>4)
45225
45255
  {
45226
45256
  if (config.Type==0) drawType=2; //实心
@@ -19207,10 +19207,9 @@ function AverageWidthFrame()
19207
19207
  }
19208
19208
  }
19209
19209
 
19210
- if (item.BG && this.DrawDayVertical)
19211
- {
19212
- this.DrawDayVertical(item, x, border);
19213
- }
19210
+ if (item.BG && this.DrawDayVertical) this.DrawDayVertical(item, x, border);
19211
+
19212
+ if (item.VBG && this.DrawBGVertical) this.DrawBGVertical(item, x, border);
19214
19213
 
19215
19214
  if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
19216
19215
  {
@@ -21353,6 +21352,25 @@ function MinuteFrame()
21353
21352
  }
21354
21353
  }
21355
21354
 
21355
+ this.DrawBGVertical=function(dayItem, x, border)
21356
+ {
21357
+ if (!dayItem.VBG) return;
21358
+
21359
+ var bgItem=dayItem.VBG;
21360
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
21361
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
21362
+ var maxWidth=xEnd-xStart;
21363
+
21364
+ if (bgItem.Color)
21365
+ {
21366
+ this.Canvas.fillStyle=bgItem.Color;
21367
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.TopEx, Bottom:border.Bottom };
21368
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
21369
+ rtBG.Right=rtBG.Left+rtBG.Width;
21370
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
21371
+ }
21372
+ }
21373
+
21356
21374
  this.DrawDayVertical=function(dayItem, x, border)
21357
21375
  {
21358
21376
  if (!dayItem.BG) return;
@@ -49153,7 +49171,7 @@ function ChartMultiBar()
49153
49171
  delete this.newMethod;
49154
49172
 
49155
49173
  this.ClassName="ChartMultiBar";
49156
- this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , Type: 0 实心 1 空心 }, ]
49174
+ this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , AdWidth:{ Type: 高级宽度设置 Type:1=柱子宽度, 2=柱子+间距宽度, Value:倍数 } , Type: 0 实心 1 空心 }, ]
49157
49175
  this.IsHScreen=false;
49158
49176
 
49159
49177
  this.MapCache=null; //key=date/date-time value={ Data:[] }
@@ -49180,8 +49198,9 @@ function ChartMultiBar()
49180
49198
  var groupItem=this.Bars[i];
49181
49199
  if (!groupItem || !IFrameSplitOperator.IsNonEmptyArray(groupItem.Point)) continue;
49182
49200
 
49183
- var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, Name:groupItem.Name, Type:0 };
49201
+ var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, AdWidth:null, Name:groupItem.Name, Type:0 };
49184
49202
  if (IFrameSplitOperator.IsNumber(groupItem.Width)) clrConfig.Width=groupItem.Width;
49203
+ if (groupItem.AdWidth) clrConfig.AdWidth=groupItem.AdWidth;
49185
49204
  if (IFrameSplitOperator.IsNumber(groupItem.Type)) clrConfig.Type=groupItem.Type;
49186
49205
  if (groupItem.BorderColor) clrConfig.BorderColor=groupItem.BorderColor;
49187
49206
 
@@ -49296,7 +49315,8 @@ function ChartMultiBar()
49296
49315
  this.DrawAllBar=function(mapBar)
49297
49316
  {
49298
49317
  var pixelRatio=GetDevicePixelRatio();
49299
- var dataWidth=this.ChartFrame.DataWidth;
49318
+ var dataWidth=this.ChartFrame.DataWidth; //柱子宽度
49319
+ var distanceWidth=this.ChartFrame.DistanceWidth; //间距
49300
49320
  for(var mapItem of mapBar)
49301
49321
  {
49302
49322
  var aryBar=mapItem[1].AryBar;
@@ -49316,7 +49336,17 @@ function ChartMultiBar()
49316
49336
  {
49317
49337
  barWidth=dataWidth; //默认K线宽度
49318
49338
  config=item.Data.ColorConfig;
49319
- if (IFrameSplitOperator.IsNumber(config.Width)) barWidth=config.Width*pixelRatio;
49339
+ if (config.AdWidth && IFrameSplitOperator.IsNumber(config.AdWidth.Value) && IFrameSplitOperator.IsNumber(config.AdWidth.Type)) //高级宽度设置 Type:1, 2, Value:倍数
49340
+ {
49341
+ var type=config.AdWidth.Type;
49342
+ var value=config.AdWidth.Value;
49343
+ if (type==1) barWidth=dataWidth*value;
49344
+ else if (type==2) barWidth=(dataWidth+distanceWidth)*value;
49345
+ }
49346
+ else if (IFrameSplitOperator.IsNumber(config.Width))
49347
+ {
49348
+ barWidth=config.Width*pixelRatio;
49349
+ }
49320
49350
  if (barWidth>4)
49321
49351
  {
49322
49352
  if (config.Type==0) drawType=2; //实心
@@ -155147,7 +155177,7 @@ function ScrollBarBGChart()
155147
155177
 
155148
155178
 
155149
155179
 
155150
- var HQCHART_VERSION="1.1.15318";
155180
+ var HQCHART_VERSION="1.1.15325";
155151
155181
 
155152
155182
  function PrintHQChartVersion()
155153
155183
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15318";
8
+ var HQCHART_VERSION="1.1.15325";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -19251,10 +19251,9 @@ function AverageWidthFrame()
19251
19251
  }
19252
19252
  }
19253
19253
 
19254
- if (item.BG && this.DrawDayVertical)
19255
- {
19256
- this.DrawDayVertical(item, x, border);
19257
- }
19254
+ if (item.BG && this.DrawDayVertical) this.DrawDayVertical(item, x, border);
19255
+
19256
+ if (item.VBG && this.DrawBGVertical) this.DrawBGVertical(item, x, border);
19258
19257
 
19259
19258
  if (item.Message[0]!=null && this.ChartBorder.Bottom>5*pixelRatio)
19260
19259
  {
@@ -21397,6 +21396,25 @@ function MinuteFrame()
21397
21396
  }
21398
21397
  }
21399
21398
 
21399
+ this.DrawBGVertical=function(dayItem, x, border)
21400
+ {
21401
+ if (!dayItem.VBG) return;
21402
+
21403
+ var bgItem=dayItem.VBG;
21404
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
21405
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
21406
+ var maxWidth=xEnd-xStart;
21407
+
21408
+ if (bgItem.Color)
21409
+ {
21410
+ this.Canvas.fillStyle=bgItem.Color;
21411
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.TopEx, Bottom:border.Bottom };
21412
+ rtBG.Height=rtBG.Bottom-rtBG.Top;
21413
+ rtBG.Right=rtBG.Left+rtBG.Width;
21414
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
21415
+ }
21416
+ }
21417
+
21400
21418
  this.DrawDayVertical=function(dayItem, x, border)
21401
21419
  {
21402
21420
  if (!dayItem.BG) return;
@@ -49197,7 +49215,7 @@ function ChartMultiBar()
49197
49215
  delete this.newMethod;
49198
49216
 
49199
49217
  this.ClassName="ChartMultiBar";
49200
- this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , Type: 0 实心 1 空心 }, ]
49218
+ this.Bars=[]; // [ {Point:[ {Date, Time, Value, Value2 }, ], Color:, Width: , AdWidth:{ Type: 高级宽度设置 Type:1=柱子宽度, 2=柱子+间距宽度, Value:倍数 } , Type: 0 实心 1 空心 }, ]
49201
49219
  this.IsHScreen=false;
49202
49220
 
49203
49221
  this.MapCache=null; //key=date/date-time value={ Data:[] }
@@ -49224,8 +49242,9 @@ function ChartMultiBar()
49224
49242
  var groupItem=this.Bars[i];
49225
49243
  if (!groupItem || !IFrameSplitOperator.IsNonEmptyArray(groupItem.Point)) continue;
49226
49244
 
49227
- var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, Name:groupItem.Name, Type:0 };
49245
+ var clrConfig= { Color:groupItem.Color, BGColor:null, Width:null, AdWidth:null, Name:groupItem.Name, Type:0 };
49228
49246
  if (IFrameSplitOperator.IsNumber(groupItem.Width)) clrConfig.Width=groupItem.Width;
49247
+ if (groupItem.AdWidth) clrConfig.AdWidth=groupItem.AdWidth;
49229
49248
  if (IFrameSplitOperator.IsNumber(groupItem.Type)) clrConfig.Type=groupItem.Type;
49230
49249
  if (groupItem.BorderColor) clrConfig.BorderColor=groupItem.BorderColor;
49231
49250
 
@@ -49340,7 +49359,8 @@ function ChartMultiBar()
49340
49359
  this.DrawAllBar=function(mapBar)
49341
49360
  {
49342
49361
  var pixelRatio=GetDevicePixelRatio();
49343
- var dataWidth=this.ChartFrame.DataWidth;
49362
+ var dataWidth=this.ChartFrame.DataWidth; //柱子宽度
49363
+ var distanceWidth=this.ChartFrame.DistanceWidth; //间距
49344
49364
  for(var mapItem of mapBar)
49345
49365
  {
49346
49366
  var aryBar=mapItem[1].AryBar;
@@ -49360,7 +49380,17 @@ function ChartMultiBar()
49360
49380
  {
49361
49381
  barWidth=dataWidth; //默认K线宽度
49362
49382
  config=item.Data.ColorConfig;
49363
- if (IFrameSplitOperator.IsNumber(config.Width)) barWidth=config.Width*pixelRatio;
49383
+ if (config.AdWidth && IFrameSplitOperator.IsNumber(config.AdWidth.Value) && IFrameSplitOperator.IsNumber(config.AdWidth.Type)) //高级宽度设置 Type:1, 2, Value:倍数
49384
+ {
49385
+ var type=config.AdWidth.Type;
49386
+ var value=config.AdWidth.Value;
49387
+ if (type==1) barWidth=dataWidth*value;
49388
+ else if (type==2) barWidth=(dataWidth+distanceWidth)*value;
49389
+ }
49390
+ else if (IFrameSplitOperator.IsNumber(config.Width))
49391
+ {
49392
+ barWidth=config.Width*pixelRatio;
49393
+ }
49364
49394
  if (barWidth>4)
49365
49395
  {
49366
49396
  if (config.Type==0) drawType=2; //实心
@@ -167206,7 +167236,7 @@ function HQChartScriptWorker()
167206
167236
 
167207
167237
 
167208
167238
 
167209
- var HQCHART_VERSION="1.1.15318";
167239
+ var HQCHART_VERSION="1.1.15325";
167210
167240
 
167211
167241
  function PrintHQChartVersion()
167212
167242
  {