hqchart 1.1.13065 → 1.1.13068

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.
@@ -2139,7 +2139,7 @@ var textRightPrev=null;//上一次刻度输出右边x坐标
2139
2139
  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(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)//虚线
2140
2140
  {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)//实线
2141
2141
  {if(g_JSChartResource.FrameXLineDash){this.Canvas.strokeStyle=this.VerticalInfo[i].LineColor;this.Canvas.setLineDash(g_JSChartResource.FrameXLineDash);//虚线
2142
- 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&&item.BG.Color){var bgItem=item.BG;this.Canvas.fillStyle=bgItem.Color;var xStart=this.GetXFromIndex(bgItem.Index.Start);var xEnd=this.GetXFromIndex(bgItem.Index.End);var bgHeight=this.ChartBorder.Bottom;if(IFrameSplitOperator.IsNumber(bgItem.Height))bgHeight=bgItem.Height;var rtBG={Left:xStart,Width:xEnd-xStart,Top:border.Bottom,Height:bgHeight};this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);}if(this.VerticalInfo[i].Message[0]!=null){if(this.VerticalInfo[i].Font)this.Canvas.font=this.VerticalInfo[i].Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(this.VerticalInfo[i].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)";
2142
+ 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(this.VerticalInfo[i].Message[0]!=null){if(this.VerticalInfo[i].Font)this.Canvas.font=this.VerticalInfo[i].Font;var textLeft=0;this.Canvas.strokeStyle=item.TextColor;var testWidth=this.Canvas.measureText(this.VerticalInfo[i].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)";
2143
2143
  if(item.TextBGColor)//文字背景色
2144
2144
  {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;}};//Y坐标转y轴数值
2145
2145
  this.GetYData=function(y,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromData){return this.GetYLogarithmicData(y);}if(this.CoordinateType==1)//反转坐标
@@ -2216,7 +2216,8 @@ var top=ToFixedPoint(border.Top);var bottom=ToFixedPoint(border.Bottom);this.Can
2216
2216
  {var left=ToFixedPoint(border.Left);var right=ToFixedPoint(this.ChartBorder.GetLeft());var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);this.DrawCallAuctionVertical(this.BeforeOpenVerticalInfo,this.YSplitOperator.BeforeOpenData,border,true);}if(this.ChartBorder.RightExtendWidth>10)//盘后
2217
2217
  {this.Canvas.fillStyle=this.AfterBGColor;var left=ToFixedPoint(this.ChartBorder.GetRight());var right=ToFixedPoint(border.Right);var width=right-left;var height=bottom-top;this.Canvas.fillRect(left,top,width,height);}};//选中的画图工具X轴坐标信息
2218
2218
  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);
2219
- 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};}};//分割x,y轴坐标信息
2219
+ 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:},], []]
2220
+ {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轴坐标信息
2220
2221
  this.SplitXYCoordinate=function(){if(this.XYSplit==false)return;if(this.XSplitOperator!=null)this.XSplitOperator.Operator();if(this.YSplitOperator!=null)this.YSplitOperator.Operator();};this.GetMultiDayXFromIndex=function(index,border){var dayBorder=border.DayBorder;var minuteIndex=index%this.MinuteCount;var dayIndex=parseInt(index/this.MinuteCount);if(dayIndex>=dayBorder.length)dayIndex=dayBorder.length-1;var client=dayBorder[dayIndex];var count=this.MinuteCount-1;if(minuteIndex>=count){return client.RightEx;}else{var width=client.RightEx-client.LeftEx;var offset=client.LeftEx+width*minuteIndex/count;return offset;}};this.GetXFromIndex=function(index){var count=this.XPointCount-1;var border=this.ChartBorder.GetBorder();if(border.DayBorder)return this.GetMultiDayXFromIndex(index,border);if(count==1){if(index==0)return border.LeftEx;else return border.RightEx;}else if(count<=0){return border.LeftEx;}else if(index>=count){return border.RightEx;}else{var width=border.RightEx-border.LeftEx;var offset=border.LeftEx+width*index/count;return offset;}};this.GetMultiDayXData=function(x,border){var dayBorder=border.DayBorder;for(var i=0;i<dayBorder.length;++i){var client=dayBorder[i];if(x>=client.Left&&x<=client.Right){var count=this.MinuteCount-1;var dayMinuteCount=this.MinuteCount*i;if(x<=client.LeftEx)return 0+dayMinuteCount;if(x>=client.RightEx)return count+dayMinuteCount;var width=client.RightEx-client.LeftEx;return(x-client.LeftEx)*(count*1.0/width)+dayMinuteCount;}}};//X坐标转x轴数值
2221
2222
  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轴刻度定制显示
2222
2223
  {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);//自定义刻度
@@ -12696,7 +12697,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
12696
12697
  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);};}/********************************************************************************
12697
12698
  * 版本信息输出
12698
12699
  *
12699
- */var HQCHART_VERSION="1.1.13064";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12700
+ */var HQCHART_VERSION="1.1.13067";function PrintHQChartVersion(){var log='*************************************************************************************************************\n*\n* HQChart Ver: '+HQCHART_VERSION+' \n* \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n*************************************************************************************************************\n';console.log(log);}PrintHQChartVersion();//把给外界调用的方法暴露出来
12700
12701
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
12701
12702
  // BaseIndex:BaseIndex,
