hqchart 1.1.12723 → 1.1.12729
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
|
@@ -1346,10 +1346,10 @@ this.CacheCanvasElement=null;if(bCacheCanvas)this.CacheCanvasElement=document.cr
|
|
|
1346
1346
|
this.ModifyIndexDialog=new ModifyIndexDialog(divElement);this.ChangeIndexDialog=new ChangeIndexDialog(divElement);this.MinuteDialog=new MinuteDialog(divElement);//额外的画布
|
|
1347
1347
|
this.MapExtraCanvasElement=new _map2.default();//key=画布名字, value={ Element:, Canvas:}
|
|
1348
1348
|
this.CreateExtraCanvasElement=function(name,option){if(this.MapExtraCanvasElement.has(name))return this.MapExtraCanvasElement.get(name);var element=document.createElement("canvas");element.className='jschart-drawing-extra';element.id=Guid();if(name==JSChart.CorssCursorCanvasKey)element.setAttribute("tabindex",5);else element.setAttribute("tabindex",1);if(element.style){element.style.outline='none';element.style.position="absolute";element.style.left='0px';element.style.top='0px';element.style["pointer-events"]="none";}if(option){if(IFrameSplitOperator.IsNumber(option.TabIndex))element.setAttribute("tabindex",option.TabIndex);if(IFrameSplitOperator.IsNumber(option.ZIndex))element.style["z-index"]=option.ZIndex;}divElement.appendChild(element);var item={Element:element,Canvas:null};this.MapExtraCanvasElement.set(name,item);};this.GetExtraCanvas=function(name){if(!this.MapExtraCanvasElement.has(name))return null;var item=this.MapExtraCanvasElement.get(name);if(!item.Element)return null;if(!item.Canvas)item.Canvas=item.Element.getContext("2d");return item;};this.OnSize=function(option)//{ Type:1 新版本OnSize Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
1349
|
-
{//画布大小通过div获取
|
|
1350
|
-
var height=parseInt(this.DivElement.style.height.replace("px",""));if(this.ToolElement){//TODO调整工具条大小
|
|
1349
|
+
{//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
1350
|
+
if(this.DivElement.style.height&&this.DivElement.style.width){var height=parseInt(this.DivElement.style.height.replace("px",""));var width=parseInt(this.DivElement.style.width.replace("px",""));}else{var height=this.DivElement.offsetHeight;var width=this.DivElement.offsetWidth;}if(this.ToolElement){//TODO调整工具条大小
|
|
1351
1351
|
height-=this.ToolElement.style.height.replace("px","");//减去工具条的高度
|
|
1352
|
-
}this.CanvasElement.height=height;this.CanvasElement.width=
|
|
1352
|
+
}this.CanvasElement.height=height;this.CanvasElement.width=width;this.CanvasElement.style.width=this.CanvasElement.width+'px';this.CanvasElement.style.height=this.CanvasElement.height+'px';var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
1353
1353
|
this.CanvasElement.height*=pixelTatio;this.CanvasElement.width*=pixelTatio;if(this.OffscreenCanvasElement){this.OffscreenCanvasElement.height=this.CanvasElement.height;this.OffscreenCanvasElement.width=this.CanvasElement.width;}if(this.CacheCanvasElement){this.CacheCanvasElement.height=this.CanvasElement.height;this.CacheCanvasElement.width=this.CanvasElement.width;}var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=(0,_getIterator3.default)(this.MapExtraCanvasElement),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var mapItem=_step.value;var item=mapItem[1];var element=item.Element;if(!element)continue;element.height=this.CanvasElement.height;element.width=this.CanvasElement.width;element.style.width=this.CanvasElement.style.width;element.style.height=this.CanvasElement.style.height;}}catch(err){_didIteratorError=true;_iteratorError=err;}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return();}}finally{if(_didIteratorError){throw _iteratorError;}}}JSConsole.Chart.Log('[JSChart::OnSize] devicePixelRatio='+window.devicePixelRatio+', height='+this.CanvasElement.height+', width='+this.CanvasElement.width);if(option&&option.Redraw==false)return;if(this.JSChartContainer){if(option&&option.XYSplit===true)this.JSChartContainer.ResetFrameXYSplit();if(this.JSChartContainer.OnSize&&option&&option.Type==1){this.JSChartContainer.OnSize();}else{if(this.JSChartContainer.Frame)this.JSChartContainer.Frame.SetSizeChage(true);this.JSChartContainer.Draw();}}};//手机屏需要调整 间距
|
|
1354
1354
|
this.AdjustChartBorder=function(chart){var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
1355
1355
|
chart.Frame.ChartBorder.Left*=pixelTatio;chart.Frame.ChartBorder.Right*=pixelTatio;chart.Frame.ChartBorder.Top*=pixelTatio;chart.Frame.ChartBorder.Bottom*=pixelTatio;if(chart.Frame.AutoLeftBorder){var item=chart.Frame.AutoLeftBorder;if(IFrameSplitOperator.IsNumber(item.MinWidth))item.MinWidth*=pixelTatio;if(IFrameSplitOperator.IsNumber(item.Blank))item.Blank*=pixelTatio;}if(chart.Frame.AutoRightBorder){var item=chart.Frame.AutoRightBorder;if(IFrameSplitOperator.IsNumber(item.MinWidth))item.MinWidth*=pixelTatio;if(IFrameSplitOperator.IsNumber(item.Blank))item.Blank*=pixelTatio;}};this.AdjustTitleHeight=function(chart){var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
@@ -2217,12 +2217,16 @@ this.LeftButtonWidth=0;//左侧按钮的宽度
|
|
|
2217
2217
|
this.IsMinSize=false;//窗口是否最小化
|
|
2218
2218
|
this.LogoTextColor=g_JSChartResource.FrameLogo.TextColor;this.LogoTextFont=g_JSChartResource.FrameLogo.Font;this.LogoBGColor=g_JSChartResource.FrameLogo.BGColor;this.GlobalOption;//this.IsDrawLeftBorder;
|
|
2219
2219
|
this.IsDrawRightBorder=false;//是否绘制右侧刻度空白的边框
|
|
2220
|
+
this.IsDrawLeftBorder=false;//是否绘制右侧刻度空白的边框
|
|
2220
2221
|
this.PtInButtons=function(x,y)//坐标是否在按钮上
|
|
2221
2222
|
{for(var i=0;i<this.Buttons.length;++i){var item=this.Buttons[i];if(!item.Rect)continue;var rect=item.Rect;this.Canvas.beginPath();this.Canvas.rect(rect.Left,rect.Top,rect.Width,rect.Height);if(this.Canvas.isPointInPath(x,y)){return{ID:item.ID,Rect:rect};}}return null;};this.GetBorder=function(){if(this.IsHScreen)return this.ChartBorder.GetHScreenBorder();else return this.ChartBorder.GetBorder();};this.Draw=function(){this.Buttons=[];this.DrawClientBG();this.DrawFrame();this.DrawBorder();this.SizeChange=false;this.XYSplit=false;this.XSplit=false;};this.DrawFrame=function(){};this.DrawClientBG=function(){if(!this.ClientBGColor)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
|
|
2222
2223
|
var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;this.Canvas.fillStyle=this.ClientBGColor;this.Canvas.fillRect(left,top,width,height);};this.ClearCoordinateText=function(option){if(IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo)){for(var i=0;i<this.HorizontalInfo.length;++i){var item=this.HorizontalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}if(IFrameSplitOperator.IsNonEmptyArray(this.VerticalInfo)){for(var i=0;i<this.VerticalInfo.length;++i){var item=this.VerticalInfo[i];if(item&&item.Message&&Array.isArray(item.Message))item.Message[0]=item.Message[1]=null;}}};//画边框
|
|
2223
2224
|
this.DrawBorder=function(){if(!this.IsShowBorder)return;if(this.IsMinSize)return;var border=this.IsHScreen==true?this.ChartBorder.GetHScreenBorder():this.ChartBorder.GetBorder();var left=ToFixedPoint(border.Left);var top=ToFixedPoint(border.Top);//var top=ToFixedPoint(border.TopEx);
|
|
2224
2225
|
var right=ToFixedPoint(border.Right);var bottom=ToFixedPoint(border.Bottom);var width=right-left;var height=bottom-top;//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
|
|
2225
|
-
if(this.BorderLine==null){if(this.IsDrawRightBorder){
|
|
2226
|
+
if(this.BorderLine==null){if(this.IsDrawRightBorder||this.IsDrawLeftBorder){this.Canvas.strokeStyle=this.PenBorder;if(this.IsDrawRightBorder&&this.IsDrawLeftBorder){var xRight=ToFixedPoint(border.ChartWidth);var xLeft=ToFixedPoint(0);this.Canvas.strokeRect(xLeft,top,xRight-xLeft-1,height);//少一个像素让边框显示出来
|
|
2227
|
+
}else if(this.IsDrawRightBorder){var xRight=ToFixedPoint(border.ChartWidth);this.Canvas.strokeRect(left,top,xRight-left-1,height);//少一个像素让边框显示出来
|
|
2228
|
+
}else if(this.IsDrawLeftBorder){var xLeft=ToFixedPoint(0);this.Canvas.strokeRect(xLeft,top,right-xLeft,height);//少一个像素让边框显示出来
|
|
2229
|
+
}if(this.IsDrawRightBorder){this.Canvas.beginPath();this.Canvas.moveTo(right,top);this.Canvas.lineTo(right,bottom);this.Canvas.stroke();}if(this.IsDrawLeftBorder){this.Canvas.beginPath();this.Canvas.moveTo(left,top);this.Canvas.lineTo(left,bottom);this.Canvas.stroke();}}else{this.Canvas.strokeStyle=this.PenBorder;this.Canvas.strokeRect(left,top,width,height);}}else if(IFrameSplitOperator.IsPlusNumber(this.BorderLine))//单独绘制每个边框
|
|
2226
2230
|
{this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();if((this.BorderLine&1)>0)//上
|
|
2227
2231
|
{this.Canvas.moveTo(left,top);this.Canvas.lineTo(right,top);}if((this.BorderLine&2)>0)//下
|
|
2228
2232
|
{this.Canvas.moveTo(left,bottom);this.Canvas.lineTo(right,bottom);}if((this.BorderLine&4)>0)//左
|
|
@@ -2286,8 +2290,10 @@ for(var i=0;i<aryButton.length;++i){var item=aryButton[i];var size=item.Style.Si
|
|
|
2286
2290
|
this.Canvas.fillStyle=this.ButtonTooltip.Color;this.Canvas.fillText(text,x+4,y+bgHeight/2);};//isLimit 是否限制在当前坐标下
|
|
2287
2291
|
this.GetYFromData=function(value,isLimit){if(this.Logarithmic&&this.GetYLogarithmicFromData){return this.GetYLogarithmicFromData(value,isLimit);}if(isLimit===false){if(this.CoordinateType==1){var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetTopEx()+height;}else{var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetBottomEx()-height;}}else{if(this.CoordinateType==1){if(value<=this.HorizontalMin)return this.ChartBorder.GetTopEx();if(value>=this.HorizontalMax)return this.ChartBorder.GetBottomEx();var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetTopEx()+height;}else{if(value<=this.HorizontalMin)return this.ChartBorder.GetBottomEx();if(value>=this.HorizontalMax)return this.ChartBorder.GetTopEx();var height=this.ChartBorder.GetHeightEx()*(value-this.HorizontalMin)/(this.HorizontalMax-this.HorizontalMin);return this.ChartBorder.GetBottomEx()-height;}}};//画Y轴
|
|
2288
2292
|
this.DrawHorizontal=function(){this.RightTextMaxWidth=0;if(!IFrameSplitOperator.IsNonEmptyArray(this.HorizontalInfo))return;if(this.ChartBorder.IsShowTitleOnly)return;var border=this.ChartBorder.GetBorder();var left=border.Left;var right=border.Right;var bottom=border.Bottom;var top=this.ChartBorder.GetTop();var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var isDrawLeft=borderLeft>10&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;var rightExtendLine=null;//右侧延长线
|
|
2289
|
-
|
|
2290
|
-
if(IFrameSplitOperator.IsNonEmptyArray(this.
|
|
2293
|
+
var leftExtendLine=null;//左侧延长线
|
|
2294
|
+
if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){rightExtendLine=this.YLineExtend[1];leftExtendLine=this.YLineExtend[0];}var rightExtendText=null;//右侧文字设置
|
|
2295
|
+
var leftExtendText=null;//左侧文字设置
|
|
2296
|
+
if(IFrameSplitOperator.IsNonEmptyArray(this.YTextExtend)){leftExtendText=this.YTextExtend[0];rightExtendText=this.YTextExtend[1];}var yPrev=null;//上一个坐标y的值
|
|
2291
2297
|
var pixelRatio=GetDevicePixelRatio();var itemHeight=(border.BottomEx-border.TopEx)/this.HorizontalInfo.length;var aryMultiText=[];var rtPreRight,rtRight,rtLeft,rtPreLeft;var textBaseline=0;//0=上 1=中 2=下
|
|
2292
2298
|
for(var i=this.HorizontalInfo.length-1;i>=0;--i)//从上往下画分割线
|
|
2293
2299
|
{var item=this.HorizontalInfo[i];var y=this.GetYFromData(item.Value);if(y!=null&&yPrev!=null&&Math.abs(y-yPrev)<this.MinYDistance)continue;//两个坐标在近了 就不画了
|
|
@@ -2298,13 +2304,13 @@ this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right
|
|
|
2298
2304
|
{}else if(item.LineType==8||item.LineType==9)//集合竞价不画线
|
|
2299
2305
|
{}else if(item.LineType>0){if(g_JSChartResource.FrameYLineDash){this.Canvas.save();this.Canvas.setLineDash(g_JSChartResource.FrameYLineDash);//虚线
|
|
2300
2306
|
this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();this.Canvas.setLineDash([]);this.Canvas.restore();}else{this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(right,yFixed);this.Canvas.stroke();}}if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}var yText=y;if(y>=bottom-2){this.Canvas.textBaseline='bottom';textBaseline=2;}else if(y<=top+2){this.Canvas.textBaseline='top';yText+=this.YTextTopOffset;textBaseline=0;}else{this.Canvas.textBaseline="middle";textBaseline=1;}//左边 坐标信息 间距小于10 不画坐标
|
|
2301
|
-
this.Canvas.strokeStyle=item.TextColor;this.Canvas.fillStyle=item.TextColor;if(item.Message[0]!=null&&isDrawLeft){if(item.Font!=null)this.Canvas.font=item.Font;rtLeft=this.GetTextTopBottom(textBaseline,yText);if(!rtPreLeft||rtLeft&&!this.IsTextTopBottomOverlap(rtLeft,rtPreLeft)){this.Canvas.textAlign="right";this.Canvas.fillText(item.Message[0],
|
|
2307
|
+
this.Canvas.strokeStyle=item.TextColor;this.Canvas.fillStyle=item.TextColor;if(item.Message[0]!=null&&isDrawLeft){if(item.Font!=null)this.Canvas.font=item.Font;var xText=left;if(leftExtendLine&&leftExtendLine.Width>1){var lineLength=leftExtendLine.Width;if(leftExtendLine.Color)this.Canvas.strokeStyle=leftExtendLine.Color;else this.Canvas.strokeStyle=item.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xText,yFixed);this.Canvas.lineTo(xText-lineLength,yFixed);this.Canvas.stroke();xText-=lineLength;}rtLeft=this.GetTextTopBottom(textBaseline,yText);if(!rtPreLeft||rtLeft&&!this.IsTextTopBottomOverlap(rtLeft,rtPreLeft)){if(leftExtendText&&leftExtendText.Align===1){this.Canvas.textAlign="left";this.Canvas.fillText(item.Message[0],this.YTextPadding[0],yText);}else{this.Canvas.textAlign="right";this.Canvas.fillText(item.Message[0],xText-this.YTextPadding[0],yText);rtPreLeft=rtLeft;}}}//右边 坐标信息 间距小于10 不画坐标
|
|
2302
2308
|
if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;var xText=right;if(item.LineType==3){var lineLength=this.ShortYLineLength*GetDevicePixelRatio();this.Canvas.beginPath();this.Canvas.moveTo(xText,yFixed);this.Canvas.lineTo(xText+lineLength,yFixed);this.Canvas.stroke();xText+=lineLength;}//右侧延长线
|
|
2303
2309
|
if(rightExtendLine&&rightExtendLine.Width>1){var lineLength=rightExtendLine.Width;if(rightExtendLine.Color)this.Canvas.strokeStyle=rightExtendLine.Color;else this.Canvas.strokeStyle=item.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(xText,yFixed);this.Canvas.lineTo(xText+lineLength,yFixed);this.Canvas.stroke();xText+=lineLength+2;}this.Canvas.textAlign="left";if(Array.isArray(item.Message[1])){if(this.MultiTextFormat==1)//显示1行 格式:价格/百分比
|
|
2304
2310
|
{if(item.ExtendData){if(item.ExtendData.Font)this.Canvas.font=item.ExtendData.Font;}var textData={Text:[{Text:item.Message[1][0],Width:this.Canvas.measureText(item.Message[1][0]).width},{Text:item.Message[1][1],Width:this.Canvas.measureText(item.Message[1][1]).width}],X:xText+2,Y:yText,TextBaseline:this.Canvas.textBaseline,Item:item};aryMultiText.push(textData);}else if(this.MultiTextFormat==2)//显示2行
|
|
2305
2311
|
{this.Canvas.fillText(item.Message[1][0],xText+this.YTextPadding[1],yText);var lineHeight=this.Canvas.measureText('M').width;if(itemHeight>lineHeight*2)this.Canvas.fillText(item.Message[1][1],xText+this.YTextPadding[1],yText+lineHeight);}else//显示第1行
|
|
2306
2312
|
{this.Canvas.fillText(item.Message[1][0],xText+this.YTextPadding[1],yText);}}else{//计算显示的区域
|
|
2307
|
-
rtRight=this.GetTextTopBottom(textBaseline,yText);if(!rtPreRight||rtRight&&!this.IsTextTopBottomOverlap(rtRight,rtPreRight)){if(item.TextColor2)this.Canvas.fillStyle=item.TextColor2;if(rightExtendText&&rightExtendText.Align&&this.YRightTextInfo){this.Canvas.textAlign="right";var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];this.Canvas.fillText(item.Message[1],xRight,yText);}else{this.Canvas.fillText(item.Message[1],xText+this.YTextPadding[1],yText);}rtPreRight=rtRight;}}}yPrev=y;}if(IFrameSplitOperator.IsNonEmptyArray(aryMultiText)&&this.MultiTextFormat==1)this.DrawHorizontalMuText(aryMultiText);if(isDrawRight&&this.IsDrawRightBorder&&this.YRightTextInfo){var xRight=this.YRightTextInfo.MainTextWidth+right;xLine=ToFixedPoint(xRight);this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(xLine,top);this.Canvas.lineTo(xLine,bottom);this.Canvas.stroke();if(IFrameSplitOperator.IsNonEmptyArray(this.YRightTextInfo.AryOverlayWidth)){this.Canvas.beginPath();for(var i=0;i<this.YRightTextInfo.AryOverlayWidth.length;++i){var width=this.YRightTextInfo.AryOverlayWidth[i];xRight+=width;xLine=ToFixedPoint(xRight);this.Canvas.moveTo(xLine,top);this.Canvas.lineTo(xLine,bottom);}this.Canvas.stroke();}}};//上下区域是否重叠
|
|
2313
|
+
rtRight=this.GetTextTopBottom(textBaseline,yText);if(!rtPreRight||rtRight&&!this.IsTextTopBottomOverlap(rtRight,rtPreRight)){if(item.TextColor2)this.Canvas.fillStyle=item.TextColor2;if(rightExtendText&&rightExtendText.Align===2&&this.YRightTextInfo){this.Canvas.textAlign="right";var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];this.Canvas.fillText(item.Message[1],xRight,yText);}else{this.Canvas.fillText(item.Message[1],xText+this.YTextPadding[1],yText);}rtPreRight=rtRight;}}}yPrev=y;}if(IFrameSplitOperator.IsNonEmptyArray(aryMultiText)&&this.MultiTextFormat==1)this.DrawHorizontalMuText(aryMultiText);if(isDrawRight&&this.IsDrawRightBorder&&this.YRightTextInfo){var xRight=this.YRightTextInfo.MainTextWidth+right;xLine=ToFixedPoint(xRight);this.Canvas.strokeStyle=this.PenBorder;this.Canvas.beginPath();this.Canvas.moveTo(xLine,top);this.Canvas.lineTo(xLine,bottom);this.Canvas.stroke();if(IFrameSplitOperator.IsNonEmptyArray(this.YRightTextInfo.AryOverlayWidth)){this.Canvas.beginPath();for(var i=0;i<this.YRightTextInfo.AryOverlayWidth.length;++i){var width=this.YRightTextInfo.AryOverlayWidth[i];xRight+=width;xLine=ToFixedPoint(xRight);this.Canvas.moveTo(xLine,top);this.Canvas.lineTo(xLine,bottom);}this.Canvas.stroke();}}};//上下区域是否重叠
|
|
2308
2314
|
this.IsTextTopBottomOverlap=function(rt,rt2){if(rt2.Top>=rt.Top&&rt2.Top<=rt.Bottom)return true;if(rt2.Bottom>=rt.Top&&rt2.Bottom<=rt.Bottom)return true;return false;};this.GetTextTopBottom=function(textBaseline,yText){var rtRight=null;var textHeight=this.Canvas.measureText('擎').width;if(textBaseline==0){rtRight={Top:yText,Bottom:yText+textHeight};}else if(textBaseline==1){rtRight={Top:yText-textHeight/2};rtRight.Bottom=rtRight.Top+textHeight;}else if(textBaseline==2){rtRight={Bottom:yText};rtRight.Top=rtRight.Bottom-textHeight;}return rtRight;};this.DrawHorizontalMuText=function(aryText){var maxWidth=[null,null];for(var i=0;i<aryText.length;++i){var item=aryText[i];var width=item.Text[0].Width;if(!IFrameSplitOperator.IsNumber(maxWidth[0]))maxWidth[0]=width;else if(maxWidth[0]<width)maxWidth[0]=width;width=item.Text[1].Width;if(!IFrameSplitOperator.IsNumber(maxWidth[1]))maxWidth[1]=width;else if(maxWidth[1]<width)maxWidth[1]=width;}for(var i=0;i<aryText.length;++i){var item=aryText[i];var message=item.Item;this.Canvas.textBaseline=message.TextBaseline;if(message.ExtendData&&message.ExtendData.Font)this.Canvas.font=message.ExtendData.Font;else if(message.Font)this.Canvas.font=message.Font;if(message.ExtendData&&message.ExtendData.PriceColor)this.Canvas.fillStyle=message.ExtendData.PriceColor;else this.Canvas.fillStyle=message.TextColor;this.Canvas.textAlign="right";var x=item.X+maxWidth[1];this.Canvas.fillText(item.Text[1].Text,x,item.Y);if(message.ExtendData&&message.ExtendData.SplitColor)this.Canvas.fillStyle=message.ExtendData.SplitColor;else this.Canvas.fillStyle=message.TextColor;this.Canvas.textAlign="left";var splitWidth=this.Canvas.measureText('/').width;this.Canvas.fillText('/',x,item.Y);if(message.ExtendData&&message.ExtendData.PercentageColor)this.Canvas.fillStyle=message.ExtendData.PercentageColor;else this.Canvas.fillStyle=message.TextColor;this.Canvas.textAlign="right";var x=item.X+maxWidth[1]+maxWidth[0]+splitWidth;this.Canvas.fillText(item.Text[0].Text,x,item.Y);var textWidth=maxWidth[1]+maxWidth[0]+splitWidth*4;if(this.RightTextMaxWidth<textWidth)this.RightTextMaxWidth=textWidth;}};//画Y轴Message[2,3]两个内部刻度
|
|
2309
2315
|
this.DrawInsideClientHorizontal=function(){var border=this.GetBorder();if(border.DayBorder&&IFrameSplitOperator.IsNonEmptyArray(border.DayBorder)){var item=border.DayBorder[0];var left=item.LeftEx;var item=border.DayBorder[border.DayBorder.length-1];var right=item.RightEx;var bottom=border.Bottom;var top=border.TopTitle;}else{var left=border.LeftEx;var right=border.RightEx;var bottom=border.Bottom;var top=border.TopTitle;}var pixelTatio=GetDevicePixelRatio();var yPrev=null;//上一个坐标y的值
|
|
2310
2316
|
var yInsideText=null;for(var i=this.HorizontalInfo.length-1;i>=0;--i)//从上往下画分割线
|
|
@@ -2342,12 +2348,12 @@ var textLeft=yText-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=item.LineColo
|
|
|
2342
2348
|
var width=this.Canvas.measureText(item.Title).width+2*pixelTatio;if(this.IsHScreen){var bgTop=bottom-width;var textLeft=y-textHeight/2-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,textHeight,width);this.DrawHScreenText({X:y,Y:bgTop},{Text:item.Title,Color:item.TextColor,XOffset:1*pixelTatio,YOffset:2*pixelTatio});}else{var bgTop=y-textHeight/2-1*pixelTatio;var textLeft=right-width-1*pixelTatio;this.Canvas.fillStyle=bgColor;this.Canvas.fillRect(textLeft,bgTop,width,textHeight);this.Canvas.fillStyle=item.TextColor;this.Canvas.fillText(item.Title,textLeft+1*pixelTatio,y);}}}}}};this.SendDrawCountDownEvent=function(sendData){if(!this.GetEventCallback)return false;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_COUNTDOWN);if(!event||!event.Callback)return false;event.Callback(event,sendData,this);return true;};this.DrawDotLine=function(left,right,y,color,option){var pixelTatio=GetDevicePixelRatio();this.Canvas.save();this.Canvas.strokeStyle=color;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth))this.Canvas.lineWidth=option.LineWidth*pixelTatio;if(option.LineDash)this.Canvas.setLineDash(option.LineDash);else this.Canvas.setLineDash([5*pixelTatio,5*pixelTatio]);//虚线
|
|
2343
2349
|
this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();this.Canvas.restore();};this.DrawLine=function(left,right,y,color,lineType,option){if(lineType==-1)return;if(lineType==0){var pixelRatio=GetDevicePixelRatio();this.Canvas.strokeStyle=color;var bChangeLineWidth=false;if(option&&IFrameSplitOperator.IsPlusNumber(option.LineWidth)){this.Canvas.lineWidth=option.LineWidth*pixelRatio;bChangeLineWidth=true;}this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(ToFixedPoint(y),left);this.Canvas.lineTo(ToFixedPoint(y),right);}else{this.Canvas.moveTo(left,ToFixedPoint(y));this.Canvas.lineTo(right,ToFixedPoint(y));}this.Canvas.stroke();if(bChangeLineWidth){this.Canvas.lineWidth=pixelRatio;}}else{this.DrawDotLine(left,right,y,color,option);}};this.DrawHScreenText=function(center,data){this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=data.Color;this.Canvas.save();this.Canvas.translate(center.X,center.Y);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(data.Text,data.XOffset,data.YOffset);this.Canvas.restore();};this.RGBToStruct=function(rgb){if(/^(rgb|RGB)/.test(rgb)){var aColor=rgb.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");var result={};if(aColor.length!=3)return null;result.R=Number(aColor[0]);result.G=Number(aColor[1]);result.B=Number(aColor[2]);return result;}return null;};this.GetScaleTextWidth=function(){var border=this.ChartBorder.GetBorder();var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
|
|
2344
2350
|
if(this.IsHScreen){var borderTop=this.ChartBorder.Top;var borderBottom=this.ChartBorder.Bottom;var isDrawLeft=borderTop>10*pixelTatio&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderBottom>10*pixelTatio&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}else{var borderRight=this.ChartBorder.Right;var borderLeft=this.ChartBorder.Left;var isDrawLeft=borderLeft>10&&this.IsShowYText[0]===true&&this.YTextPosition[0]!=2;var isDrawRight=borderRight>10&&this.IsShowYText[1]===true&&this.YTextPosition[1]!=2;}if(!isDrawRight&&!isDrawLeft)return null;var width={Left:null,Right:null};var rightExtendWidth=0;var isYPercentage=false;//是否是百分比坐标
|
|
2345
|
-
if(this.YSplitOperator&&this.YSplitOperator.CoordinateType==1)isYPercentage=true;for(var i=0;i<this.HorizontalInfo.length;++i){var textWidth=null;var item=this.HorizontalInfo[i];if(!item)continue;if(item.Font!=null)this.Canvas.font=item.Font;if(item.Message[0]!=null&&isDrawLeft){textWidth=this.Canvas.measureText(item.Message[0]).width;if(width.Left==null||width.Left<textWidth)width.Left=textWidth;//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[0]} ${textWidth}`);
|
|
2351
|
+
if(this.YSplitOperator&&this.YSplitOperator.CoordinateType==1)isYPercentage=true;var leftExtendLineWidth=0;var rightExtendLineWidth=0;if(IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend)){if(this.YLineExtend[0]&&this.YLineExtend[0].Width>1)leftExtendLineWidth=this.YLineExtend[0].Width;if(this.YLineExtend[1]&&this.YLineExtend[1].Width>1)rightExtendLineWidth=this.YLineExtend[1].Width;}for(var i=0;i<this.HorizontalInfo.length;++i){var textWidth=null;var item=this.HorizontalInfo[i];if(!item)continue;if(item.Font!=null)this.Canvas.font=item.Font;if(item.Message[0]!=null&&isDrawLeft){textWidth=this.Canvas.measureText(item.Message[0]).width;if(width.Left==null||width.Left<textWidth)width.Left=textWidth;//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[0]} ${textWidth}`);
|
|
2346
2352
|
}if(item.Message[1]!=null&&isDrawRight){if(item.Font!=null)this.Canvas.font=item.Font;if(Array.isArray(item.Message[1])){if(this.MultiTextFormat==1)//显示1行 格式:价格/百分比
|
|
2347
2353
|
{if(item.ExtendData){if(item.ExtendData.Font)this.Canvas.font=item.ExtendData.Font;var width1=this.Canvas.measureText(item.Message[1][0]).width;var width2=this.Canvas.measureText(item.Message[1][1]).width;var width3=this.Canvas.measureText('/').width;textWidth=width1+width3;if(rightExtendWidth<width2)rightExtendWidth=width2;//JSConsole.Chart.Log(`[ChartData::GetScaleTextWidth] ${item.Message[1][1]}/${item.Message[1][0]} ${textWidth}, ${rightExtendWidth}`);
|
|
2348
2354
|
}}else if(this.MultiTextFormat==2)//显示2行
|
|
2349
2355
|
{textWidth=this.Canvas.measureText(item.Message[1][0]).width;var textWidth2=this.Canvas.measureText(item.Message[1][1]).width;if(textWidth<textWidth2)textWidth=textWidth2;}else//显示第1行
|
|
2350
|
-
{textWidth=this.Canvas.measureText(item.Message[1][0]).width;if(isYPercentage){var perTextWidth=this.Canvas.measureText("-00.00%").width;if(perTextWidth>textWidth)textWidth=perTextWidth;}}}else{textWidth=this.Canvas.measureText(item.Message[1]).width;}if(width.Right==null||width.Right<textWidth)width.Right=textWidth;}}if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=rightExtendWidth;if(IFrameSplitOperator.IsNumber(width.Left))width.Left+=this.YTextPadding[0];if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=this.YTextPadding[1];return{TextWidth:width};};this.ClearToolbar=function(){if(!this.ToolbarID)return;var divToolbar=document.getElementById(this.ToolbarID);if(!divToolbar)return;this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);this.ToolbarRect=null;};this.HideToolbar=function(){if(!this.ToolbarID)return;this.ToolbarRect=null;var divToolbar=document.getElementById(this.ToolbarID);if(!divToolbar)return;if(divToolbar.style.display!='none')divToolbar.style.display='none';};}function MinuteFrame(){this.newMethod=AverageWidthFrame;//派生
|
|
2356
|
+
{textWidth=this.Canvas.measureText(item.Message[1][0]).width;if(isYPercentage){var perTextWidth=this.Canvas.measureText("-00.00%").width;if(perTextWidth>textWidth)textWidth=perTextWidth;}}}else{textWidth=this.Canvas.measureText(item.Message[1]).width;}if(width.Right==null||width.Right<textWidth)width.Right=textWidth;}}if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=rightExtendWidth;if(IFrameSplitOperator.IsNumber(width.Left))width.Left+=this.YTextPadding[0]+leftExtendLineWidth;if(IFrameSplitOperator.IsNumber(width.Right))width.Right+=this.YTextPadding[1]+rightExtendLineWidth;return{TextWidth:width};};this.ClearToolbar=function(){if(!this.ToolbarID)return;var divToolbar=document.getElementById(this.ToolbarID);if(!divToolbar)return;this.ChartBorder.UIElement.parentNode.removeChild(divToolbar);this.ToolbarRect=null;};this.HideToolbar=function(){if(!this.ToolbarID)return;this.ToolbarRect=null;var divToolbar=document.getElementById(this.ToolbarID);if(!divToolbar)return;if(divToolbar.style.display!='none')divToolbar.style.display='none';};}function MinuteFrame(){this.newMethod=AverageWidthFrame;//派生
|
|
2351
2357
|
this.newMethod();delete this.newMethod;this.ClassName="MinuteFrame";this.DataWidth=1*GetDevicePixelRatio();this.DistanceWidth=1*GetDevicePixelRatio();this.MinuteCount=243;//每天的分钟个数
|
|
2352
2358
|
this.BeforeBGColor=g_JSChartResource.Minute.Before.BGColor;//集合竞价背景
|
|
2353
2359
|
this.AfterBGColor=g_JSChartResource.Minute.After.BGColor;this.MultiDayBorderPen=g_JSChartResource.MultiDayBorderPen;this.CustomHorizontalInfo=[];this.RightFrame=null;//右侧多重坐标
|
|
@@ -11410,7 +11416,7 @@ else if(value.indexOf('LINEOVERLAY')==0)isOverlayLine=true;else if(value.indexOf
|
|
|
11410
11416
|
{var outVar={Name:_drawName,Draw:outValue,Type:1};this.OutVarTable.push(outVar);}else if(colorStick&&_varName7)//CYW: SUM(VAR4,10)/10000, COLORSTICK; 画上下柱子
|
|
11411
11417
|
{outValue+=",画彩色柱状线";var _value21={Name:_varName7,Draw:outValue,Color:color,Type:2};this.OutVarTable.push(_value21);}else if(_varName7){var _value22={Name:_varName7,Data:outValue,Type:0};this.OutVarTable.push(_value22);}}}}JSConsole.Complier.Log('[JSExplainer::Run]',this.VarTable);return this.OutVarTable;};this.VisitNode=function(node){switch(node.Type){case Syntax.SequenceExpression:this.VisitSequenceExpression(node);break;case Syntax.ExpressionStatement:this.VisitNode(node.Expression);break;case Syntax.AssignmentExpression:this.VisitAssignmentExpression(node);break;case Syntax.BinaryExpression:case Syntax.LogicalExpression:this.VisitBinaryExpression(node);break;case Syntax.CallExpression:this.VisitCallExpression(node);break;}};this.VisitSequenceExpression=function(node){for(var _i148 in node.Expression){var _item28=node.Expression[_i148];this.VisitNode(_item28);}};//函数调用
|
|
11412
11418
|
this.VisitCallExpression=function(node){var funcName=node.Callee.Name;var args=[];for(var _i149 in node.Arguments){var _item29=node.Arguments[_i149];var value=void 0;if(_item29.Type==Syntax.BinaryExpression||_item29.Type==Syntax.LogicalExpression)value=this.VisitBinaryExpression(_item29);else if(_item29.Type==Syntax.CallExpression)value=this.VisitCallExpression(_item29);else value=this.GetNodeValue(_item29);args.push(value);}JSConsole.Complier.Log('[JSExplainer::VisitCallExpression]',funcName,'(',args.toString(),')');if(g_JSComplierResource.IsCustomFunction(funcName)){var data=this.Algorithm.CallCustomFunction(funcName,args,this.SymbolData,node);node.Out=[];node.Draw=null;if(data){if(data.Out)node.Out=data.Out;if(data.Draw)node.Draw=data.Draw;}return node.Out;}node.Out=this.CallFunctionExplain(funcName,args,node);return node.Out;};this.FUNCTION_INFO_LIST=new _map2.default([["REF",{Name:"REF",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u524D\u7684'+args[0];}}],["REFX",{Name:"REFX",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u540E\u7684'+args[0];}}],["REFV",{Name:"REFV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u524D\u7684(\u672A\u4F5C\u5E73\u6ED1\u5904\u7406)'+args[0];}}],["REFXV",{Name:"REFXV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u540E\u7684(\u672A\u4F5C\u5E73\u6ED1\u5904\u7406)'+args[0];}}],["REFDATE",{Name:"REFDATE",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5'+args[0];}}],["COUNT",{Name:"COUNT",Param:{Count:2},ToString:function ToString(args){return'\u7EDF\u8BA1'+args[1]+'\u65E5\u4E2D\u6EE1\u8DB3'+args[0]+'\u7684\u5929\u6570';}}],["BARSLASTCOUNT",{Name:"BARSLASTCOUNT",Param:{Count:1},ToString:function ToString(args){return'\u6761\u4EF6'+args[0]+'\u8FDE\u7EED\u6210\u7ACB\u6B21\u6570';}}],["BARSCOUNT",{Name:"BARSCOUNT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u6709\u6548\u6570\u636E\u5468\u671F\u6570';}}],["BARSLAST",{Name:"BARSLAST",Param:{Count:1},ToString:function ToString(args){return'\u4E0A\u6B21'+args[0]+'\u4E0D\u4E3A0\u8DDD\u4ECA\u5929\u6570';}}],["BARSNEXT",{Name:"BARSNEXT",Param:{Count:1},ToString:function ToString(args){return'\u4E0B\u6B21'+args[0]+'\u4E0D\u4E3A0\u8DDD\u4ECA\u5929\u6570';}}],["BARSSINCEN",{Name:"BARSSINCEN",Param:{Count:2},ToString:function ToString(args){return'\u5728'+args[1]+'\u5468\u671F\u5185\u9996\u6B21'+args[0]+'\u8DDD\u4ECA\u5929\u6570';}}],["BARSSINCE",{Name:"BARSSINCE",Param:{Count:1},ToString:function ToString(args){return'\u9996\u6B21'+args[0]+'\u8DDD\u4ECA\u5929\u6570';}}],["HHV",{Name:"HHV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u6700\u9AD8\u503C';}}],["LLV",{Name:"LLV",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u6700\u4F4E\u503C';}}],["ZTPRICE",{Name:"ZTPRICE",Param:{Count:2},ToString:function ToString(args){return'计算涨停价';}}],["DTPRICE",{Name:"DTPRICE",Param:{Count:2},ToString:function ToString(args){return'计算跌停价';}}],["BACKSET",{Name:"BACKSET",Param:{Count:2},ToString:function ToString(args){return'\u82E5'+args[0]+'\u5219\u5C06\u6700\u8FD1'+args[1]+'\u5468\u671F\u7F6E\u4E3A1';}}],["HOD",{Name:"HOD",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u9AD8\u503C\u540D\u6B21';}}],["LOD",{Name:"LOD",Param:{Count:2},ToString:function ToString(args){return args[1]+'\u65E5\u5185'+args[0]+'\u7684\u4F4E\u503C\u540D\u6B21';}}],["REVERSE",{Name:"REVERSE",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u76F8\u53CD\u6570';}}],["FILTER",{Name:"FILTER",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u8FC7\u6EE4';}}],["FILTERX",{Name:"FILTERX",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u53CD\u5411\u8FC7\u6EE4';}}],["TFILTER",{Name:"TFILTER",Param:{Count:3},ToString:function ToString(args){return'\u4FE1\u53F7\u8FC7\u6EE4(\u591A\u5934)';}}],["SUMBARS",{Name:"SUMBARS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7D2F\u52A0\u81F3'+args[1]+'\u7684\u5929\u6570';}}],["MA",{Name:"MA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7B80\u5355\u79FB\u52A8\u5E73\u5747';}}],["SMA",{Name:"SMA",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5['+args[2]+'\u65E5\u6743\u91CD]\u79FB\u52A8\u5E73\u5747';}}],["MEMA",{Name:"MEMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u5E73\u6ED1\u79FB\u52A8\u5E73\u5747';}}],["EMA",{Name:"EMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u79FB\u52A8\u5E73\u5747';}}],["EXPMA",{Name:"EXPMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u79FB\u52A8\u5E73\u5747';}}],["EXPMEMA",{Name:"EXPMEMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6307\u6570\u5E73\u6ED1\u79FB\u52A8\u5E73\u5747';}}],["WMA",{Name:"WMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u52A0\u6743\u79FB\u52A8\u5E73\u5747';}}],["DMA",{Name:"DMA",Param:{Count:2},ToString:function ToString(args){return'\u4EE5'+args[1]+'\u4E3A\u6743\u91CD'+args[0]+'\u7684\u52A8\u6001\u79FB\u52A8\u5E73\u5747';}}],["XMA",{Name:"XMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u504F\u79FB\u79FB\u52A8\u5E73\u5747';}}],["RANGE",{Name:"RANGE",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u4F4D\u4E8E'+args[1]+'\u548C'+args[2]+'\u4E4B\u95F4';}}],["CONST",{Name:"CONST",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6700\u540E\u4E00\u65E5\u503C';}}],["TOPRANGE",{Name:"TOPRANGE",Param:{Count:1},ToString:function ToString(args){return'\u5F53\u524D\u503C\u662F\u8FD1'+args[0]+'\u5468\u671F\u7684\u6700\u5927\u503C';}}],["LOWRANGE",{Name:"LOWRANGE",Param:{Count:1},ToString:function ToString(args){return'\u5F53\u524D\u503C\u662F\u8FD1'+args[0]+'\u5468\u671F\u7684\u6700\u5C0F\u503C';}}],["FINDHIGH",{Name:"FINDHIGH",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u9AD8\u4EF7';}}],["FINDHIGHBARS",{Name:"FINDHIGHBARS",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u9AD8\u4EF7\u5230\u5F53\u524D\u5468\u671F\u7684\u5468\u671F\u6570';}}],["FINDLOW",{Name:"FINDLOW",Param:{Count:4},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u4F4E\u4EF7';}}],["FINDLOWBARS",{Name:"FINDLOWBARS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u65E5\u524D\u7684'+args[2]+'\u5929\u5185\u7B2C'+args[3]+'\u4E2A\u6700\u4F4E\u4EF7\u5230\u5F53\u524D\u5468\u671F\u7684\u5468\u671F\u6570';}}],["SUM",{Name:"SUM",Param:{Count:2},ToString:function ToString(args){return''+args[0]+args[1]+'\u65E5\u7D2F\u52A0';}}],["MULAR",{Name:"MULAR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u65E5\u7D2F\u4E58';}}],["AMA",{Name:"AMA",Param:{Count:2},ToString:function ToString(args){return'\u4EE5'+args[1]+'\u4E3A\u6743\u91CD'+args[0]+'\u7684\u81EA\u9002\u5E94\u5747\u7EBF';}}],["TMA",{Name:"TMA",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5['+args[2]+'\u65E5\u6743\u91CD]\u79FB\u52A8\u5E73\u5747';}}],["CROSS",{Name:"CROSS",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u4E0A\u7A7F'+args[1];}}],["LONGCROSS",{Name:"LONGCROSS",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u5C0F\u4E8E'+args[1]+'\u4FDD\u6301'+args[2]+'\u4E2A\u4EA4\u6613\u65E5\u540E\u4EA4\u53C9\u4E0A\u7A7F';}}],["UPNDAY",{Name:"UPNDAY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5'+args[0]+'\u8FDE\u6DA8';}}],["DOWNNDAY",{Name:"DOWNNDAY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5'+args[0]+'\u8FDE\u8DCC';}}],["NDAY",{Name:"NDAY",Param:{Count:3},ToString:function ToString(args){return'\u6700\u8FD1'+args[2]+'\u65E5'+args[0]+'\u4E00\u76F4\u5927\u4E8E'+args[1];}}],["EXIST",{Name:"EXIST",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5\u5B58\u5728'+args[0];}}],["EXISTR",{Name:"EXISTR",Param:{Count:3},ToString:function ToString(args){return'\u4ECE\u524D'+args[1]+'\u65E5\u5230\u524D'+args[2]+'\u65E5\u5B58\u5728'+args[0];}}],["EVERY",{Name:"EVERY",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[1]+'\u65E5\u4E00\u76F4\u5B58\u5728'+args[0];}}],["LAST",{Name:"LAST",Param:{Count:3},ToString:function ToString(args){return'\u4ECE\u524D'+args[1]+'\u65E5\u5230\u524D'+args[2]+'\u65E5\u6301\u7EED'+args[0];}}],["NOT",{Name:"NOT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u53D6\u53CD';}}],["IF",{Name:"IF",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFF",{Name:"IFF",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFN",{Name:"IFN",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["IFC",{Name:"IFC",Param:{Count:3},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE'+args[2];}}],["TESTSKIP",{Name:"TESTSKIP",Param:{Count:1},ToString:function ToString(args){return'\u5982\u679C\u6EE1\u8DB3\u6761\u4EF6'+args[0]+',\u516C\u5F0F\u8FD4\u56DE';}}],["VALUEWHEN",{Name:"VALUEWHEN",Param:{Count:2},ToString:function ToString(args){return'\u5982\u679C'+args[0]+',\u8FD4\u56DE'+args[1]+',\u5426\u5219\u8FD4\u56DE\u4E0A\u4E2A\u8F93\u51FA\u503C ';}}],["MAX",{Name:"MAX",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684\u8F83\u5927\u503C';}}],["MIN",{Name:"MIN",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684\u8F83\u5C0F\u503C';}}],["ACOS",{Name:"ACOS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u4F59\u5F26';}}],["ASIN",{Name:"ASIN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u6B63\u5F26';}}],["ATAN",{Name:"ATAN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u53CD\u6B63\u5207';}}],["COS",{Name:"COS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u4F59\u5F26';}}],["SIN",{Name:"SIN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6B63\u5F26';}}],["TAN",{Name:"TAN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6B63\u5207';}}],["EXP",{Name:"EXP",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6307\u6570';}}],["LN",{Name:"LN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u81EA\u7136\u5BF9\u6570';}}],["LOG",{Name:"LOG",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5BF9\u6570';}}],["SQRT",{Name:"SQRT",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5F00\u65B9';}}],["ABS",{Name:"ABS",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u7EDD\u5BF9\u503C';}}],["POW",{Name:"POW",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u4E58\u5E42';}}],["CEILING",{Name:"CEILING",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5411\u4E0A\u820D\u5165';}}],["FLOOR",{Name:"FLOOR",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5411\u4E0A\u820D\u5165';}}],["INTPART",{Name:"INTPART",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u6574\u6570\u90E8\u5206';}}],["BETWEEN",{Name:"BETWEEN",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u4F4D\u4E8E'+args[1]+'\u548C'+args[2]+'\u4E4B\u95F4';}}],["FRACPART",{Name:"FRACPART",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u5C0F\u6570\u90E8\u5206';}}],["ROUND",{Name:"ROUND",Param:{Count:1},ToString:function ToString(args){return'\u5BF9'+args[0]+'(\u8FDB\u884C)\u56DB\u820D\u4E94\u5165';}}],["ROUND2",{Name:"ROUND2",Param:{Count:2},ToString:function ToString(args){return'\u5BF9'+args[0]+'(\u8FDB\u884C)\u56DB\u820D\u4E94\u5165';}}],["SIGN",{Name:"SIGN",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u7684\u7B26\u53F7';}}],["MOD",{Name:"MOD",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5173\u4E8E'+args[1]+'\u7684\u6A21';}}],["RAND",{Name:"RAND",Param:{Count:1},ToString:function ToString(args){return'\u968F\u673A\u6B63\u6574\u6570';}}],["AVEDEV",{Name:"AVEDEV",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u5E73\u5747\u7EDD\u5BF9\u504F\u5DEE';}}],["DEVSQ",{Name:"DEVSQ",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6570\u636E\u504F\u5DEE\u5E73\u65B9\u548C';}}],["FORCAST",{Name:"FORCAST",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7EBF\u6027\u56DE\u5F52\u9884\u6D4B\u503C';}}],["TSMA",{Name:"TSMA",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u5728'+args[1]+'\u4E2A\u5468\u671F\u5185\u7684\u65F6\u95F4\u5E8F\u5217\u4E09\u89D2\u79FB\u52A8\u5E73\u5747';}}],["SLOPE",{Name:"SLOPE",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u7EBF\u6027\u56DE\u5F52\u659C\u7387';}}],["STD",{Name:"STD",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u4F30\u7B97\u6807\u51C6\u5DEE';}}],["STDP",{Name:"STDP",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u603B\u4F53\u6807\u51C6\u5DEE';}}],["STDDEV",{Name:"STDDEV",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u6807\u51C6\u504F\u5DEE';}}],["VAR",{Name:"VAR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u4F30\u7B97\u6837\u672C\u65B9\u5DEE';}}],["VARP",{Name:"VARP",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u7684'+args[1]+'\u65E5\u603B\u4F53\u6837\u672C\u65B9\u5DEE';}}],["COVAR",{Name:"COVAR",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[2]+'\u5468\u671F\u7684\u534F\u65B9\u5DEE';}}],["RELATE",{Name:"RELATE",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[0]+'\u5468\u671F\u7684\u76F8\u5173\u7CFB\u6570';}}],["BETA",{Name:"BETA",Param:{Count:1},ToString:function ToString(args){return'\u03B2(Beta)\u7CFB\u6570';}}],["BETAEX",{Name:"BETAEX",Param:{Count:3},ToString:function ToString(args){return args[0]+'\u548C'+args[1]+'\u7684'+args[2]+'\u5468\u671F\u7684\u76F8\u5173\u653E\u5927\u7CFB\u6570';}}],["COST",{Name:"COST",Param:{Count:1},ToString:function ToString(args){return'\u83B7\u5229\u76D8\u4E3A'+args[0]+'%\u7684\u6210\u672C\u5206\u5E03';}}],["WINNER",{Name:"WINNER",Param:{Count:1},ToString:function ToString(args){return'\u4EE5'+args[0]+'\u8BA1\u7B97\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["LWINNER",{Name:"LWINNER",Param:{Count:2},ToString:function ToString(args){return'\u6700\u8FD1'+args[0]+'\u65E5\u90A3\u90E8\u5206\u6210\u672C\u4EE5'+args[1]+'\u4EF7\u683C\u5356\u51FA\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["PWINNER",{Name:"PWINNER",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u65E5\u524D\u90A3\u90E8\u5206\u6210\u672C\u4EE5'+args[1]+'\u4EF7\u683C\u5356\u51FA\u7684\u83B7\u5229\u76D8\u6BD4\u4F8B';}}],["COSTEX",{Name:"COSTEX",Param:{Count:2},ToString:function ToString(args){return'\u4F4D\u4E8E\u4EF7\u683C'+args[0]+'\u548C'+args[1]+'\u95F4\u7684\u6210\u672C';}}],["PPART",{Name:"PPART",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u65E5\u524D\u90A3\u90E8\u5206\u6210\u672C\u5360\u603B\u6210\u672C\u7684\u6BD4\u4F8B';}}],["SAR",{Name:"SAR",Param:{Count:3},ToString:function ToString(args){return'\u6B65\u957F\u4E3A'+args[1]+'\u6781\u9650\u503C\u4E3A'+args[0]+'\u7684'+args[2]+'\u65E5\u629B\u7269\u8F6C\u5411';}}],["SARTURN",{Name:"SARTURN",Param:{Count:3},ToString:function ToString(args){return'\u6B65\u957F\u4E3A'+args[1]+'\u6781\u9650\u503C\u4E3A'+args[0]+'\u7684'+args[2]+'\u65E5\u629B\u7269\u8F6C\u5411\u70B9';}}],//字符串函数
|
|
11413
|
-
["CON2STR",{Name:"CON2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["VAR2STR",{Name:"VAR2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["STR2CON",{Name:"STR2CON",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u6570\u5B57';}}],["STRLEN",{Name:"STRLEN",Param:{Count:1},ToString:function ToString(args){return'\u5F97\u5230'+args[0]+'\u5B57\u7B26\u4E32\u957F\u5EA6';}}],["STRCAT",{Name:"STRCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["VARCAT",{Name:"VARCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["STRSPACE",{Name:"STRSPACE",Param:{Count:1},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u52A0\u4E00\u7A7A\u683C';}}],["SUBSTR",{Name:"SUBSTR",Param:{Count:3},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u53D6\u4E00\u90E8\u5206';}}],["STRCMP",{Name:"STRCMP",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u548C\u5B57\u7B26\u4E32'+args[1]+'\u6BD4\u8F83';}}],["FINDSTR",{Name:"FINDSTR",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u67E5\u627E\u5B57\u7B26\u4E32'+args[1];}}],["
|
|
11419
|
+
["CON2STR",{Name:"CON2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["VAR2STR",{Name:"VAR2STR",Param:{Count:2},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u5B57\u7B26\u4E32';}}],["STR2CON",{Name:"STR2CON",Param:{Count:1},ToString:function ToString(args){return args[0]+'\u8F6C\u4E3A\u6570\u5B57';}}],["STRLEN",{Name:"STRLEN",Param:{Count:1},ToString:function ToString(args){return'\u5F97\u5230'+args[0]+'\u5B57\u7B26\u4E32\u957F\u5EA6';}}],["STRCAT",{Name:"STRCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["VARCAT",{Name:"VARCAT",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32\u76F8\u52A0';}}],["STRSPACE",{Name:"STRSPACE",Param:{Count:1},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u52A0\u4E00\u7A7A\u683C';}}],["SUBSTR",{Name:"SUBSTR",Param:{Count:3},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u53D6\u4E00\u90E8\u5206';}}],["STRCMP",{Name:"STRCMP",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u548C\u5B57\u7B26\u4E32'+args[1]+'\u6BD4\u8F83';}}],["FINDSTR",{Name:"FINDSTR",Param:{Count:2},ToString:function ToString(args){return'\u5B57\u7B26\u4E32'+args[0]+'\u4E2D\u67E5\u627E\u5B57\u7B26\u4E32'+args[1];}}],["NAMEINCLUDE",{Name:"NAMEINCLUDE",Param:{Count:1},ToString:function ToString(args){return'\u67E5\u627E\u54C1\u79CD\u540D\u79F0\u4E2D\u5305\u542B'+args[0];}}],["CODELIKE",{Name:"CODELIKE",Param:{Count:1},ToString:function ToString(args){return'\u67E5\u627E\u54C1\u79CD\u540D\u79F0\u4E2D\u5305\u542B'+args[0];}}],["INBLOCK",{Name:"AVEDEV",Param:{Count:1},ToString:function ToString(args){return'\u5C5E\u4E8E'+args[0]+'\u677F\u5757';}}],["STKINDI",{Name:"STKINDI",Param:{Dynamic:true},ToString:function ToString(args){return"指标引用";}}],["STRFORMAT",{Name:"STRFORMAT",Param:{Dynamic:true},ToString:function ToString(args){return'\u683C\u5F0F\u5316'+args[0]+'\u5B57\u7B26\u4E32';}}],["NAMELIKE",{Name:"NAMELIKE",Param:{Count:1},ToString:function ToString(args){return'\u54C1\u79CD\u540D\u79F0\u662F\u5426\u4EE5\''+args[0]+'\'\u5F00\u5934';}}],["HHVBARS",{Name:"HHVBARS",Param:{Count:2},ToString:function ToString(args){if(args[1]==0)return'\u5386\u53F2'+args[0]+'\u65B0\u9AD8\u8DDD\u4ECA\u5929\u6570';return args[1]+'\u65E5\u5185'+args[0]+'\u65B0\u9AD8\u8DDD\u4ECA\u5929\u6570';}}],["LLVBARS",{Name:"LLVBARS",Param:{Count:2},ToString:function ToString(args){if(args[1]==0)return'\u5386\u53F2'+args[0]+'\u65B0\u4F4E\u8DDD\u4ECA\u5929\u6570';return args[1]+'\u65E5\u5185'+args[0]+'\u65B0\u4F4E\u8DDD\u4ECA\u5929\u6570';}}]]);this.CallFunctionExplain=function(funcName,args,node){if(this.FUNCTION_INFO_LIST.has(funcName)){var item=this.FUNCTION_INFO_LIST.get(funcName);if(item.Param.Dynamic===true)//动态参数
|
|
11414
11420
|
{}else{if(item.Param.Count!=args.length)this.ThrowUnexpectedNode(node,'\u51FD\u6570'+funcName+'\u53C2\u6570\u4E2A\u6570\u4E0D\u6B63\u786E. \u9700\u8981'+item.Param.Count+'\u4E2A\u53C2\u6570');}return item.ToString(args);}switch(funcName){case"CALCSTOCKINDEX":return'\u5F15\u7528'+args[0]+'\u7684'+args[1]+'\u6307\u6807\u7B2C'+args[2]+'\u4E2A\u8F93\u51FA\u503C';case"PEAK":case"PEAKBARS":case"ZIG":case"ZIGA":case"TROUGH":case"TROUGHBARS":return this.GetZIGExplain(funcName,args);case"FINANCE":return this.GetFinanceExplain(args);case"DYNAINFO":return this.GetDynainfoExplain(args);case'CLOSE':case'C':case'VOL':case'V':case'OPEN':case'O':case'HIGH':case'H':case'LOW':case'L':case'AMOUNT':case'AMO':return this.GetOtherSymbolExplain({FunctionName:funcName,Args:args},node);//绘图函数
|
|
11415
11421
|
case"PLOYLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6\u4EE5'+args[1]+'\u4F4D\u7F6E\u4E3A\u9876\u70B9\u753B\u6298\u7EBF\u8FDE\u63A5';case"DRAWLINE":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u8D77\u70B9\uFF0C\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[2]+'\u65F6,\u5728'+args[3]+'\u4F4D\u7F6E\u753B\u76F4\u7EBF\u7EC8\u70B9,'+args[4]+'\u8868\u793A\u662F\u5426\u5EF6\u957F';case"DRAWSL":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B\u659C\u7EBF\u7EBF\u6027\u56DE\u5F52,'+args[2]+'\u659C\u7387,'+args[3]+'\u957F\u5EA6,'+args[4]+'\u65B9\u5411';case"DRAWKLINE":case"DRAWKLINE1":return'K线';case"DRAWICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"DRAWTEXT":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWTEXT_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6587\u5B57';case"DRAWNUMBER":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"DRAWNUMBER_FIX":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728\u6A2A\u8F74'+args[1]+'\u7EB5\u8F74'+args[2]+'\u4F4D\u7F6E\u4E66\u5199\u6570\u5B57';case"RGB":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+']';case"RGBA":return'\u81EA\u5B9A\u8272['+args[0]+','+args[1]+','+args[2]+','+args[3]+']';case"DRAWBAND":return'画带状线';case"DRAWRECTREL":return"相对位置上画矩形.";case"DRAWGBK":return"填充背景";case"TIPICON":return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6,\u5728'+args[1]+'\u4F4D\u7F6E\u753B'+args[2]+'\u53F7\u56FE\u6807';case"STICKLINE":var barType="";if(args[4]==-1)barType="虚线空心柱";else if(args[4]==0)barType="实心柱";else barType="实线空心柱";return'\u5F53\u6EE1\u8DB3\u6761\u4EF6'+args[0]+'\u65F6, \u5728'+args[1]+'\u548C'+args[2]+'\u4F4D\u7F6E\u4E4B\u95F4\u753B\u67F1\u72B6\u7EBF,\u5BBD\u5EA6\u4E3A'+args[3]+','+barType;case"SELL":return"卖出平仓";case"BUY":return"买入开仓";case"SELLSHORT":return"卖出开仓";case"BUYSHORT":return"买入平仓";case"YMOVE":return;case"BACKGROUND":return"绘制背景";case"UPCOLOR":return'\u4E0A\u6DA8\u989C\u8272'+args[0];case"DOWNCOLOR":return'\u4E0B\u8DCC\u989C\u8272'+args[0];case"FIRSTDRAW":return"";default:this.ThrowUnexpectedNode(node,'\u51FD\u6570'+funcName+'\u4E0D\u5B58\u5728');}};this.GetDynainfoExplain=function(args){var DATA_NAME_MAP=new _map2.default([[3,"前收盘价"],[4,"开盘价"],[5,"最高价"],[6,"最低价"],[7,"现价"],[8,'总量'],[9,"现量"],[10,"总金额"],[11,"均价"],[12,"日涨跌"],[13,"振幅"],[14,"涨幅"],[15,"开盘时的成交金额"],[16,"前5日每分钟均量"],[17,"量比"],[18,"上涨家数"],[19,"下跌家数"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u5373\u65F6\u884C\u60C5['+id+']';};this.GetFinanceExplain=function(args){var DATA_NAME_MAP=new _map2.default([[1,"总股本"],[2,"市场类型"],[3,"沪深品种类型"],[4,"沪深行业代码"],[5,"B股"],[6,"H股"],[7,"流通股本[股]"],[8,"股东人数[户]"],[9,"资产负债率%"],[10,"总资产"],[11,"流动资产"],[12,"固定资产"],[13,"无形资产"],[15,"流动负债"],[16,"少数股东权益"]]);var id=args[0];if(DATA_NAME_MAP.has(id))return DATA_NAME_MAP.get(id);return'\u8D22\u52A1\u6570\u636E['+id+']';};this.GetZIGExplain=function(funcName,args){var value=args[0];if(value==0)value="开盘价";else if(value==1)value="最高价";else if(value==2)value="最低价";else if(value==3)value="收盘价";switch(funcName){case"PEAK":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u503C';case"PEAKBARS":return value+'\u7684'+args[1]+'5%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u5CF0\u4F4D\u7F6E';case"ZIG":return value+'\u7684'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"ZIGA":return value+'\u53D8\u5316'+args[1]+'\u7684\u4E4B\u5B57\u8F6C\u5411';case"TROUGH":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u503C';case"TROUGHBARS":return value+'\u7684'+args[1]+'%\u4E4B\u5B57\u8F6C\u5411\u7684\u524D'+args[2]+'\u4E2A\u6CE2\u8C37\u4F4D\u7F6E';}};this.GetColorExplain=function(colorName){var COLOR_MAP=new _map2.default([['COLORBLACK','黑色'],['COLORBLUE','蓝色'],['COLORGREEN','绿色'],['COLORCYAN','青色'],['COLORRED','红色'],['COLORMAGENTA','洋红色'],['COLORBROWN','棕色'],['COLORLIGRAY','淡灰色'],['COLORGRAY','深灰色'],['COLORLIBLUE','淡蓝色'],['COLORLIGREEN','淡绿色'],['COLORLICYAN','淡青色'],['COLORLIRED','淡红色'],['COLORLIMAGENTA','淡洋红色'],['COLORWHITE','白色'],['COLORYELLOW','黄色']]);if(COLOR_MAP.has(colorName))return COLOR_MAP.get(colorName);//COLOR 自定义色
|
|
11416
11422
|
//格式为COLOR+“RRGGBB”:RR、GG、BB表示红色、绿色和蓝色的分量,每种颜色的取值范围是00-FF,采用了16进制。
|
|
@@ -12895,7 +12901,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
12895
12901
|
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);};}/********************************************************************************
|
|
12896
12902
|
* 版本信息输出
|
|
12897
12903
|
*
|
|
12898
|
-
*/var HQCHART_VERSION="1.1.
|
|
12904
|
+
*/var HQCHART_VERSION="1.1.12728";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();//把给外界调用的方法暴露出来
|
|
12899
12905
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
12900
12906
|
// BaseIndex:BaseIndex,
|
|
12901
12907
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
|
@@ -4251,8 +4251,18 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4251
4251
|
|
|
4252
4252
|
this.OnSize=function(option) //{ Type:1 新版本OnSize Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
4253
4253
|
{
|
|
4254
|
-
//画布大小通过div获取
|
|
4255
|
-
|
|
4254
|
+
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
4255
|
+
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
4256
|
+
{
|
|
4257
|
+
var height=parseInt(this.DivElement.style.height.replace("px",""));
|
|
4258
|
+
var width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
4259
|
+
}
|
|
4260
|
+
else
|
|
4261
|
+
{
|
|
4262
|
+
var height=this.DivElement.offsetHeight;
|
|
4263
|
+
var width=this.DivElement.offsetWidth;
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4256
4266
|
if (this.ToolElement)
|
|
4257
4267
|
{
|
|
4258
4268
|
//TODO调整工具条大小
|
|
@@ -4260,7 +4270,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4260
4270
|
}
|
|
4261
4271
|
|
|
4262
4272
|
this.CanvasElement.height=height;
|
|
4263
|
-
this.CanvasElement.width=
|
|
4273
|
+
this.CanvasElement.width=width;
|
|
4264
4274
|
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
4265
4275
|
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
4266
4276
|
|
|
@@ -13389,6 +13399,7 @@ function IChartFramePainting()
|
|
|
13389
13399
|
|
|
13390
13400
|
//this.IsDrawLeftBorder;
|
|
13391
13401
|
this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
|
|
13402
|
+
this.IsDrawLeftBorder=false; //是否绘制右侧刻度空白的边框
|
|
13392
13403
|
|
|
13393
13404
|
this.PtInButtons=function(x,y) //坐标是否在按钮上
|
|
13394
13405
|
{
|
|
@@ -13489,16 +13500,42 @@ function IChartFramePainting()
|
|
|
13489
13500
|
//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
|
|
13490
13501
|
if (this.BorderLine==null)
|
|
13491
13502
|
{
|
|
13492
|
-
if (this.IsDrawRightBorder)
|
|
13503
|
+
if (this.IsDrawRightBorder || this.IsDrawLeftBorder)
|
|
13493
13504
|
{
|
|
13494
|
-
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13495
13505
|
this.Canvas.strokeStyle=this.PenBorder;
|
|
13496
|
-
this.Canvas.strokeRect(left,top,xRight-left,height);
|
|
13497
13506
|
|
|
13498
|
-
this.
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13507
|
+
if (this.IsDrawRightBorder && this.IsDrawLeftBorder)
|
|
13508
|
+
{
|
|
13509
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13510
|
+
var xLeft=ToFixedPoint(0);
|
|
13511
|
+
this.Canvas.strokeRect(xLeft,top,xRight-xLeft-1,height); //少一个像素让边框显示出来
|
|
13512
|
+
}
|
|
13513
|
+
else if (this.IsDrawRightBorder)
|
|
13514
|
+
{
|
|
13515
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13516
|
+
this.Canvas.strokeRect(left,top,xRight-left-1,height); //少一个像素让边框显示出来
|
|
13517
|
+
}
|
|
13518
|
+
else if (this.IsDrawLeftBorder)
|
|
13519
|
+
{
|
|
13520
|
+
var xLeft=ToFixedPoint(0);
|
|
13521
|
+
this.Canvas.strokeRect(xLeft,top,right-xLeft,height); //少一个像素让边框显示出来
|
|
13522
|
+
}
|
|
13523
|
+
|
|
13524
|
+
if (this.IsDrawRightBorder)
|
|
13525
|
+
{
|
|
13526
|
+
this.Canvas.beginPath();
|
|
13527
|
+
this.Canvas.moveTo(right,top);
|
|
13528
|
+
this.Canvas.lineTo(right,bottom);
|
|
13529
|
+
this.Canvas.stroke();
|
|
13530
|
+
}
|
|
13531
|
+
|
|
13532
|
+
if (this.IsDrawLeftBorder)
|
|
13533
|
+
{
|
|
13534
|
+
this.Canvas.beginPath();
|
|
13535
|
+
this.Canvas.moveTo(left,top);
|
|
13536
|
+
this.Canvas.lineTo(left,bottom);
|
|
13537
|
+
this.Canvas.stroke();
|
|
13538
|
+
}
|
|
13502
13539
|
}
|
|
13503
13540
|
else
|
|
13504
13541
|
{
|
|
@@ -14040,14 +14077,18 @@ function AverageWidthFrame()
|
|
|
14040
14077
|
var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
14041
14078
|
|
|
14042
14079
|
var rightExtendLine=null; //右侧延长线
|
|
14080
|
+
var leftExtendLine=null; //左侧延长线
|
|
14043
14081
|
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
14044
14082
|
{
|
|
14045
14083
|
rightExtendLine=this.YLineExtend[1];
|
|
14084
|
+
leftExtendLine=this.YLineExtend[0];
|
|
14046
14085
|
}
|
|
14047
14086
|
|
|
14048
14087
|
var rightExtendText=null; //右侧文字设置
|
|
14088
|
+
var leftExtendText=null; //左侧文字设置
|
|
14049
14089
|
if (IFrameSplitOperator.IsNonEmptyArray(this.YTextExtend))
|
|
14050
14090
|
{
|
|
14091
|
+
leftExtendText=this.YTextExtend[0];
|
|
14051
14092
|
rightExtendText=this.YTextExtend[1];
|
|
14052
14093
|
}
|
|
14053
14094
|
|
|
@@ -14149,12 +14190,34 @@ function AverageWidthFrame()
|
|
|
14149
14190
|
{
|
|
14150
14191
|
if (item.Font!=null) this.Canvas.font=item.Font;
|
|
14151
14192
|
|
|
14193
|
+
var xText=left;
|
|
14194
|
+
if (leftExtendLine && leftExtendLine.Width>1)
|
|
14195
|
+
{
|
|
14196
|
+
var lineLength=leftExtendLine.Width;
|
|
14197
|
+
if (leftExtendLine.Color) this.Canvas.strokeStyle=leftExtendLine.Color;
|
|
14198
|
+
else this.Canvas.strokeStyle=item.LineColor;
|
|
14199
|
+
this.Canvas.beginPath();
|
|
14200
|
+
this.Canvas.moveTo(xText,yFixed);
|
|
14201
|
+
this.Canvas.lineTo(xText-lineLength,yFixed);
|
|
14202
|
+
this.Canvas.stroke();
|
|
14203
|
+
|
|
14204
|
+
xText-=lineLength;
|
|
14205
|
+
}
|
|
14206
|
+
|
|
14152
14207
|
rtLeft=this.GetTextTopBottom(textBaseline,yText);
|
|
14153
14208
|
if (!rtPreLeft || (rtLeft && !this.IsTextTopBottomOverlap(rtLeft, rtPreLeft)))
|
|
14154
14209
|
{
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14210
|
+
if (leftExtendText && leftExtendText.Align===1)
|
|
14211
|
+
{
|
|
14212
|
+
this.Canvas.textAlign="left";
|
|
14213
|
+
this.Canvas.fillText(item.Message[0],this.YTextPadding[0],yText);
|
|
14214
|
+
}
|
|
14215
|
+
else
|
|
14216
|
+
{
|
|
14217
|
+
this.Canvas.textAlign="right";
|
|
14218
|
+
this.Canvas.fillText(item.Message[0],xText-this.YTextPadding[0],yText);
|
|
14219
|
+
rtPreLeft=rtLeft;
|
|
14220
|
+
}
|
|
14158
14221
|
}
|
|
14159
14222
|
}
|
|
14160
14223
|
|
|
@@ -14232,7 +14295,7 @@ function AverageWidthFrame()
|
|
|
14232
14295
|
if (!rtPreRight || (rtRight && !this.IsTextTopBottomOverlap(rtRight,rtPreRight)))
|
|
14233
14296
|
{
|
|
14234
14297
|
if (item.TextColor2) this.Canvas.fillStyle=item.TextColor2;
|
|
14235
|
-
if (rightExtendText && rightExtendText.Align && this.YRightTextInfo)
|
|
14298
|
+
if (rightExtendText && rightExtendText.Align===2 && this.YRightTextInfo)
|
|
14236
14299
|
{
|
|
14237
14300
|
this.Canvas.textAlign="right";
|
|
14238
14301
|
var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];
|
|
@@ -15458,6 +15521,16 @@ function AverageWidthFrame()
|
|
|
15458
15521
|
var rightExtendWidth=0;
|
|
15459
15522
|
var isYPercentage=false; //是否是百分比坐标
|
|
15460
15523
|
if (this.YSplitOperator && this.YSplitOperator.CoordinateType==1) isYPercentage=true;
|
|
15524
|
+
|
|
15525
|
+
var leftExtendLineWidth=0;
|
|
15526
|
+
var rightExtendLineWidth=0;
|
|
15527
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
15528
|
+
{
|
|
15529
|
+
if (this.YLineExtend[0] && this.YLineExtend[0].Width>1)
|
|
15530
|
+
leftExtendLineWidth=this.YLineExtend[0].Width;
|
|
15531
|
+
if (this.YLineExtend[1] && this.YLineExtend[1].Width>1)
|
|
15532
|
+
rightExtendLineWidth=this.YLineExtend[1].Width;
|
|
15533
|
+
}
|
|
15461
15534
|
|
|
15462
15535
|
for(var i=0;i<this.HorizontalInfo.length;++i)
|
|
15463
15536
|
{
|
|
@@ -15524,8 +15597,8 @@ function AverageWidthFrame()
|
|
|
15524
15597
|
|
|
15525
15598
|
|
|
15526
15599
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
|
|
15527
|
-
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0];
|
|
15528
|
-
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1];
|
|
15600
|
+
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
|
|
15601
|
+
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
|
|
15529
15602
|
|
|
15530
15603
|
return { TextWidth:width };
|
|
15531
15604
|
}
|
|
@@ -113332,12 +113405,12 @@ function JSExplainer(ast,option)
|
|
|
113332
113405
|
["SUBSTR", { Name:"SUBSTR", Param:{ Count:3 }, ToString:function(args) { return `字符串${args[0]}中取一部分`; } } ],
|
|
113333
113406
|
["STRCMP", { Name:"STRCMP", Param:{ Count:2 }, ToString:function(args) { return `字符串${args[0]}和字符串${args[1]}比较`; } } ],
|
|
113334
113407
|
["FINDSTR", { Name:"FINDSTR", Param:{ Count:2 }, ToString:function(args) { return `字符串${args[0]}中查找字符串${args[1]}`; } } ],
|
|
113335
|
-
["
|
|
113408
|
+
["NAMEINCLUDE", { Name:"NAMEINCLUDE", Param:{ Count:1 }, ToString:function(args) { return `查找品种名称中包含${args[0]}`; } } ],
|
|
113336
113409
|
["CODELIKE", { Name:"CODELIKE", Param:{ Count:1 }, ToString:function(args) { return `查找品种名称中包含${args[0]}`; } } ],
|
|
113337
113410
|
["INBLOCK", { Name:"AVEDEV", Param:{ Count:1 }, ToString:function(args) { return `属于${args[0]}板块`; } } ],
|
|
113338
113411
|
["STKINDI",{ Name:"STKINDI", Param:{ Dynamic:true }, ToString:function(args) { return "指标引用"; } }],
|
|
113339
113412
|
["STRFORMAT",{ Name:"STRFORMAT", Param:{ Dynamic:true }, ToString:function(args) { return `格式化${args[0]}字符串`; } }],
|
|
113340
|
-
|
|
113413
|
+
["NAMELIKE",{ Name:"NAMELIKE", Param:{ Count:1 }, ToString:function(args) { return `品种名称是否以'${args[0]}'开头`; } }],
|
|
113341
113414
|
|
|
113342
113415
|
[
|
|
113343
113416
|
"HHVBARS",
|
|
@@ -113480,6 +113553,7 @@ function JSExplainer(ast,option)
|
|
|
113480
113553
|
case "FIRSTDRAW":
|
|
113481
113554
|
return "";
|
|
113482
113555
|
|
|
113556
|
+
|
|
113483
113557
|
default:
|
|
113484
113558
|
this.ThrowUnexpectedNode(node,`函数${funcName}不存在`);
|
|
113485
113559
|
}
|
|
@@ -130959,7 +131033,7 @@ function ScrollBarBGChart()
|
|
|
130959
131033
|
|
|
130960
131034
|
|
|
130961
131035
|
|
|
130962
|
-
var HQCHART_VERSION="1.1.
|
|
131036
|
+
var HQCHART_VERSION="1.1.12728";
|
|
130963
131037
|
|
|
130964
131038
|
function PrintHQChartVersion()
|
|
130965
131039
|
{
|
|
@@ -4295,8 +4295,18 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4295
4295
|
|
|
4296
4296
|
this.OnSize=function(option) //{ Type:1 新版本OnSize Redraw:是否重绘, XYSplit:是否重新计算分割线 }
|
|
4297
4297
|
{
|
|
4298
|
-
//画布大小通过div获取
|
|
4299
|
-
|
|
4298
|
+
//画布大小通过div获取 如果有style里的大小 使用style里的
|
|
4299
|
+
if (this.DivElement.style.height && this.DivElement.style.width)
|
|
4300
|
+
{
|
|
4301
|
+
var height=parseInt(this.DivElement.style.height.replace("px",""));
|
|
4302
|
+
var width=parseInt(this.DivElement.style.width.replace("px",""));
|
|
4303
|
+
}
|
|
4304
|
+
else
|
|
4305
|
+
{
|
|
4306
|
+
var height=this.DivElement.offsetHeight;
|
|
4307
|
+
var width=this.DivElement.offsetWidth;
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4300
4310
|
if (this.ToolElement)
|
|
4301
4311
|
{
|
|
4302
4312
|
//TODO调整工具条大小
|
|
@@ -4304,7 +4314,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
4304
4314
|
}
|
|
4305
4315
|
|
|
4306
4316
|
this.CanvasElement.height=height;
|
|
4307
|
-
this.CanvasElement.width=
|
|
4317
|
+
this.CanvasElement.width=width;
|
|
4308
4318
|
this.CanvasElement.style.width=this.CanvasElement.width+'px';
|
|
4309
4319
|
this.CanvasElement.style.height=this.CanvasElement.height+'px';
|
|
4310
4320
|
|
|
@@ -13433,6 +13443,7 @@ function IChartFramePainting()
|
|
|
13433
13443
|
|
|
13434
13444
|
//this.IsDrawLeftBorder;
|
|
13435
13445
|
this.IsDrawRightBorder=false; //是否绘制右侧刻度空白的边框
|
|
13446
|
+
this.IsDrawLeftBorder=false; //是否绘制右侧刻度空白的边框
|
|
13436
13447
|
|
|
13437
13448
|
this.PtInButtons=function(x,y) //坐标是否在按钮上
|
|
13438
13449
|
{
|
|
@@ -13533,16 +13544,42 @@ function IChartFramePainting()
|
|
|
13533
13544
|
//JSConsole.Chart.Log(`[IChartFramePainting.DrawBorder] left=${left} `);
|
|
13534
13545
|
if (this.BorderLine==null)
|
|
13535
13546
|
{
|
|
13536
|
-
if (this.IsDrawRightBorder)
|
|
13547
|
+
if (this.IsDrawRightBorder || this.IsDrawLeftBorder)
|
|
13537
13548
|
{
|
|
13538
|
-
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13539
13549
|
this.Canvas.strokeStyle=this.PenBorder;
|
|
13540
|
-
this.Canvas.strokeRect(left,top,xRight-left,height);
|
|
13541
13550
|
|
|
13542
|
-
this.
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13551
|
+
if (this.IsDrawRightBorder && this.IsDrawLeftBorder)
|
|
13552
|
+
{
|
|
13553
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13554
|
+
var xLeft=ToFixedPoint(0);
|
|
13555
|
+
this.Canvas.strokeRect(xLeft,top,xRight-xLeft-1,height); //少一个像素让边框显示出来
|
|
13556
|
+
}
|
|
13557
|
+
else if (this.IsDrawRightBorder)
|
|
13558
|
+
{
|
|
13559
|
+
var xRight=ToFixedPoint(border.ChartWidth);
|
|
13560
|
+
this.Canvas.strokeRect(left,top,xRight-left-1,height); //少一个像素让边框显示出来
|
|
13561
|
+
}
|
|
13562
|
+
else if (this.IsDrawLeftBorder)
|
|
13563
|
+
{
|
|
13564
|
+
var xLeft=ToFixedPoint(0);
|
|
13565
|
+
this.Canvas.strokeRect(xLeft,top,right-xLeft,height); //少一个像素让边框显示出来
|
|
13566
|
+
}
|
|
13567
|
+
|
|
13568
|
+
if (this.IsDrawRightBorder)
|
|
13569
|
+
{
|
|
13570
|
+
this.Canvas.beginPath();
|
|
13571
|
+
this.Canvas.moveTo(right,top);
|
|
13572
|
+
this.Canvas.lineTo(right,bottom);
|
|
13573
|
+
this.Canvas.stroke();
|
|
13574
|
+
}
|
|
13575
|
+
|
|
13576
|
+
if (this.IsDrawLeftBorder)
|
|
13577
|
+
{
|
|
13578
|
+
this.Canvas.beginPath();
|
|
13579
|
+
this.Canvas.moveTo(left,top);
|
|
13580
|
+
this.Canvas.lineTo(left,bottom);
|
|
13581
|
+
this.Canvas.stroke();
|
|
13582
|
+
}
|
|
13546
13583
|
}
|
|
13547
13584
|
else
|
|
13548
13585
|
{
|
|
@@ -14084,14 +14121,18 @@ function AverageWidthFrame()
|
|
|
14084
14121
|
var isDrawRight=borderRight>10 && this.IsShowYText[1]===true && this.YTextPosition[1]!=2;
|
|
14085
14122
|
|
|
14086
14123
|
var rightExtendLine=null; //右侧延长线
|
|
14124
|
+
var leftExtendLine=null; //左侧延长线
|
|
14087
14125
|
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
14088
14126
|
{
|
|
14089
14127
|
rightExtendLine=this.YLineExtend[1];
|
|
14128
|
+
leftExtendLine=this.YLineExtend[0];
|
|
14090
14129
|
}
|
|
14091
14130
|
|
|
14092
14131
|
var rightExtendText=null; //右侧文字设置
|
|
14132
|
+
var leftExtendText=null; //左侧文字设置
|
|
14093
14133
|
if (IFrameSplitOperator.IsNonEmptyArray(this.YTextExtend))
|
|
14094
14134
|
{
|
|
14135
|
+
leftExtendText=this.YTextExtend[0];
|
|
14095
14136
|
rightExtendText=this.YTextExtend[1];
|
|
14096
14137
|
}
|
|
14097
14138
|
|
|
@@ -14193,12 +14234,34 @@ function AverageWidthFrame()
|
|
|
14193
14234
|
{
|
|
14194
14235
|
if (item.Font!=null) this.Canvas.font=item.Font;
|
|
14195
14236
|
|
|
14237
|
+
var xText=left;
|
|
14238
|
+
if (leftExtendLine && leftExtendLine.Width>1)
|
|
14239
|
+
{
|
|
14240
|
+
var lineLength=leftExtendLine.Width;
|
|
14241
|
+
if (leftExtendLine.Color) this.Canvas.strokeStyle=leftExtendLine.Color;
|
|
14242
|
+
else this.Canvas.strokeStyle=item.LineColor;
|
|
14243
|
+
this.Canvas.beginPath();
|
|
14244
|
+
this.Canvas.moveTo(xText,yFixed);
|
|
14245
|
+
this.Canvas.lineTo(xText-lineLength,yFixed);
|
|
14246
|
+
this.Canvas.stroke();
|
|
14247
|
+
|
|
14248
|
+
xText-=lineLength;
|
|
14249
|
+
}
|
|
14250
|
+
|
|
14196
14251
|
rtLeft=this.GetTextTopBottom(textBaseline,yText);
|
|
14197
14252
|
if (!rtPreLeft || (rtLeft && !this.IsTextTopBottomOverlap(rtLeft, rtPreLeft)))
|
|
14198
14253
|
{
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14254
|
+
if (leftExtendText && leftExtendText.Align===1)
|
|
14255
|
+
{
|
|
14256
|
+
this.Canvas.textAlign="left";
|
|
14257
|
+
this.Canvas.fillText(item.Message[0],this.YTextPadding[0],yText);
|
|
14258
|
+
}
|
|
14259
|
+
else
|
|
14260
|
+
{
|
|
14261
|
+
this.Canvas.textAlign="right";
|
|
14262
|
+
this.Canvas.fillText(item.Message[0],xText-this.YTextPadding[0],yText);
|
|
14263
|
+
rtPreLeft=rtLeft;
|
|
14264
|
+
}
|
|
14202
14265
|
}
|
|
14203
14266
|
}
|
|
14204
14267
|
|
|
@@ -14276,7 +14339,7 @@ function AverageWidthFrame()
|
|
|
14276
14339
|
if (!rtPreRight || (rtRight && !this.IsTextTopBottomOverlap(rtRight,rtPreRight)))
|
|
14277
14340
|
{
|
|
14278
14341
|
if (item.TextColor2) this.Canvas.fillStyle=item.TextColor2;
|
|
14279
|
-
if (rightExtendText && rightExtendText.Align && this.YRightTextInfo)
|
|
14342
|
+
if (rightExtendText && rightExtendText.Align===2 && this.YRightTextInfo)
|
|
14280
14343
|
{
|
|
14281
14344
|
this.Canvas.textAlign="right";
|
|
14282
14345
|
var xRight=this.YRightTextInfo.MainTextWidth+right-this.YTextPadding[1];
|
|
@@ -15502,6 +15565,16 @@ function AverageWidthFrame()
|
|
|
15502
15565
|
var rightExtendWidth=0;
|
|
15503
15566
|
var isYPercentage=false; //是否是百分比坐标
|
|
15504
15567
|
if (this.YSplitOperator && this.YSplitOperator.CoordinateType==1) isYPercentage=true;
|
|
15568
|
+
|
|
15569
|
+
var leftExtendLineWidth=0;
|
|
15570
|
+
var rightExtendLineWidth=0;
|
|
15571
|
+
if (IFrameSplitOperator.IsNonEmptyArray(this.YLineExtend))
|
|
15572
|
+
{
|
|
15573
|
+
if (this.YLineExtend[0] && this.YLineExtend[0].Width>1)
|
|
15574
|
+
leftExtendLineWidth=this.YLineExtend[0].Width;
|
|
15575
|
+
if (this.YLineExtend[1] && this.YLineExtend[1].Width>1)
|
|
15576
|
+
rightExtendLineWidth=this.YLineExtend[1].Width;
|
|
15577
|
+
}
|
|
15505
15578
|
|
|
15506
15579
|
for(var i=0;i<this.HorizontalInfo.length;++i)
|
|
15507
15580
|
{
|
|
@@ -15568,8 +15641,8 @@ function AverageWidthFrame()
|
|
|
15568
15641
|
|
|
15569
15642
|
|
|
15570
15643
|
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=rightExtendWidth;
|
|
15571
|
-
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0];
|
|
15572
|
-
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1];
|
|
15644
|
+
if (IFrameSplitOperator.IsNumber(width.Left)) width.Left+=this.YTextPadding[0]+leftExtendLineWidth;
|
|
15645
|
+
if (IFrameSplitOperator.IsNumber(width.Right)) width.Right+=this.YTextPadding[1]+rightExtendLineWidth;
|
|
15573
15646
|
|
|
15574
15647
|
return { TextWidth:width };
|
|
15575
15648
|
}
|
|
@@ -113376,12 +113449,12 @@ function JSExplainer(ast,option)
|
|
|
113376
113449
|
["SUBSTR", { Name:"SUBSTR", Param:{ Count:3 }, ToString:function(args) { return `字符串${args[0]}中取一部分`; } } ],
|
|
113377
113450
|
["STRCMP", { Name:"STRCMP", Param:{ Count:2 }, ToString:function(args) { return `字符串${args[0]}和字符串${args[1]}比较`; } } ],
|
|
113378
113451
|
["FINDSTR", { Name:"FINDSTR", Param:{ Count:2 }, ToString:function(args) { return `字符串${args[0]}中查找字符串${args[1]}`; } } ],
|
|
113379
|
-
["
|
|
113452
|
+
["NAMEINCLUDE", { Name:"NAMEINCLUDE", Param:{ Count:1 }, ToString:function(args) { return `查找品种名称中包含${args[0]}`; } } ],
|
|
113380
113453
|
["CODELIKE", { Name:"CODELIKE", Param:{ Count:1 }, ToString:function(args) { return `查找品种名称中包含${args[0]}`; } } ],
|
|
113381
113454
|
["INBLOCK", { Name:"AVEDEV", Param:{ Count:1 }, ToString:function(args) { return `属于${args[0]}板块`; } } ],
|
|
113382
113455
|
["STKINDI",{ Name:"STKINDI", Param:{ Dynamic:true }, ToString:function(args) { return "指标引用"; } }],
|
|
113383
113456
|
["STRFORMAT",{ Name:"STRFORMAT", Param:{ Dynamic:true }, ToString:function(args) { return `格式化${args[0]}字符串`; } }],
|
|
113384
|
-
|
|
113457
|
+
["NAMELIKE",{ Name:"NAMELIKE", Param:{ Count:1 }, ToString:function(args) { return `品种名称是否以'${args[0]}'开头`; } }],
|
|
113385
113458
|
|
|
113386
113459
|
[
|
|
113387
113460
|
"HHVBARS",
|
|
@@ -113524,6 +113597,7 @@ function JSExplainer(ast,option)
|
|
|
113524
113597
|
case "FIRSTDRAW":
|
|
113525
113598
|
return "";
|
|
113526
113599
|
|
|
113600
|
+
|
|
113527
113601
|
default:
|
|
113528
113602
|
this.ThrowUnexpectedNode(node,`函数${funcName}不存在`);
|
|
113529
113603
|
}
|
|
@@ -131117,7 +131191,7 @@ function HQChartScriptWorker()
|
|
|
131117
131191
|
|
|
131118
131192
|
|
|
131119
131193
|
|
|
131120
|
-
var HQCHART_VERSION="1.1.
|
|
131194
|
+
var HQCHART_VERSION="1.1.12728";
|
|
131121
131195
|
|
|
131122
131196
|
function PrintHQChartVersion()
|
|
131123
131197
|
{
|