hqchart 1.1.13107 → 1.1.13114
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.
package/lib/umychart.vue.js
CHANGED
|
@@ -1796,7 +1796,7 @@ for(var i=0;i<this.Frame.SubFrame.length;++i){var subFrame=this.Frame.SubFrame[i
|
|
|
1796
1796
|
for(var i in this.Frame.SubFrame){var subFrame=this.Frame.SubFrame[i];for(var j in subFrame.OverlayIndex){var overlayItem=subFrame.OverlayIndex[j];for(var k in overlayItem.ChartPaint){var item=overlayItem.ChartPaint[k];if(!item.Data)continue;item.Data.DataOffset=data.DataOffset;}}}};this.GetMoveOneStepWidth=function(){if(IFrameSplitOperator.IsPlusNumber(this.StepPixel))return this.StepPixel;var pixelRatio=GetDevicePixelRatio();var mainFrame=this.Frame.SubFrame[0].Frame;var dataWidth=mainFrame.DataWidth;var distanceWidth=mainFrame.DistanceWidth;var oneStepWidth=this.StepPixel;var oneStepWidth=(dataWidth+distanceWidth)/pixelRatio;if(oneStepWidth<1)oneStepWidth=1;return oneStepWidth;};this.DataMove=function(step,isLeft){var oneStepWidth=this.GetMoveOneStepWidth();var moveStep=step;step=parseInt(step/oneStepWidth);//除以4个像素
|
|
1797
1797
|
if(step<=0)return false;var data=null;if(!this.Frame.Data)data=this.Frame.Data;else data=this.Frame.SubFrame[0].Frame.Data;if(!data)return false;var xPointcount=0;if(this.Frame.XPointCount)xPointcount=this.Frame.XPointCount;else xPointcount=this.Frame.SubFrame[0].Frame.XPointCount;if(!xPointcount)return false;if(this.Frame.SubFrame&&this.Frame.SubFrame.length>0&&this.Frame.SubFrame[0].Frame){var fristFrame=this.Frame.SubFrame[0].Frame;if(fristFrame.DataWidth<=1||fristFrame.DistanceWidth<=1)//K线在缩放很小的时候 移动加速
|
|
1798
1798
|
{if(IFrameSplitOperator.IsPlusNumber(this.StepPixel))step=parseInt(moveStep)*this.StepPixel;}}if(isLeft)//-->
|
|
1799
|
-
{if(this.RightSpaceCount>0){if(xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount
|
|
1799
|
+
{if(this.RightSpaceCount>0){if(xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)data.DataOffset=data.Data.length-(xPointcount-this.RightSpaceCount);}else{if(xPointcount+data.DataOffset>=data.Data.length)return false;data.DataOffset+=step;if(data.DataOffset+xPointcount>=data.Data.length)data.DataOffset=data.Data.length-xPointcount;}return true;}else//<--
|
|
1800
1800
|
{if(data.DataOffset<=0)return false;data.DataOffset-=step;if(data.DataOffset<0)data.DataOffset=0;return true;}};this.XCoordinateZoom=function(step,isMoveLeft){var oneStepWidth=this.GetMoveOneStepWidth();var moveStep=step;step=parseInt(step/oneStepWidth);//除以4个像素
|
|
1801
1801
|
if(step<=0)return false;return this.Frame.XCoordinateZoom(isMoveLeft);};//获取鼠标在当前子窗口id
|
|
1802
1802
|
this.GetSubFrameIndex=function(x,y){if(!this.Frame.SubFrame||this.Frame.SubFrame.length<=0)return-1;for(var i in this.Frame.SubFrame){var frame=this.Frame.SubFrame[i].Frame;var left=frame.ChartBorder.GetLeft();var top=frame.ChartBorder.GetTop();var height=frame.ChartBorder.GetHeight();var width=frame.ChartBorder.GetWidth();this.Canvas.beginPath();this.Canvas.rect(left,top,width,height);if(this.Canvas.isPointInPath(x,y))return parseInt(i);}return 0;};//根据X坐标获取数据索引
|
|
@@ -6112,14 +6112,17 @@ this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.font=
|
|
|
6112
6112
|
{var index=startPoint.XValue-1;if(index>=0&&index<data.length)yClose=data[index].Close;}var result={YClose:yClose,Open:open,High:high,Low:low,Close:close,Count:count};if(IFrameSplitOperator.IsPlusNumber(yClose)){result.Increase=(close-yClose)/yClose*100;result.Risefall=close-yClose;}return result;};}//画图工具-标价线 支持横屏
|
|
6113
6113
|
function ChartDrawPriceLine(){this.newMethod=IChartDrawPicture;//派生
|
|
6114
6114
|
this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPriceLine';this.Font=16*GetDevicePixelRatio()+"px 微软雅黑";this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsHScreen=false;this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;this.IsHScreen=this.Frame.IsHScreen;var ptStart=drawPoint[0];var chartBorder=this.Frame.ChartBorder;if(this.IsHScreen){var left=chartBorder.GetLeftEx();var right=chartBorder.GetRightEx();if(ptStart.X<left||ptStart.X>right)return;var bottom=chartBorder.GetBottom();var ptEnd={X:ptStart.X,Y:bottom};var price=this.Frame.GetYData(ptStart.X,false);}else{var bottom=chartBorder.GetBottomEx();var top=chartBorder.GetTopEx();if(ptStart.Y<top||ptStart.Y>bottom)return;var right=chartBorder.GetRight();var ptEnd={X:right,Y:ptStart.Y};var price=this.Frame.GetYData(ptStart.Y,false);}this.ClipFrame();this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);this.DrawPoint(drawPoint);//画点
|
|
6115
|
-
this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var offset=2*GetDevicePixelRatio();var xText=ptStart.X;var yText=ptStart.Y;if(this.IsHScreen){this.Canvas.translate(xText+offset,yText+offset);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(price.toFixed(2),0,0);}else{this.Canvas.fillText(price.toFixed(2),xText+offset,yText-offset);}this.Canvas.restore();};}//画图工具-标价线2 支持横屏
|
|
6115
|
+
this.Canvas.textBaseline='bottom';this.Canvas.textAlign='left';this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var offset=2*GetDevicePixelRatio();var xText=ptStart.X;var yText=ptStart.Y;if(this.IsHScreen){this.Canvas.translate(xText+offset,yText+offset);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(price.toFixed(2),0,0);}else{this.Canvas.fillText(price.toFixed(2),xText+offset,yText-offset);}this.Canvas.restore();};}//画图工具-标价线2 支持横屏 支持价格文字在坐标内部显示
|
|
6116
6116
|
function ChartDrawPriceLineV2(){this.newMethod=IChartDrawPicture;//派生
|
|
6117
6117
|
this.newMethod();delete this.newMethod;this.ClassName='ChartDrawPriceLineV2';this.Font=12*GetDevicePixelRatio()+"px 微软雅黑";this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsHScreen=false;this.LineWidth=1;this.IsDrawFirst=true;this.TextColor="rgb(255,255,255)";this.Title;//标题
|
|
6118
|
+
this.TextPosition=[null,0];//[0]=左侧(没有做) [1]=右侧 0=自动 1=内部 2=外部
|
|
6118
6119
|
this.Super_SetOption=this.SetOption;//父类函数
|
|
6119
|
-
this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.TextColor)this.TextColor=option.TextColor;if(option.Title)this.Title=option.Title;}};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;this.IsHScreen=this.Frame.IsHScreen;var chartBorder=this.Frame.ChartBorder;var border=this.Frame.GetBorder();if(this.IsHScreen){var left=border.LeftEx;var right=border.RightEx;var bottom=border.Bottom;var top=border.Top;var ptStart={X:drawPoint[0].X,Y:top};if(ptStart.X<left||ptStart.X>right)return;var ptEnd={X:drawPoint[0].X,Y:bottom};var price=this.Frame.GetYData(ptStart.X,false);}else{var bottom=border.BottomEx;var top=border.TopTitle;var left=border.Left;var right=border.Right;var ptStart={X:left,Y:drawPoint[0].Y};if(ptStart.Y<top||ptStart.Y>bottom)return;var ptEnd={X:right,Y:drawPoint[0].Y};var price=this.Frame.GetYData(ptStart.Y,false);}//this.ClipFrame();
|
|
6120
|
-
this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));this.Canvas.lineTo(ToFixedPoint(ptEnd.X),ToFixedPoint(ptEnd.Y));this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);var pixelTatio=GetDevicePixelRatio();this.Canvas.font=this.Font;var offset=2*pixelTatio;var xText=ptEnd.X;var yText=ptEnd.Y;this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';var textHeight=this.GetFontHeight();var text=price.toFixed(2);var textWidth=this.Canvas.measureText(text).width+2*offset;if(this.IsHScreen){
|
|
6121
|
-
|
|
6122
|
-
{var rtBG={Left:xText-
|
|
6120
|
+
this.SetOption=function(option){if(this.Super_SetOption)this.Super_SetOption(option);if(option){if(option.TextColor)this.TextColor=option.TextColor;if(option.Title)this.Title=option.Title;if(IFrameSplitOperator.IsNonEmptyArray(option.TextPosition))this.TextPosition=option.TextPosition.slice();}};this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;var drawPoint=this.CalculateDrawPoint({IsCheckX:false,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;if(!this.IsYValueInFrame(this.Value[0].YValue))return;this.IsHScreen=this.Frame.IsHScreen;var chartBorder=this.Frame.ChartBorder;var border=this.Frame.GetBorder();if(this.IsHScreen){var left=border.LeftEx;var right=border.RightEx;var bottom=border.Bottom;var top=border.Top;var ptStart={X:drawPoint[0].X,Y:top};if(ptStart.X<left||ptStart.X>right)return;var ptEnd={X:drawPoint[0].X,Y:bottom};var price=this.Frame.GetYData(ptStart.X,false);}else{var bottom=border.BottomEx;var top=border.TopTitle;var left=border.Left;var right=border.Right;var ptStart={X:left,Y:drawPoint[0].Y};if(ptStart.Y<top||ptStart.Y>bottom)return;var ptEnd={X:right,Y:drawPoint[0].Y};var price=this.Frame.GetYData(ptStart.Y,false);}//this.ClipFrame();
|
|
6121
|
+
this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ToFixedPoint(ptStart.X),ToFixedPoint(ptStart.Y));this.Canvas.lineTo(ToFixedPoint(ptEnd.X),ToFixedPoint(ptEnd.Y));this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);var pixelTatio=GetDevicePixelRatio();this.Canvas.font=this.Font;var offset=2*pixelTatio;var xText=ptEnd.X;var yText=ptEnd.Y;this.Canvas.textBaseline='middle';this.Canvas.textAlign='left';var textHeight=this.GetFontHeight();var text=price.toFixed(2);var textWidth=this.Canvas.measureText(text).width+2*offset;if(this.IsHScreen){var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
|
|
6122
|
+
if(position==0)bDrawInside=chartBorder.Bottom<=10;else if(position==1)bDrawInside=true;else if(position==2)bDrawInside=false;if(bDrawInside){yText=yText-textWidth;var rtBG={Left:xText-textHeight/2,Top:yText,Width:textHeight,Height:textWidth};}else//框架内部显示
|
|
6123
|
+
{var rtBG={Left:xText-textHeight/2,Top:yText,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.save();this.Canvas.translate(xText,yText+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,0,0);this.Canvas.restore();if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left,Top:rtBG.Top-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}else{var rtTitle={Left:rtBG.Left,Top:bottom-textWidth-1*pixelTatio,Width:textHeight,Height:textWidth};}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.save();this.Canvas.translate(xText,rtTitle.Top+1*pixelTatio);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,0,0);this.Canvas.restore();}}else{var position=this.TextPosition[1];var bDrawInside=false;//在内部绘制
|
|
6124
|
+
if(position==0)bDrawInside=chartBorder.Right<=10;else if(position==1)bDrawInside=true;else if(position==2)bDrawInside=false;if(bDrawInside){var rtBG={Left:xText-textWidth,Top:yText-textHeight/2-1*pixelTatio,Width:textWidth,Height:textHeight};}else//框架内部显示
|
|
6125
|
+
{var rtBG={Left:xText,Top:yText-textHeight/2-1*pixelTatio,Width:textWidth,Height:textHeight};if(rtBG.Left+rtBG.Width>border.ChartWidth)rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtBG.Left,rtBG.Top,rtBG.Width,rtBG.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(text,rtBG.Left+offset,yText);if(this.Title){var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;if(bDrawInside){var rtTitle={Left:rtBG.Left-textWidth,Top:rtBG.Top,Width:textWidth,Height:textHeight};}else{var rtTitle={Left:right-textWidth-1*pixelTatio,Top:rtBG.Top,Width:textWidth,Height:textHeight};if(rtBG.Left!=right)rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;}this.Canvas.fillStyle=this.LineColor;this.Canvas.fillRect(rtTitle.Left,rtTitle.Top,rtTitle.Width,rtTitle.Height);this.Canvas.fillStyle=this.TextColor;this.Canvas.fillText(this.Title,rtTitle.Left+1*pixelTatio,yText);}}};this.DrawPrice=function(){};}//画图工具-竖线 支持横屏
|
|
6123
6126
|
function ChartDrawVerticalLine(){this.newMethod=IChartDrawPicture;//派生
|
|
6124
6127
|
this.newMethod();delete this.newMethod;this.ClassName='ChartDrawVerticalLine';this.PointCount=1;this.IsPointIn=this.IsPointIn_XYValue_Line;this.IsHScreen=false;this.Draw=function(){this.LinePoint=[];if(this.IsFrameMinSize())return;if(!this.IsShow)return;if(!this.Frame||!this.Frame.Data)return;var data=this.Frame.Data;var drawPoint=this.CalculateDrawPoint({IsCheckX:true,IsCheckY:true});if(!drawPoint)return;if(drawPoint.length!=1)return;this.IsHScreen=this.Frame.IsHScreen;var pt=drawPoint[0];var chartBorder=this.Frame.ChartBorder;if(this.IsHScreen){var xValue=Math.round(this.Frame.GetXData(pt.Y,false))+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length)xValue=data.Data.length-1;var yLine=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);yLine=ToFixedPoint2(this.LineWidth,yLine);var left=chartBorder.GetLeftEx();var right=chartBorder.GetRightEx();var ptStart={X:left,Y:yLine};var ptEnd={X:right,Y:yLine};}else{var xValue=Math.round(this.Frame.GetXData(pt.X,false))+data.DataOffset;if(xValue<0)xValue=0;else if(xValue>=data.Data.length)xValue=data.Data.length-1;var xLine=this.Frame.GetXFromIndex(xValue-data.DataOffset,false);xLine=ToFixedPoint2(this.LineWidth,xLine);var top=chartBorder.GetTopEx();var bottom=chartBorder.GetBottomEx();var ptStart={X:xLine,Y:top};var ptEnd={X:xLine,Y:bottom};}this.ClipFrame();this.SetLineWidth();this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(ptStart.X,ptStart.Y);this.Canvas.lineTo(ptEnd.X,ptEnd.Y);this.Canvas.stroke();this.RestoreLineWidth();var line={Start:ptStart,End:ptEnd};this.LinePoint.push(line);if(this.Status==10)this.DrawPoint(drawPoint);//画点
|
|
6125
6128
|
this.Canvas.restore();};}//画图工具-波浪尺
|
|
@@ -13028,7 +13031,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
13028
13031
|
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);};}/********************************************************************************
|
|
13029
13032
|
* 版本信息输出
|
|
13030
13033
|
*
|
|
13031
|
-
*/var HQCHART_VERSION="1.1.
|
|
13034
|
+
*/var HQCHART_VERSION="1.1.13113";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();//把给外界调用的方法暴露出来
|
|
13032
13035
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
13033
13036
|
// BaseIndex:BaseIndex,
|
|
13034
13037
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -7264,7 +7264,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
7264
7264
|
{
|
|
7265
7265
|
if (this.RightSpaceCount>0)
|
|
7266
7266
|
{
|
|
7267
|
-
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount
|
|
7267
|
+
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
|
|
7268
7268
|
data.DataOffset+=step;
|
|
7269
7269
|
|
|
7270
7270
|
if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
|
|
@@ -58606,7 +58606,7 @@ function ChartDrawPriceLine()
|
|
|
58606
58606
|
}
|
|
58607
58607
|
}
|
|
58608
58608
|
|
|
58609
|
-
//画图工具-标价线2 支持横屏
|
|
58609
|
+
//画图工具-标价线2 支持横屏 支持价格文字在坐标内部显示
|
|
58610
58610
|
function ChartDrawPriceLineV2()
|
|
58611
58611
|
{
|
|
58612
58612
|
this.newMethod=IChartDrawPicture; //派生
|
|
@@ -58622,6 +58622,7 @@ function ChartDrawPriceLineV2()
|
|
|
58622
58622
|
this.IsDrawFirst=true;
|
|
58623
58623
|
this.TextColor="rgb(255,255,255)";
|
|
58624
58624
|
this.Title; //标题
|
|
58625
|
+
this.TextPosition=[null, 0]; //[0]=左侧(没有做) [1]=右侧 0=自动 1=内部 2=外部
|
|
58625
58626
|
|
|
58626
58627
|
this.Super_SetOption=this.SetOption; //父类函数
|
|
58627
58628
|
this.SetOption=function(option)
|
|
@@ -58631,6 +58632,7 @@ function ChartDrawPriceLineV2()
|
|
|
58631
58632
|
{
|
|
58632
58633
|
if (option.TextColor) this.TextColor=option.TextColor;
|
|
58633
58634
|
if (option.Title) this.Title=option.Title;
|
|
58635
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.TextPosition)) this.TextPosition=option.TextPosition.slice();
|
|
58634
58636
|
}
|
|
58635
58637
|
}
|
|
58636
58638
|
|
|
@@ -58702,14 +58704,20 @@ function ChartDrawPriceLineV2()
|
|
|
58702
58704
|
|
|
58703
58705
|
if (this.IsHScreen)
|
|
58704
58706
|
{
|
|
58705
|
-
|
|
58707
|
+
var position=this.TextPosition[1];
|
|
58708
|
+
var bDrawInside=false; //在内部绘制
|
|
58709
|
+
if (position==0) bDrawInside=chartBorder.Bottom<=10;
|
|
58710
|
+
else if (position==1) bDrawInside=true;
|
|
58711
|
+
else if (position==2) bDrawInside=false;
|
|
58712
|
+
|
|
58713
|
+
if (bDrawInside)
|
|
58706
58714
|
{
|
|
58707
|
-
|
|
58715
|
+
yText=yText-textWidth;
|
|
58716
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
58708
58717
|
}
|
|
58709
58718
|
else //框架内部显示
|
|
58710
58719
|
{
|
|
58711
|
-
|
|
58712
|
-
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
58720
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width: textHeight, Height:textWidth };
|
|
58713
58721
|
}
|
|
58714
58722
|
|
|
58715
58723
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -58725,13 +58733,13 @@ function ChartDrawPriceLineV2()
|
|
|
58725
58733
|
if (this.Title)
|
|
58726
58734
|
{
|
|
58727
58735
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
58728
|
-
if (
|
|
58736
|
+
if (bDrawInside)
|
|
58729
58737
|
{
|
|
58730
|
-
var rtTitle={
|
|
58738
|
+
var rtTitle={Left:rtBG.Left, Top:rtBG.Top-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth};
|
|
58731
58739
|
}
|
|
58732
58740
|
else
|
|
58733
58741
|
{
|
|
58734
|
-
var rtTitle={Left:rtBG.Left, Top:
|
|
58742
|
+
var rtTitle={ Left:rtBG.Left, Top:bottom-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth };
|
|
58735
58743
|
}
|
|
58736
58744
|
|
|
58737
58745
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -58747,14 +58755,20 @@ function ChartDrawPriceLineV2()
|
|
|
58747
58755
|
}
|
|
58748
58756
|
else
|
|
58749
58757
|
{
|
|
58750
|
-
|
|
58758
|
+
var position=this.TextPosition[1];
|
|
58759
|
+
var bDrawInside=false; //在内部绘制
|
|
58760
|
+
if (position==0) bDrawInside=chartBorder.Right<=10;
|
|
58761
|
+
else if (position==1) bDrawInside=true;
|
|
58762
|
+
else if (position==2) bDrawInside=false;
|
|
58763
|
+
|
|
58764
|
+
if (bDrawInside)
|
|
58751
58765
|
{
|
|
58752
|
-
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
58753
|
-
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
58766
|
+
var rtBG={ Left:xText-textWidth, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
58754
58767
|
}
|
|
58755
58768
|
else //框架内部显示
|
|
58756
58769
|
{
|
|
58757
|
-
var rtBG={ Left:xText
|
|
58770
|
+
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
58771
|
+
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
58758
58772
|
}
|
|
58759
58773
|
|
|
58760
58774
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -58766,14 +58780,14 @@ function ChartDrawPriceLineV2()
|
|
|
58766
58780
|
if (this.Title)
|
|
58767
58781
|
{
|
|
58768
58782
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
58769
|
-
if (
|
|
58783
|
+
if (bDrawInside)
|
|
58770
58784
|
{
|
|
58771
|
-
var rtTitle={
|
|
58772
|
-
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
58785
|
+
var rtTitle={Left:rtBG.Left-textWidth, Top:rtBG.Top, Width:textWidth, Height:textHeight}
|
|
58773
58786
|
}
|
|
58774
58787
|
else
|
|
58775
58788
|
{
|
|
58776
|
-
var rtTitle={Left:
|
|
58789
|
+
var rtTitle={ Left:right-textWidth-1*pixelTatio, Top:rtBG.Top, Width:textWidth, Height:textHeight };
|
|
58790
|
+
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
58777
58791
|
}
|
|
58778
58792
|
|
|
58779
58793
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -11156,7 +11156,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11156
11156
|
{
|
|
11157
11157
|
if (this.RightSpaceCount>0)
|
|
11158
11158
|
{
|
|
11159
|
-
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount
|
|
11159
|
+
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
|
|
11160
11160
|
data.DataOffset+=step;
|
|
11161
11161
|
|
|
11162
11162
|
if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
|
|
@@ -62498,7 +62498,7 @@ function ChartDrawPriceLine()
|
|
|
62498
62498
|
}
|
|
62499
62499
|
}
|
|
62500
62500
|
|
|
62501
|
-
//画图工具-标价线2 支持横屏
|
|
62501
|
+
//画图工具-标价线2 支持横屏 支持价格文字在坐标内部显示
|
|
62502
62502
|
function ChartDrawPriceLineV2()
|
|
62503
62503
|
{
|
|
62504
62504
|
this.newMethod=IChartDrawPicture; //派生
|
|
@@ -62514,6 +62514,7 @@ function ChartDrawPriceLineV2()
|
|
|
62514
62514
|
this.IsDrawFirst=true;
|
|
62515
62515
|
this.TextColor="rgb(255,255,255)";
|
|
62516
62516
|
this.Title; //标题
|
|
62517
|
+
this.TextPosition=[null, 0]; //[0]=左侧(没有做) [1]=右侧 0=自动 1=内部 2=外部
|
|
62517
62518
|
|
|
62518
62519
|
this.Super_SetOption=this.SetOption; //父类函数
|
|
62519
62520
|
this.SetOption=function(option)
|
|
@@ -62523,6 +62524,7 @@ function ChartDrawPriceLineV2()
|
|
|
62523
62524
|
{
|
|
62524
62525
|
if (option.TextColor) this.TextColor=option.TextColor;
|
|
62525
62526
|
if (option.Title) this.Title=option.Title;
|
|
62527
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.TextPosition)) this.TextPosition=option.TextPosition.slice();
|
|
62526
62528
|
}
|
|
62527
62529
|
}
|
|
62528
62530
|
|
|
@@ -62594,14 +62596,20 @@ function ChartDrawPriceLineV2()
|
|
|
62594
62596
|
|
|
62595
62597
|
if (this.IsHScreen)
|
|
62596
62598
|
{
|
|
62597
|
-
|
|
62599
|
+
var position=this.TextPosition[1];
|
|
62600
|
+
var bDrawInside=false; //在内部绘制
|
|
62601
|
+
if (position==0) bDrawInside=chartBorder.Bottom<=10;
|
|
62602
|
+
else if (position==1) bDrawInside=true;
|
|
62603
|
+
else if (position==2) bDrawInside=false;
|
|
62604
|
+
|
|
62605
|
+
if (bDrawInside)
|
|
62598
62606
|
{
|
|
62599
|
-
|
|
62607
|
+
yText=yText-textWidth;
|
|
62608
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
62600
62609
|
}
|
|
62601
62610
|
else //框架内部显示
|
|
62602
62611
|
{
|
|
62603
|
-
|
|
62604
|
-
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
62612
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width: textHeight, Height:textWidth };
|
|
62605
62613
|
}
|
|
62606
62614
|
|
|
62607
62615
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62617,13 +62625,13 @@ function ChartDrawPriceLineV2()
|
|
|
62617
62625
|
if (this.Title)
|
|
62618
62626
|
{
|
|
62619
62627
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
62620
|
-
if (
|
|
62628
|
+
if (bDrawInside)
|
|
62621
62629
|
{
|
|
62622
|
-
var rtTitle={
|
|
62630
|
+
var rtTitle={Left:rtBG.Left, Top:rtBG.Top-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth};
|
|
62623
62631
|
}
|
|
62624
62632
|
else
|
|
62625
62633
|
{
|
|
62626
|
-
var rtTitle={Left:rtBG.Left, Top:
|
|
62634
|
+
var rtTitle={ Left:rtBG.Left, Top:bottom-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth };
|
|
62627
62635
|
}
|
|
62628
62636
|
|
|
62629
62637
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62639,14 +62647,20 @@ function ChartDrawPriceLineV2()
|
|
|
62639
62647
|
}
|
|
62640
62648
|
else
|
|
62641
62649
|
{
|
|
62642
|
-
|
|
62650
|
+
var position=this.TextPosition[1];
|
|
62651
|
+
var bDrawInside=false; //在内部绘制
|
|
62652
|
+
if (position==0) bDrawInside=chartBorder.Right<=10;
|
|
62653
|
+
else if (position==1) bDrawInside=true;
|
|
62654
|
+
else if (position==2) bDrawInside=false;
|
|
62655
|
+
|
|
62656
|
+
if (bDrawInside)
|
|
62643
62657
|
{
|
|
62644
|
-
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62645
|
-
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
62658
|
+
var rtBG={ Left:xText-textWidth, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62646
62659
|
}
|
|
62647
62660
|
else //框架内部显示
|
|
62648
62661
|
{
|
|
62649
|
-
var rtBG={ Left:xText
|
|
62662
|
+
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62663
|
+
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
62650
62664
|
}
|
|
62651
62665
|
|
|
62652
62666
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62658,14 +62672,14 @@ function ChartDrawPriceLineV2()
|
|
|
62658
62672
|
if (this.Title)
|
|
62659
62673
|
{
|
|
62660
62674
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
62661
|
-
if (
|
|
62675
|
+
if (bDrawInside)
|
|
62662
62676
|
{
|
|
62663
|
-
var rtTitle={
|
|
62664
|
-
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
62677
|
+
var rtTitle={Left:rtBG.Left-textWidth, Top:rtBG.Top, Width:textWidth, Height:textHeight}
|
|
62665
62678
|
}
|
|
62666
62679
|
else
|
|
62667
62680
|
{
|
|
62668
|
-
var rtTitle={Left:
|
|
62681
|
+
var rtTitle={ Left:right-textWidth-1*pixelTatio, Top:rtBG.Top, Width:textWidth, Height:textHeight };
|
|
62682
|
+
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
62669
62683
|
}
|
|
62670
62684
|
|
|
62671
62685
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -131439,7 +131453,7 @@ function ScrollBarBGChart()
|
|
|
131439
131453
|
|
|
131440
131454
|
|
|
131441
131455
|
|
|
131442
|
-
var HQCHART_VERSION="1.1.
|
|
131456
|
+
var HQCHART_VERSION="1.1.13113";
|
|
131443
131457
|
|
|
131444
131458
|
function PrintHQChartVersion()
|
|
131445
131459
|
{
|
|
@@ -11200,7 +11200,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
11200
11200
|
{
|
|
11201
11201
|
if (this.RightSpaceCount>0)
|
|
11202
11202
|
{
|
|
11203
|
-
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount
|
|
11203
|
+
if (xPointcount+data.DataOffset>=data.Data.length+this.RightSpaceCount) return false;
|
|
11204
11204
|
data.DataOffset+=step;
|
|
11205
11205
|
|
|
11206
11206
|
if (data.DataOffset+xPointcount>=data.Data.length+this.RightSpaceCount)
|
|
@@ -62542,7 +62542,7 @@ function ChartDrawPriceLine()
|
|
|
62542
62542
|
}
|
|
62543
62543
|
}
|
|
62544
62544
|
|
|
62545
|
-
//画图工具-标价线2 支持横屏
|
|
62545
|
+
//画图工具-标价线2 支持横屏 支持价格文字在坐标内部显示
|
|
62546
62546
|
function ChartDrawPriceLineV2()
|
|
62547
62547
|
{
|
|
62548
62548
|
this.newMethod=IChartDrawPicture; //派生
|
|
@@ -62558,6 +62558,7 @@ function ChartDrawPriceLineV2()
|
|
|
62558
62558
|
this.IsDrawFirst=true;
|
|
62559
62559
|
this.TextColor="rgb(255,255,255)";
|
|
62560
62560
|
this.Title; //标题
|
|
62561
|
+
this.TextPosition=[null, 0]; //[0]=左侧(没有做) [1]=右侧 0=自动 1=内部 2=外部
|
|
62561
62562
|
|
|
62562
62563
|
this.Super_SetOption=this.SetOption; //父类函数
|
|
62563
62564
|
this.SetOption=function(option)
|
|
@@ -62567,6 +62568,7 @@ function ChartDrawPriceLineV2()
|
|
|
62567
62568
|
{
|
|
62568
62569
|
if (option.TextColor) this.TextColor=option.TextColor;
|
|
62569
62570
|
if (option.Title) this.Title=option.Title;
|
|
62571
|
+
if (IFrameSplitOperator.IsNonEmptyArray(option.TextPosition)) this.TextPosition=option.TextPosition.slice();
|
|
62570
62572
|
}
|
|
62571
62573
|
}
|
|
62572
62574
|
|
|
@@ -62638,14 +62640,20 @@ function ChartDrawPriceLineV2()
|
|
|
62638
62640
|
|
|
62639
62641
|
if (this.IsHScreen)
|
|
62640
62642
|
{
|
|
62641
|
-
|
|
62643
|
+
var position=this.TextPosition[1];
|
|
62644
|
+
var bDrawInside=false; //在内部绘制
|
|
62645
|
+
if (position==0) bDrawInside=chartBorder.Bottom<=10;
|
|
62646
|
+
else if (position==1) bDrawInside=true;
|
|
62647
|
+
else if (position==2) bDrawInside=false;
|
|
62648
|
+
|
|
62649
|
+
if (bDrawInside)
|
|
62642
62650
|
{
|
|
62643
|
-
|
|
62651
|
+
yText=yText-textWidth;
|
|
62652
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
62644
62653
|
}
|
|
62645
62654
|
else //框架内部显示
|
|
62646
62655
|
{
|
|
62647
|
-
|
|
62648
|
-
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width:textHeight, Height: textWidth};
|
|
62656
|
+
var rtBG={ Left:(xText-textHeight/2), Top:yText , Width: textHeight, Height:textWidth };
|
|
62649
62657
|
}
|
|
62650
62658
|
|
|
62651
62659
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62661,13 +62669,13 @@ function ChartDrawPriceLineV2()
|
|
|
62661
62669
|
if (this.Title)
|
|
62662
62670
|
{
|
|
62663
62671
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
62664
|
-
if (
|
|
62672
|
+
if (bDrawInside)
|
|
62665
62673
|
{
|
|
62666
|
-
var rtTitle={
|
|
62674
|
+
var rtTitle={Left:rtBG.Left, Top:rtBG.Top-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth};
|
|
62667
62675
|
}
|
|
62668
62676
|
else
|
|
62669
62677
|
{
|
|
62670
|
-
var rtTitle={Left:rtBG.Left, Top:
|
|
62678
|
+
var rtTitle={ Left:rtBG.Left, Top:bottom-textWidth-1*pixelTatio, Width:textHeight, Height:textWidth };
|
|
62671
62679
|
}
|
|
62672
62680
|
|
|
62673
62681
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62683,14 +62691,20 @@ function ChartDrawPriceLineV2()
|
|
|
62683
62691
|
}
|
|
62684
62692
|
else
|
|
62685
62693
|
{
|
|
62686
|
-
|
|
62694
|
+
var position=this.TextPosition[1];
|
|
62695
|
+
var bDrawInside=false; //在内部绘制
|
|
62696
|
+
if (position==0) bDrawInside=chartBorder.Right<=10;
|
|
62697
|
+
else if (position==1) bDrawInside=true;
|
|
62698
|
+
else if (position==2) bDrawInside=false;
|
|
62699
|
+
|
|
62700
|
+
if (bDrawInside)
|
|
62687
62701
|
{
|
|
62688
|
-
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62689
|
-
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
62702
|
+
var rtBG={ Left:xText-textWidth, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62690
62703
|
}
|
|
62691
62704
|
else //框架内部显示
|
|
62692
62705
|
{
|
|
62693
|
-
var rtBG={ Left:xText
|
|
62706
|
+
var rtBG={ Left:xText, Top:(yText-textHeight/2-1*pixelTatio) , Width:textWidth, Height: textHeight};
|
|
62707
|
+
if (rtBG.Left+rtBG.Width>border.ChartWidth) rtBG.Left=border.ChartWidth-rtBG.Width-2*pixelTatio;
|
|
62694
62708
|
}
|
|
62695
62709
|
|
|
62696
62710
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -62702,14 +62716,14 @@ function ChartDrawPriceLineV2()
|
|
|
62702
62716
|
if (this.Title)
|
|
62703
62717
|
{
|
|
62704
62718
|
var textWidth=this.Canvas.measureText(this.Title).width+2*pixelTatio;
|
|
62705
|
-
if (
|
|
62719
|
+
if (bDrawInside)
|
|
62706
62720
|
{
|
|
62707
|
-
var rtTitle={
|
|
62708
|
-
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
62721
|
+
var rtTitle={Left:rtBG.Left-textWidth, Top:rtBG.Top, Width:textWidth, Height:textHeight}
|
|
62709
62722
|
}
|
|
62710
62723
|
else
|
|
62711
62724
|
{
|
|
62712
|
-
var rtTitle={Left:
|
|
62725
|
+
var rtTitle={ Left:right-textWidth-1*pixelTatio, Top:rtBG.Top, Width:textWidth, Height:textHeight };
|
|
62726
|
+
if (rtBG.Left!=right) rtTitle.Left=rtBG.Left-textWidth-1*pixelTatio;
|
|
62713
62727
|
}
|
|
62714
62728
|
|
|
62715
62729
|
this.Canvas.fillStyle=this.LineColor;
|
|
@@ -134003,7 +134017,7 @@ function HQChartScriptWorker()
|
|
|
134003
134017
|
|
|
134004
134018
|
|
|
134005
134019
|
|
|
134006
|
-
var HQCHART_VERSION="1.1.
|
|
134020
|
+
var HQCHART_VERSION="1.1.13113";
|
|
134007
134021
|
|
|
134008
134022
|
function PrintHQChartVersion()
|
|
134009
134023
|
{
|