12702
12703
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.13065",
3
+ "version": "1.1.13068",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -10883,16 +10883,9 @@ function AverageWidthFrame()
10883
10883
  }
10884
10884
  }
10885
10885
 
10886
- if (item.BG && item.BG.Color)
10887
- {
10888
- var bgItem=item.BG;
10889
- this.Canvas.fillStyle=bgItem.Color;
10890
- var xStart=this.GetXFromIndex(bgItem.Index.Start);
10891
- var xEnd=this.GetXFromIndex(bgItem.Index.End);
10892
- var bgHeight=this.ChartBorder.Bottom;
10893
- if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
10894
- var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
10895
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
10886
+ if (item.BG && this.DrawDayVertical)
10887
+ {
10888
+ this.DrawDayVertical(item, x, border);
10896
10889
  }
10897
10890
 
10898
10891
  if (this.VerticalInfo[i].Message[0]!=null)
@@ -12445,6 +12438,67 @@ function MinuteFrame()
12445
12438
  }
12446
12439
  }
12447
12440
 
12441
+ this.DrawDayVertical=function(dayItem, x, border)
12442
+ {
12443
+ if (!dayItem.BG) return;
12444
+
12445
+ var bgItem=dayItem.BG;
12446
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
12447
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
12448
+ var maxWidth=xEnd-xStart;
12449
+ var bgHeight=this.ChartBorder.Bottom;
12450
+ if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
12451
+
12452
+ if (bgItem.Color)
12453
+ {
12454
+ this.Canvas.fillStyle=bgItem.Color;
12455
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
12456
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
12457
+ }
12458
+
12459
+ if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
12460
+ {
12461
+ this.Canvas.textAlign="left";
12462
+ this.Canvas.textBaseline="top";
12463
+ var yText=border.Bottom+2;
12464
+ var lineHeight=this.Canvas.measureText("擎").width+2;
12465
+ for(var i=0,j=0;i<dayItem.AryText.length;++i)
12466
+ {
12467
+ var aryText=dayItem.AryText[i];
12468
+ var itemWidth=0;
12469
+ var aryOut=[];
12470
+ for(j=0;j<aryText.length;++j)
12471
+ {
12472
+ var item=aryText[j];
12473
+ var textWidth=this.Canvas.measureText(item.Text).width;
12474
+ if (itemWidth+textWidth>maxWidth) break;
12475
+
12476
+ var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
12477
+ itemWidth+=textWidth;
12478
+ item.Width=textWidth;
12479
+ if (item.Space>=1) itemWidth+=item.Space;
12480
+ aryOut.push(newItem);
12481
+ }
12482
+
12483
+ var xText=xStart+(maxWidth-itemWidth)/2;
12484
+ for(var j=0;j<aryOut.length;++j)
12485
+ {
12486
+ var item=aryOut[j];
12487
+ if (!IFrameSplitOperator.IsNumber(item.Width)) break;
12488
+ if (item.Color) this.Canvas.fillStyle=item.Color;
12489
+ else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
12490
+
12491
+ this.Canvas.fillText(item.Text,xText,yText);
12492
+ xText+=item.Width;
12493
+ if (item.Space>=1) xText+=item.Space;
12494
+ }
12495
+
12496
+ yText+=lineHeight;
12497
+ }
12498
+ }
12499
+
12500
+ }
12501
+
12448
12502
  //分割x,y轴坐标信息
12449
12503
  this.SplitXYCoordinate=function()
12450
12504
  {
@@ -14775,16 +14775,9 @@ function AverageWidthFrame()
14775
14775
  }
14776
14776
  }
14777
14777
 
14778
- if (item.BG && item.BG.Color)
14779
- {
14780
- var bgItem=item.BG;
14781
- this.Canvas.fillStyle=bgItem.Color;
14782
- var xStart=this.GetXFromIndex(bgItem.Index.Start);
14783
- var xEnd=this.GetXFromIndex(bgItem.Index.End);
14784
- var bgHeight=this.ChartBorder.Bottom;
14785
- if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
14786
- var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
14787
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
14778
+ if (item.BG && this.DrawDayVertical)
14779
+ {
14780
+ this.DrawDayVertical(item, x, border);
14788
14781
  }
14789
14782
 
14790
14783
  if (this.VerticalInfo[i].Message[0]!=null)
@@ -16337,6 +16330,67 @@ function MinuteFrame()
16337
16330
  }
16338
16331
  }
16339
16332
 
16333
+ this.DrawDayVertical=function(dayItem, x, border)
16334
+ {
16335
+ if (!dayItem.BG) return;
16336
+
16337
+ var bgItem=dayItem.BG;
16338
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
16339
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
16340
+ var maxWidth=xEnd-xStart;
16341
+ var bgHeight=this.ChartBorder.Bottom;
16342
+ if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
16343
+
16344
+ if (bgItem.Color)
16345
+ {
16346
+ this.Canvas.fillStyle=bgItem.Color;
16347
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
16348
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
16349
+ }
16350
+
16351
+ if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
16352
+ {
16353
+ this.Canvas.textAlign="left";
16354
+ this.Canvas.textBaseline="top";
16355
+ var yText=border.Bottom+2;
16356
+ var lineHeight=this.Canvas.measureText("擎").width+2;
16357
+ for(var i=0,j=0;i<dayItem.AryText.length;++i)
16358
+ {
16359
+ var aryText=dayItem.AryText[i];
16360
+ var itemWidth=0;
16361
+ var aryOut=[];
16362
+ for(j=0;j<aryText.length;++j)
16363
+ {
16364
+ var item=aryText[j];
16365
+ var textWidth=this.Canvas.measureText(item.Text).width;
16366
+ if (itemWidth+textWidth>maxWidth) break;
16367
+
16368
+ var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
16369
+ itemWidth+=textWidth;
16370
+ item.Width=textWidth;
16371
+ if (item.Space>=1) itemWidth+=item.Space;
16372
+ aryOut.push(newItem);
16373
+ }
16374
+
16375
+ var xText=xStart+(maxWidth-itemWidth)/2;
16376
+ for(var j=0;j<aryOut.length;++j)
16377
+ {
16378
+ var item=aryOut[j];
16379
+ if (!IFrameSplitOperator.IsNumber(item.Width)) break;
16380
+ if (item.Color) this.Canvas.fillStyle=item.Color;
16381
+ else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
16382
+
16383
+ this.Canvas.fillText(item.Text,xText,yText);
16384
+ xText+=item.Width;
16385
+ if (item.Space>=1) xText+=item.Space;
16386
+ }
16387
+
16388
+ yText+=lineHeight;
16389
+ }
16390
+ }
16391
+
16392
+ }
16393
+
16340
16394
  //分割x,y轴坐标信息
16341
16395
  this.SplitXYCoordinate=function()
16342
16396
  {
@@ -130673,7 +130727,7 @@ function ScrollBarBGChart()
130673
130727
 
130674
130728
 
130675
130729
 
130676
- var HQCHART_VERSION="1.1.13064";
130730
+ var HQCHART_VERSION="1.1.13067";
130677
130731
 
130678
130732
  function PrintHQChartVersion()
130679
130733
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13064";
8
+ var HQCHART_VERSION="1.1.13067";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -14819,16 +14819,9 @@ function AverageWidthFrame()
14819
14819
  }
14820
14820
  }
14821
14821
 
14822
- if (item.BG && item.BG.Color)
14823
- {
14824
- var bgItem=item.BG;
14825
- this.Canvas.fillStyle=bgItem.Color;
14826
- var xStart=this.GetXFromIndex(bgItem.Index.Start);
14827
- var xEnd=this.GetXFromIndex(bgItem.Index.End);
14828
- var bgHeight=this.ChartBorder.Bottom;
14829
- if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
14830
- var rtBG={Left:xStart, Width:xEnd-xStart, Top:border.Bottom, Height: bgHeight };
14831
- this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
14822
+ if (item.BG && this.DrawDayVertical)
14823
+ {
14824
+ this.DrawDayVertical(item, x, border);
14832
14825
  }
14833
14826
 
14834
14827
  if (this.VerticalInfo[i].Message[0]!=null)
@@ -16381,6 +16374,67 @@ function MinuteFrame()
16381
16374
  }
16382
16375
  }
16383
16376
 
16377
+ this.DrawDayVertical=function(dayItem, x, border)
16378
+ {
16379
+ if (!dayItem.BG) return;
16380
+
16381
+ var bgItem=dayItem.BG;
16382
+ var xStart=this.GetXFromIndex(bgItem.Index.Start);
16383
+ var xEnd=this.GetXFromIndex(bgItem.Index.End);
16384
+ var maxWidth=xEnd-xStart;
16385
+ var bgHeight=this.ChartBorder.Bottom;
16386
+ if (IFrameSplitOperator.IsNumber(bgItem.Height)) bgHeight=bgItem.Height;
16387
+
16388
+ if (bgItem.Color)
16389
+ {
16390
+ this.Canvas.fillStyle=bgItem.Color;
16391
+ var rtBG={Left:xStart, Width:maxWidth, Top:border.Bottom, Height: bgHeight };
16392
+ this.Canvas.fillRect(rtBG.Left, rtBG.Top, rtBG.Width, rtBG.Height);
16393
+ }
16394
+
16395
+ if (IFrameSplitOperator.IsNonEmptyArray(dayItem.AryText)) //[ [{Text:, Color:},], []]
16396
+ {
16397
+ this.Canvas.textAlign="left";
16398
+ this.Canvas.textBaseline="top";
16399
+ var yText=border.Bottom+2;
16400
+ var lineHeight=this.Canvas.measureText("擎").width+2;
16401
+ for(var i=0,j=0;i<dayItem.AryText.length;++i)
16402
+ {
16403
+ var aryText=dayItem.AryText[i];
16404
+ var itemWidth=0;
16405
+ var aryOut=[];
16406
+ for(j=0;j<aryText.length;++j)
16407
+ {
16408
+ var item=aryText[j];
16409
+ var textWidth=this.Canvas.measureText(item.Text).width;
16410
+ if (itemWidth+textWidth>maxWidth) break;
16411
+
16412
+ var newItem={ Text:item.Text, Width:textWidth, Color:item.Color, Space:item.Space };
16413
+ itemWidth+=textWidth;
16414
+ item.Width=textWidth;
16415
+ if (item.Space>=1) itemWidth+=item.Space;
16416
+ aryOut.push(newItem);
16417
+ }
16418
+
16419
+ var xText=xStart+(maxWidth-itemWidth)/2;
16420
+ for(var j=0;j<aryOut.length;++j)
16421
+ {
16422
+ var item=aryOut[j];
16423
+ if (!IFrameSplitOperator.IsNumber(item.Width)) break;
16424
+ if (item.Color) this.Canvas.fillStyle=item.Color;
16425
+ else if (dayItem.TextColor) this.Canvas.fillStyle=dayItem.TextColor;
16426
+
16427
+ this.Canvas.fillText(item.Text,xText,yText);
16428
+ xText+=item.Width;
16429
+ if (item.Space>=1) xText+=item.Space;
16430
+ }
16431
+
16432
+ yText+=lineHeight;
16433
+ }
16434
+ }
16435
+
16436
+ }
16437
+
16384
16438
  //分割x,y轴坐标信息
16385
16439
  this.SplitXYCoordinate=function()
16386
16440
  {
@@ -130831,7 +130885,7 @@ function HQChartScriptWorker()
130831
130885
 
130832
130886
 
130833
130887
 
130834
- var HQCHART_VERSION="1.1.13064";
130888
+ var HQCHART_VERSION="1.1.13067";
130835
130889
 
130836
130890
  function PrintHQChartVersion()
130837
130891
  {