hqchart 1.1.15229 → 1.1.15235
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
|
@@ -4416,8 +4416,8 @@ this.AfterCloseData;//盘后数据
|
|
|
4416
4416
|
this.BeforeVolColor=g_JSChartResource.Minute.Before.VolColor;this.ShareAfterVol=0;this.MultiDayBeforeOpenData;//多日分时图 盘前数据 数组 1天一个
|
|
4417
4417
|
this.MultiDayAfterCloseData;//多日分时图 盘后数据 数组 1天一个
|
|
4418
4418
|
this.PtInChart=function(x,y){var option={MinuteVolBar:true,VolUnit:this.GetVolUnit()};return this.PtInBar(x,y,option);};this.DrawSelectedStatus=function(){return this.DrawLinePoint({MinuteVolBar:true});};this.GetVolUnit=function(){var upperSymbol=this.Symbol?this.Symbol.toUpperCase():null;var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);return unit;};this.Draw=function(){var isHScreen=this.ChartFrame.IsHScreen===true;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var chartright=border.BottomEx;}else{var border=this.ChartBorder.GetBorder();var chartright=border.RightEx;}this.DrawBeforeOpen();this.DrawMultiDayBeforeOpen();var xPointCount=this.ChartFrame.XPointCount;var yBottom=this.ChartFrame.GetYFromData(0);var yPrice=this.YClose;//上一分钟的价格
|
|
4419
|
-
var data=this.Data;var bShowColorBar=MARKET_SUFFIX_NAME.IsShowMinuteColorVolBar(this.Symbol);if(bShowColorBar)this.Canvas.strokeStyle=this.CustomColor;var unit=this.GetVolUnit();for(var i=data.DataOffset,j=0;i<data.Data.length&&j<xPointCount;++i,++j){var item=data.Data[i];var vol=null;if(!item)continue;var price=null;vol=item.Vol/unit;price=item.Close;if(!vol)continue;var y=this.ChartFrame.GetYFromData(vol);var x=this.ChartFrame.GetXFromIndex(j);if(x>chartright)break;//价格>=上一分钟价格 红色 否则绿色
|
|
4420
|
-
if(!bShowColorBar)this.Canvas.strokeStyle=this.GetMinuteBarColor(price,yPrice);this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(y,ToFixedPoint(x));this.Canvas.lineTo(yBottom,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),y);this.Canvas.lineTo(ToFixedPoint(x),yBottom);}this.Canvas.stroke();if(price)yPrice=price;}this.DrawAfterClose();this.DrawMultiDayAfterClose();};//连续交易成交量柱子颜色
|
|
4419
|
+
var data=this.Data;var bShowColorBar=MARKET_SUFFIX_NAME.IsShowMinuteColorVolBar(this.Symbol);if(bShowColorBar)this.Canvas.strokeStyle=this.CustomColor;var unit=this.GetVolUnit();if(data&&IFrameSplitOperator.IsNonEmptyArray(data.Data)){for(var i=data.DataOffset,j=0;i<data.Data.length&&j<xPointCount;++i,++j){var item=data.Data[i];var vol=null;if(!item)continue;var price=null;vol=item.Vol/unit;price=item.Close;if(!vol)continue;var y=this.ChartFrame.GetYFromData(vol);var x=this.ChartFrame.GetXFromIndex(j);if(x>chartright)break;//价格>=上一分钟价格 红色 否则绿色
|
|
4420
|
+
if(!bShowColorBar)this.Canvas.strokeStyle=this.GetMinuteBarColor(price,yPrice);this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(y,ToFixedPoint(x));this.Canvas.lineTo(yBottom,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),y);this.Canvas.lineTo(ToFixedPoint(x),yBottom);}this.Canvas.stroke();if(price)yPrice=price;}}this.DrawAfterClose();this.DrawMultiDayAfterClose();};//连续交易成交量柱子颜色
|
|
4421
4421
|
this.GetMinuteBarColor=function(price,yPrice){if(this.BarColorType==1)//通达信模式
|
|
4422
4422
|
{if(price>yPrice)return this.UpColor;else if(price<yPrice)return this.DownColor;else return this.UnchangeColor;}else//东方财富模式
|
|
4423
4423
|
{return price>=yPrice?this.UpColor:this.DownColor;}};this.DrawBeforeOpen=function(){if(this.ChartBorder.LeftExtendWidth<10)return;if(!this.BeforeOpenData)return;this.DrawCallAuction(-1,this.BeforeOpenData,true);};this.DrawAfterClose=function(){if(this.ChartBorder.RightExtendWidth<10)return;if(!this.AfterCloseData)return;this.DrawCallAuction(-1,this.AfterCloseData,false);};this.DrawMultiDayBeforeOpen=function(){if(this.ChartBorder.MultiDayMinute.Count<=1||this.ChartBorder.MultiDayMinute.Left<=0)return;if(!this.MultiDayBeforeOpenData)return;var offset=0,showDayCount=this.MultiDayBeforeOpenData.length;if(this.DayOffset){if(IFrameSplitOperator.IsNumber(this.DayOffset.Offset))offset=this.DayOffset.Offset;if(IFrameSplitOperator.IsNumber(this.DayOffset.ShowDayCount))showDayCount=this.DayOffset.ShowDayCount;}for(var i=offset,j=0;i<this.MultiDayBeforeOpenData.length&&j<showDayCount;++i,++j){var dayItem=this.MultiDayBeforeOpenData[i];this.DrawCallAuction(j,dayItem,true);}};this.DrawMultiDayAfterClose=function(){if(this.ChartBorder.MultiDayMinute.Count<=1||this.ChartBorder.MultiDayMinute.Right<=0)return;if(!this.MultiDayAfterCloseData)return;var offset=0,showDayCount=this.MultiDayAfterCloseData.length;if(this.DayOffset){if(IFrameSplitOperator.IsNumber(this.DayOffset.Offset))offset=this.DayOffset.Offset;if(IFrameSplitOperator.IsNumber(this.DayOffset.ShowDayCount))showDayCount=this.DayOffset.ShowDayCount;}for(var i=offset,j=0;i<this.MultiDayAfterCloseData.length&&j<showDayCount;++i,++j){var dayItem=this.MultiDayAfterCloseData[i];this.DrawCallAuction(j,dayItem,false);}};this.DrawCallAuction=function(indexDay,callAutionData,isBeforeOpen){if(!callAutionData)return;callAutionData.Index=indexDay;var border=this.GetBorder();var isHScreen=this.ChartFrame.IsHScreen===true;var yPrice=this.YClose;//上一分钟的价格
|
|
@@ -6854,7 +6854,7 @@ this.LineWidth=1;this.Precision=2;//小数位数
|
|
|
6854
6854
|
this.ValueTextColor='rgb(250,250,250)';this.IsShowCorssCursor=true;//画的时候是否显示十字光标
|
|
6855
6855
|
this.GetLabelCallback;//绘制标题回调函数
|
|
6856
6856
|
this.PointCount=1;this.ClassName='ChartDrawHLine';this.Font=14*GetDevicePixelRatio()+"px 微软雅黑";this.TextFont=12*GetDevicePixelRatio()+"px 微软雅黑";this.RightSpaceWidth=50;this.PriceBGColor;this.ButtonPosition=0;//按钮位置, 0=价格后面, 1=价格上面 2=价格上面 左对齐 3=垂直排列
|
|
6857
|
-
this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.TopOffset=3;this.TextMargin={Left:0,Right:0,Top:0,Bottom:0,YOffset
|
|
6857
|
+
this.ButtonBGColor='rgb(190,190,190)';this.ButtonSpace=3;this.TopOffset=3;this.TextMargin={Left:0,Right:0,Top:0,Bottom:0,YOffset:-1*GetDevicePixelRatio()};this.AlwaysShowLab=false;//总是显示标签
|
|
6858
6858
|
this.Button={CloseIcon:{Text:'\uE62B',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_DELETE,TooltipText:null,Margin:{Left:2,Right:2}},SettingIcon:{Text:'\uE623',Color:'rgb(255,255,255)',Family:"iconfont",Size:16,ID:JSCHART_BUTTON_ID.DRAW_PICTURE_SETTING,TooltipText:null,Margin:{Left:2,Right:2}//修改ID, Text , TooltipText 可以外部定制按钮
|
|
6859
6859
|
}};this.CustomButton=[];//自定义的按钮 { Text:'\ue62b', Color:'rgb(255,255,255)', Family:"iconfont", Size:16, ID:JSCHART_BUTTON_ID.DRAW_PICTURE_BUTTON_1, TooltipText:null, Data:null }
|
|
6860
6860
|
this.AryShowButton=[];//需要显示的按钮 { Data:, Width }
|
|
@@ -6890,7 +6890,7 @@ if(labelInfo.BGColor){this.Canvas.fillStyle=labelInfo.BGColor;this.Canvas.fillRe
|
|
|
6890
6890
|
{yBottom=border.Bottom;yTop=yBottom-totalHeight;if(yTop<this.TopOffset){yTop=this.TopOffset;yBottom=yTop+totalHeight;}option.Top=yTop;}this.DrawValueText(y,rtDraw,option);var drawLeft=rtDraw.Right-labSize.Width;if(drawLeft<rtDraw.Left)drawLeft=rtDraw.Left;var drawRight=drawLeft+labSize.Width;var drawTop=rtDraw.Bottom;var rtLabel={Left:drawLeft,Right:drawRight,Top:drawTop,Width:labSize.Width,Height:labSize.Height};rtLabel.Bottom=rtLabel.Top+rtLabel.Height;this.DrawLabel(this.LableInfo,labSize,rtLabel);this.DrawVerticalButton(rtLabel);};this.DrawCustomHLine=function(yLine){if(!this.LableInfo)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.LableInfo.AryLine))return;var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var pixelRatio=GetDevicePixelRatio();var yMax=yLine,yMin=yLine;for(var i=0;i<this.LableInfo.AryLine.length;++i){var item=this.LableInfo.AryLine[i];if(!IFrameSplitOperator.IsNumber(item.Value))continue;if(item.Width<0)continue;var y=this.Frame.GetYFromData(item.Value);var yFixed=ToFixedPoint(y);var xRight=right;if(IFrameSplitOperator.IsPlusNumber(item.Width)){if(item.Width<1)xRight=left+item.Width*(right-left);//0.3 百分比
|
|
6891
6891
|
else xRight=left+item.Width*pixelRatio;//>1 实际数值就是长度
|
|
6892
6892
|
}if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(left,yFixed);this.Canvas.lineTo(xRight,yFixed);this.Canvas.stroke();if(yMax<yFixed)yMax=yFixed;if(yMin>yFixed)yMin=yFixed;}if(yMax!=yMin&&this.LableInfo.VLine){var item=this.LableInfo.VLine;var x=left+20*pixelRatio;if(IFrameSplitOperator.IsNumber(item.XOffset))x=left+item.XOffset*pixelRatio;x=ToFixedPoint(x);if(item.Color)this.Canvas.strokeStyle=item.Color;else this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(x,yMax);this.Canvas.lineTo(x,yMin);this.Canvas.stroke();}};this.DrawValueText=function(y,rtDraw,option){var left=this.Frame.ChartBorder.GetLeft();var right=this.Frame.ChartBorder.GetRight();var top=this.Frame.ChartBorder.GetTopEx();var bottom=this.Frame.ChartBorder.GetBottomEx();var pixelTatio=GetDevicePixelRatio();var labInfo=this.LabelInfo;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.TopOffset))top-=labInfo.TopOffset;if(labInfo&&IFrameSplitOperator.IsNumber(labInfo.BottomOffset))bottom+=labInfo.BottomOffset;var yValue=this.Frame.GetYData(y,false);var strValue=yValue.toFixed(this.Precision);if(labInfo&&labInfo.PriceSuffixText)strValue+=labInfo.PriceSuffixText;var bVisibleRange=true;if(y<top){y=top;bVisibleRange=false;}else if(y>bottom){y=bottom;bVisibleRange=false;}if(this.RightSpaceWidth>0){if(!bVisibleRange)this.Canvas.setLineDash([2*pixelTatio,3*pixelTatio]);//虚线
|
|
6893
|
-
this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();if(!bVisibleRange)this.Canvas.setLineDash([]);}if(this.PriceBGColor)this.Canvas.fillStyle=this.PriceBGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,YCenter:y,Width:textWidth,Height:lineHeight};rtBG.Height+=this.TextMargin.Top+this.TextMargin.Bottom;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;if(option&&IFrameSplitOperator.IsNumber(option.Top)){rtBG.Top=option.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;}var xText=rtBG.Left+this.TextMargin.Left;var yText=rtBG.
|
|
6893
|
+
this.Canvas.strokeStyle=this.LineColor;this.Canvas.beginPath();this.Canvas.moveTo(right,ToFixedPoint(y));this.Canvas.lineTo(right+this.RightSpaceWidth,ToFixedPoint(y));this.Canvas.stroke();if(!bVisibleRange)this.Canvas.setLineDash([]);}if(this.PriceBGColor)this.Canvas.fillStyle=this.PriceBGColor;else this.Canvas.fillStyle=this.LineColor;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var rtBG={Left:right+this.RightSpaceWidth,YCenter:y,Width:textWidth,Height:lineHeight};rtBG.Height+=this.TextMargin.Top+this.TextMargin.Bottom;rtBG.Width+=this.TextMargin.Left+this.TextMargin.Right;rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Top=rtBG.YCenter-rtBG.Height/2;rtBG.Bottom=rtBG.Top+rtBG.Height;if(option&&IFrameSplitOperator.IsNumber(option.Top)){rtBG.Top=option.Top;rtBG.Bottom=rtBG.Top+rtBG.Height;}var xText=rtBG.Left+this.TextMargin.Left;var yText=rtBG.Bottom-this.TextMargin.Bottom+this.TextMargin.YOffset;if(this.ButtonPosition==1){this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));}else{this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));}this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="bottom";this.Canvas.fillText(strValue,xText,yText);rtDraw.Left=rtBG.Left;rtDraw.Top=rtBG.Top;rtDraw.Bottom=rtBG.Bottom;rtDraw.Right=rtBG.Right;this.DrawButton(rtBG.Top,rtBG.Right,lineHeight,rtDraw);};//计算右侧价格标签大小
|
|
6894
6894
|
this.CalculateValueText=function(y){var yValue=this.Frame.GetYData(y,false);var strValue=yValue.toFixed(this.Precision);if(this.LableInfo&&this.LableInfo.PriceSuffixText)strValue+=this.LableInfo.PriceSuffixText;this.Canvas.font=this.Font;var textWidth=this.Canvas.measureText(strValue).width;var lineHeight=this.GetFontHeight();var size={Width:textWidth,Height:lineHeight};size.Height+=this.TextMargin.Top+this.TextMargin.Bottom;size.Width+=this.TextMargin.Left+this.TextMargin.Right;return size;};this.DrawPriceText=function(text,ptStart,ptEnd,position){if(position!=1&&position!=0)return;var font=this.ShowPriceTextConfig.Font[position];this.Canvas.fillStyle=this.LineColor;this.Canvas.font=font;var textWidth=this.Canvas.measureText(text).width;var lineHeight=this.GetFontHeight();var rtBG=null;if(position==1){var rtBG={Left:ptStart.X,Top:ptStart.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}else if(position==0){var rtBG={Right:ptEnd.X,Top:ptEnd.Y-lineHeight/2,Width:textWidth+4,Height:lineHeight};rtBG.Left=rtBG.Right-rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;}this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width+this.ButtonBGWidth),ToFixedRect(rtBG.Height));this.Canvas.fillStyle=this.ValueTextColor;this.Canvas.textAlign="left";this.Canvas.textBaseline="middle";this.Canvas.fillText(text,rtBG.Left+2,ptStart.Y);};this.CalculateButtonSize=function(){var pixelRatio=GetDevicePixelRatio();if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;var totalWidth=0;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;item.Width=this.Canvas.measureText(icon.Text).width+2;item.Height=item.Width;if(icon.Margin){var margin=icon.Margin;if(IFrameSplitOperator.IsNumber(margin.Left))item.Width+=margin.Left;if(IFrameSplitOperator.IsNumber(margin.Right))item.Width+=margin.Right;if(IFrameSplitOperator.IsNumber(margin.Top))item.Height+=margin.Top;if(IFrameSplitOperator.IsNumber(margin.Bottom))item.Height+=margin.Bottom;}if(this.VerticalButtonInfo.Width<item.Width)this.VerticalButtonInfo.Width=item.Width;this.VerticalButtonInfo.Height+=item.Height;totalWidth+=item.Width;}this.ButtonBGWidth=totalWidth;};//垂直排列按钮
|
|
6895
6895
|
this.DrawVerticalButton=function(rtLab){if(this.ButtonPosition!=3)return;if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.VerticalButtonInfo.Height<=0)return;var rtBG={Left:rtLab.Right,Top:rtLab.Top,Width:this.VerticalButtonInfo.Width,Height:this.VerticalButtonInfo.Height};rtBG.Right=rtBG.Left+rtBG.Width;rtBG.Bottom=rtBG.Top+rtBG.Height;this.Canvas.fillStyle=this.ButtonBGColor;this.Canvas.fillRect(ToFixedRect(rtBG.Left),ToFixedRect(rtBG.Top),ToFixedRect(rtBG.Width),ToFixedRect(rtBG.Height));var pixelRatio=GetDevicePixelRatio();var yTop=rtLab.Top;for(var i=0;i<this.AryShowButton.length;++i){var item=this.AryShowButton[i];var icon=item.Data;var rtButton={Left:rtBG.Left,Top:yTop,Width:this.VerticalButtonInfo.Width,Height:item.Height};rtButton.Right=rtButton.Left+rtButton.Width;rtButton.Bottom=rtButton.Top+rtButton.Height;var yCenter=rtButton.Top+rtButton.Height/2;var xCenter=rtButton.Left+rtButton.Width/2;var font=icon.Size*pixelRatio+'px '+icon.Family;this.Canvas.font=font;this.Canvas.textAlign="center";this.Canvas.textBaseline="middle";this.Canvas.fillStyle=icon.Color;this.Canvas.fillText(icon.Text,xCenter,yCenter);this.AryButton.push({Rect:rtButton,ID:icon.ID,TooltipText:icon.TooltipText,Data:icon.Data});yTop=rtButton.Bottom;}};this.DrawButton=function(drawTop,drawLeft,drawHeight,rtDraw){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryShowButton))return;if(this.ButtonPosition==3)return;//垂直按钮在DrawVerticalButton()调用
|
|
6896
6896
|
if(this.ButtonPosition==1){drawTop-=drawHeight;var chartWidth=this.Frame.ChartBorder.GetChartWidth();var chartLeft=this.Frame.ChartBorder.GetRight()+this.RightSpaceWidth;if(drawLeft+this.ButtonBGWidth>chartWidth)//右边不够了 往左移动
|
|
@@ -15645,7 +15645,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
|
|
|
15645
15645
|
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);};}/********************************************************************************
|
|
15646
15646
|
* 版本信息输出
|
|
15647
15647
|
*
|
|
15648
|
-
*/var HQCHART_VERSION="1.1.
|
|
15648
|
+
*/var HQCHART_VERSION="1.1.15234";function PrintHQChartVersion(){var logo='\n\n*************************************************************************************************************************************************************************** \n* \n* :%@@- \n* :@@@@- \n* =@@@@ :#@@@ .:+#@@@#=: :=*@@@@@@#+-. *@@@@. \n* :@@@@@ .@@@@@ .#@@@@@@@@@@@- +@@@@@@@@@@@@@+ @@@@@ -%@@* \n* +@@@@% #@@@@# *@@@@@@@@@@@@@@%. =@@@@@@@@@@@@@@@- @@@@@ -@@@@+ \n* %@@@@* @@@@@+ .%@@@@@@@@@@@@@@@@%: #@@@@@@@@@@@@@@@% @@@@# *@@@@= \n* @@@@@= @@@@@- .%@@@@@@@*++*%@@@@@@% .%@@@@@@@%*+==+**= -@@@@+ #@@@@- \n* @@@@@. @@@@@. #@@@@@%= =@@@@@@* %@@@@@@#: *@@@@- :::. .-+*###+: ::: .+##+: -%%@@@@@%%%% \n* .@@@@@ .@@@@@. +@@@@@% .@@@@@@ *@@@@@@: %@@@@: +@@@@@%. :%@@@@@@@@@@: *@@@ :@@@@@* @@@@@@@@@@@@ \n* :@@@@@ :@@@@@ @@@@@% :@@@@@+ @@@@@@: %@@@@-@@@@@@@@@. @@@@@@@@@@@@@. :@@@%-@@@@@@.:@@@@@@@@@@@# \n* -@@@@% -@@@@@ =@@@@@. %@@@@% %@@@@@- %@@@@@@@@@@@@@@* %@@@@@@@@@@@@+ -@@@@@@@@@@# -@@@@@@@@@@@. \n* +@@@@%=========#@@@@% @@@@@# :@@@@@ .@@@@@% @@@@@@@@%@@@@@@@ -%+:. .#@@@@* +@@@@@@@%%@. .::+@@@@#:: \n* #@@@@@@@@@@@@@@@@@@@# .@@@@@ .@@@@@ :@@@@@. @@@@@@#. #@@@@@. -@@@@* #@@@@@@: *@@@@+ \n* %@@@@@@@@@@@@@@@@@@@+ :@@@@@ .@@@@@ -@@@@@ @@@@@+ @@@@@. :@@@@* @@@@@% #@@@@- \n* @@@@@@@@@@@@@@@@@@@@: :@@@@% :@@@@@ +@@@@% -@@@@+ @@@@@ -@@@@+ @@@@@. @@@@@. \n* .@@@@@@@@@@@@@@@@@@@@ :@@@@% -@@@@% *@@@@% #@@@@. @@@@@ .=*#%%%@@@@@= :@@@@# @@@@@. \n* -@@@@@:::::::::=@@@@@ :@@@@@ @@@@@* +@@@@% @@@@@ @@@@% -#@@@@@@@@@@@@: -@@@@* @@@@@ \n* =@@@@% =@@@@% .@@@@@ :@@@@@. -@@@@% @@@@@ .@@@@* +@@@@@@@@@@@@@@. =@@@@+ .@@@@@ \n* +@@@@# +@@@@# @@@@@# %@@@@% :@@@@@ .@@@@% =@@@@= -@@@@@*-:..%@@@@ +@@@@= :@@@@# \n* *@@@@* *@@@@* +@@@@@: #@@@@@+ .@@@@@@ :@@@@% *@@@@- @@@@@. @@@@% #@@@@: =@@@@+ \n* %@@@@= %@@@@+ @@@@@@- .%@@@@@# #@@@@@# :@@@@% #@@@@: @@@@% @@@@* %@@@@. #@@@@- \n* @@@@@- @@@@@= =@@@@@@#=...-*@@@@@@@: @@@@@@%=. :+**. :@@@@* %@@@@. .@@@@* *@@@@= @@@@@ %@@@@+ \n* .@@@@@: .@@@@@: *@@@@@@@@@@@@@@@@@@@# =@@@@@@@@%%%@@@@@@ +@@@@- @@@@@ .@@@@@: :%@@@@@- .@@@@% %@@@@@*+- \n* :@@@@@ :@@@@@ +@@@@@@@@@@@@@@@@@@@# =@@@@@@@@@@@@@@@@% %@@@@ @@@@@ @@@@@@@@@@@@@@@: -@@@@* *@@@@@@@@- \n* =@@@@@ -@@@@@ :@@@@@@@@@@@@@@@@@@@# :@@@@@@@@@@@@@@@% @@@@@ %@@@% #@@@@@@@@@#@@@@. +@@@@- .@@@@@@@@# \n* *@@@@# =@@@@% :#@@@@@@@#: :@@@@@= =@@@@@@@@@@@+. @@@@@ :@@@+ *@@@@@@@- %@@@ *@@@= =@@@@@@@* \n* =++++- -++++= .:::. .=*+: :-=+++=:. ****= .=+. .-++=: :+++ -+=: .-=+=:. \n* \n* \n* HQChart \n* Ver: '+HQCHART_VERSION+' \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ';console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
|
|
15649
15649
|
exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
|
|
15650
15650
|
// BaseIndex:BaseIndex,
|
|
15651
15651
|
// ChartLine:ChartLine,
|
package/package.json
CHANGED
package/src/jscommon/umychart.js
CHANGED
|
@@ -35641,38 +35641,41 @@ function ChartMinuteVolumBar()
|
|
|
35641
35641
|
if (bShowColorBar) this.Canvas.strokeStyle=this.CustomColor;
|
|
35642
35642
|
var unit=this.GetVolUnit();
|
|
35643
35643
|
|
|
35644
|
-
|
|
35644
|
+
if (data && IFrameSplitOperator.IsNonEmptyArray(data.Data))
|
|
35645
35645
|
{
|
|
35646
|
-
var
|
|
35647
|
-
|
|
35648
|
-
|
|
35649
|
-
|
|
35646
|
+
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
35647
|
+
{
|
|
35648
|
+
var item = data.Data[i];
|
|
35649
|
+
var vol=null;
|
|
35650
|
+
if (!item) continue;
|
|
35651
|
+
var price=null;
|
|
35650
35652
|
|
|
35651
|
-
|
|
35652
|
-
|
|
35653
|
-
|
|
35654
|
-
|
|
35653
|
+
vol=item.Vol/unit;
|
|
35654
|
+
price=item.Close;
|
|
35655
|
+
|
|
35656
|
+
if (!vol) continue;
|
|
35655
35657
|
|
|
35656
|
-
|
|
35657
|
-
|
|
35658
|
-
|
|
35658
|
+
var y=this.ChartFrame.GetYFromData(vol);
|
|
35659
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
35660
|
+
if (x>chartright) break;
|
|
35659
35661
|
|
|
35660
|
-
|
|
35661
|
-
|
|
35662
|
+
//价格>=上一分钟价格 红色 否则绿色
|
|
35663
|
+
if (!bShowColorBar) this.Canvas.strokeStyle = this.GetMinuteBarColor(price, yPrice);
|
|
35662
35664
|
|
|
35663
|
-
|
|
35664
|
-
|
|
35665
|
-
|
|
35666
|
-
|
|
35667
|
-
|
|
35668
|
-
|
|
35669
|
-
|
|
35670
|
-
|
|
35671
|
-
|
|
35672
|
-
|
|
35665
|
+
this.Canvas.beginPath();
|
|
35666
|
+
if (isHScreen)
|
|
35667
|
+
{
|
|
35668
|
+
this.Canvas.moveTo(y,ToFixedPoint(x));
|
|
35669
|
+
this.Canvas.lineTo(yBottom,ToFixedPoint(x));
|
|
35670
|
+
}
|
|
35671
|
+
else
|
|
35672
|
+
{
|
|
35673
|
+
this.Canvas.moveTo(ToFixedPoint(x),y);
|
|
35674
|
+
this.Canvas.lineTo(ToFixedPoint(x),yBottom);
|
|
35675
|
+
}
|
|
35676
|
+
this.Canvas.stroke();
|
|
35677
|
+
if (price) yPrice=price;
|
|
35673
35678
|
}
|
|
35674
|
-
this.Canvas.stroke();
|
|
35675
|
-
if (price) yPrice=price;
|
|
35676
35679
|
}
|
|
35677
35680
|
|
|
35678
35681
|
this.DrawAfterClose();
|
|
@@ -67618,7 +67621,7 @@ function ChartDrawHLine()
|
|
|
67618
67621
|
this.ButtonSpace=3;
|
|
67619
67622
|
this.TopOffset=3;
|
|
67620
67623
|
|
|
67621
|
-
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset
|
|
67624
|
+
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset:-1*GetDevicePixelRatio() };
|
|
67622
67625
|
|
|
67623
67626
|
this.AlwaysShowLab=false; //总是显示标签
|
|
67624
67627
|
|
|
@@ -68192,7 +68195,7 @@ function ChartDrawHLine()
|
|
|
68192
68195
|
}
|
|
68193
68196
|
|
|
68194
68197
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
68195
|
-
var yText=rtBG.
|
|
68198
|
+
var yText=rtBG.Bottom-this.TextMargin.Bottom+this.TextMargin.YOffset;
|
|
68196
68199
|
|
|
68197
68200
|
if (this.ButtonPosition==1)
|
|
68198
68201
|
{
|
|
@@ -68205,7 +68208,7 @@ function ChartDrawHLine()
|
|
|
68205
68208
|
|
|
68206
68209
|
this.Canvas.fillStyle=this.ValueTextColor
|
|
68207
68210
|
this.Canvas.textAlign="left";
|
|
68208
|
-
this.Canvas.textBaseline="
|
|
68211
|
+
this.Canvas.textBaseline="bottom";
|
|
68209
68212
|
this.Canvas.fillText(strValue,xText,yText);
|
|
68210
68213
|
|
|
68211
68214
|
rtDraw.Left=rtBG.Left;
|
|
@@ -39737,38 +39737,41 @@ function ChartMinuteVolumBar()
|
|
|
39737
39737
|
if (bShowColorBar) this.Canvas.strokeStyle=this.CustomColor;
|
|
39738
39738
|
var unit=this.GetVolUnit();
|
|
39739
39739
|
|
|
39740
|
-
|
|
39740
|
+
if (data && IFrameSplitOperator.IsNonEmptyArray(data.Data))
|
|
39741
39741
|
{
|
|
39742
|
-
var
|
|
39743
|
-
|
|
39744
|
-
|
|
39745
|
-
|
|
39742
|
+
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
39743
|
+
{
|
|
39744
|
+
var item = data.Data[i];
|
|
39745
|
+
var vol=null;
|
|
39746
|
+
if (!item) continue;
|
|
39747
|
+
var price=null;
|
|
39746
39748
|
|
|
39747
|
-
|
|
39748
|
-
|
|
39749
|
-
|
|
39750
|
-
|
|
39749
|
+
vol=item.Vol/unit;
|
|
39750
|
+
price=item.Close;
|
|
39751
|
+
|
|
39752
|
+
if (!vol) continue;
|
|
39751
39753
|
|
|
39752
|
-
|
|
39753
|
-
|
|
39754
|
-
|
|
39754
|
+
var y=this.ChartFrame.GetYFromData(vol);
|
|
39755
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
39756
|
+
if (x>chartright) break;
|
|
39755
39757
|
|
|
39756
|
-
|
|
39757
|
-
|
|
39758
|
+
//价格>=上一分钟价格 红色 否则绿色
|
|
39759
|
+
if (!bShowColorBar) this.Canvas.strokeStyle = this.GetMinuteBarColor(price, yPrice);
|
|
39758
39760
|
|
|
39759
|
-
|
|
39760
|
-
|
|
39761
|
-
|
|
39762
|
-
|
|
39763
|
-
|
|
39764
|
-
|
|
39765
|
-
|
|
39766
|
-
|
|
39767
|
-
|
|
39768
|
-
|
|
39761
|
+
this.Canvas.beginPath();
|
|
39762
|
+
if (isHScreen)
|
|
39763
|
+
{
|
|
39764
|
+
this.Canvas.moveTo(y,ToFixedPoint(x));
|
|
39765
|
+
this.Canvas.lineTo(yBottom,ToFixedPoint(x));
|
|
39766
|
+
}
|
|
39767
|
+
else
|
|
39768
|
+
{
|
|
39769
|
+
this.Canvas.moveTo(ToFixedPoint(x),y);
|
|
39770
|
+
this.Canvas.lineTo(ToFixedPoint(x),yBottom);
|
|
39771
|
+
}
|
|
39772
|
+
this.Canvas.stroke();
|
|
39773
|
+
if (price) yPrice=price;
|
|
39769
39774
|
}
|
|
39770
|
-
this.Canvas.stroke();
|
|
39771
|
-
if (price) yPrice=price;
|
|
39772
39775
|
}
|
|
39773
39776
|
|
|
39774
39777
|
this.DrawAfterClose();
|
|
@@ -71714,7 +71717,7 @@ function ChartDrawHLine()
|
|
|
71714
71717
|
this.ButtonSpace=3;
|
|
71715
71718
|
this.TopOffset=3;
|
|
71716
71719
|
|
|
71717
|
-
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset
|
|
71720
|
+
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset:-1*GetDevicePixelRatio() };
|
|
71718
71721
|
|
|
71719
71722
|
this.AlwaysShowLab=false; //总是显示标签
|
|
71720
71723
|
|
|
@@ -72288,7 +72291,7 @@ function ChartDrawHLine()
|
|
|
72288
72291
|
}
|
|
72289
72292
|
|
|
72290
72293
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
72291
|
-
var yText=rtBG.
|
|
72294
|
+
var yText=rtBG.Bottom-this.TextMargin.Bottom+this.TextMargin.YOffset;
|
|
72292
72295
|
|
|
72293
72296
|
if (this.ButtonPosition==1)
|
|
72294
72297
|
{
|
|
@@ -72301,7 +72304,7 @@ function ChartDrawHLine()
|
|
|
72301
72304
|
|
|
72302
72305
|
this.Canvas.fillStyle=this.ValueTextColor
|
|
72303
72306
|
this.Canvas.textAlign="left";
|
|
72304
|
-
this.Canvas.textBaseline="
|
|
72307
|
+
this.Canvas.textBaseline="bottom";
|
|
72305
72308
|
this.Canvas.fillText(strValue,xText,yText);
|
|
72306
72309
|
|
|
72307
72310
|
rtDraw.Left=rtBG.Left;
|
|
@@ -154240,7 +154243,7 @@ function ScrollBarBGChart()
|
|
|
154240
154243
|
|
|
154241
154244
|
|
|
154242
154245
|
|
|
154243
|
-
var HQCHART_VERSION="1.1.
|
|
154246
|
+
var HQCHART_VERSION="1.1.15234";
|
|
154244
154247
|
|
|
154245
154248
|
function PrintHQChartVersion()
|
|
154246
154249
|
{
|
|
@@ -39781,38 +39781,41 @@ function ChartMinuteVolumBar()
|
|
|
39781
39781
|
if (bShowColorBar) this.Canvas.strokeStyle=this.CustomColor;
|
|
39782
39782
|
var unit=this.GetVolUnit();
|
|
39783
39783
|
|
|
39784
|
-
|
|
39784
|
+
if (data && IFrameSplitOperator.IsNonEmptyArray(data.Data))
|
|
39785
39785
|
{
|
|
39786
|
-
var
|
|
39787
|
-
|
|
39788
|
-
|
|
39789
|
-
|
|
39786
|
+
for(var i=data.DataOffset,j=0;i<data.Data.length && j<xPointCount;++i,++j)
|
|
39787
|
+
{
|
|
39788
|
+
var item = data.Data[i];
|
|
39789
|
+
var vol=null;
|
|
39790
|
+
if (!item) continue;
|
|
39791
|
+
var price=null;
|
|
39790
39792
|
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
39794
|
-
|
|
39793
|
+
vol=item.Vol/unit;
|
|
39794
|
+
price=item.Close;
|
|
39795
|
+
|
|
39796
|
+
if (!vol) continue;
|
|
39795
39797
|
|
|
39796
|
-
|
|
39797
|
-
|
|
39798
|
-
|
|
39798
|
+
var y=this.ChartFrame.GetYFromData(vol);
|
|
39799
|
+
var x=this.ChartFrame.GetXFromIndex(j);
|
|
39800
|
+
if (x>chartright) break;
|
|
39799
39801
|
|
|
39800
|
-
|
|
39801
|
-
|
|
39802
|
+
//价格>=上一分钟价格 红色 否则绿色
|
|
39803
|
+
if (!bShowColorBar) this.Canvas.strokeStyle = this.GetMinuteBarColor(price, yPrice);
|
|
39802
39804
|
|
|
39803
|
-
|
|
39804
|
-
|
|
39805
|
-
|
|
39806
|
-
|
|
39807
|
-
|
|
39808
|
-
|
|
39809
|
-
|
|
39810
|
-
|
|
39811
|
-
|
|
39812
|
-
|
|
39805
|
+
this.Canvas.beginPath();
|
|
39806
|
+
if (isHScreen)
|
|
39807
|
+
{
|
|
39808
|
+
this.Canvas.moveTo(y,ToFixedPoint(x));
|
|
39809
|
+
this.Canvas.lineTo(yBottom,ToFixedPoint(x));
|
|
39810
|
+
}
|
|
39811
|
+
else
|
|
39812
|
+
{
|
|
39813
|
+
this.Canvas.moveTo(ToFixedPoint(x),y);
|
|
39814
|
+
this.Canvas.lineTo(ToFixedPoint(x),yBottom);
|
|
39815
|
+
}
|
|
39816
|
+
this.Canvas.stroke();
|
|
39817
|
+
if (price) yPrice=price;
|
|
39813
39818
|
}
|
|
39814
|
-
this.Canvas.stroke();
|
|
39815
|
-
if (price) yPrice=price;
|
|
39816
39819
|
}
|
|
39817
39820
|
|
|
39818
39821
|
this.DrawAfterClose();
|
|
@@ -71758,7 +71761,7 @@ function ChartDrawHLine()
|
|
|
71758
71761
|
this.ButtonSpace=3;
|
|
71759
71762
|
this.TopOffset=3;
|
|
71760
71763
|
|
|
71761
|
-
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset
|
|
71764
|
+
this.TextMargin={ Left:0, Right:0, Top:0, Bottom:0, YOffset:-1*GetDevicePixelRatio() };
|
|
71762
71765
|
|
|
71763
71766
|
this.AlwaysShowLab=false; //总是显示标签
|
|
71764
71767
|
|
|
@@ -72332,7 +72335,7 @@ function ChartDrawHLine()
|
|
|
72332
72335
|
}
|
|
72333
72336
|
|
|
72334
72337
|
var xText=rtBG.Left+this.TextMargin.Left;
|
|
72335
|
-
var yText=rtBG.
|
|
72338
|
+
var yText=rtBG.Bottom-this.TextMargin.Bottom+this.TextMargin.YOffset;
|
|
72336
72339
|
|
|
72337
72340
|
if (this.ButtonPosition==1)
|
|
72338
72341
|
{
|
|
@@ -72345,7 +72348,7 @@ function ChartDrawHLine()
|
|
|
72345
72348
|
|
|
72346
72349
|
this.Canvas.fillStyle=this.ValueTextColor
|
|
72347
72350
|
this.Canvas.textAlign="left";
|
|
72348
|
-
this.Canvas.textBaseline="
|
|
72351
|
+
this.Canvas.textBaseline="bottom";
|
|
72349
72352
|
this.Canvas.fillText(strValue,xText,yText);
|
|
72350
72353
|
|
|
72351
72354
|
rtDraw.Left=rtBG.Left;
|
|
@@ -166297,7 +166300,7 @@ function HQChartScriptWorker()
|
|
|
166297
166300
|
|
|
166298
166301
|
|
|
166299
166302
|
|
|
166300
|
-
var HQCHART_VERSION="1.1.
|
|
166303
|
+
var HQCHART_VERSION="1.1.15234";
|
|
166301
166304
|
|
|
166302
166305
|
function PrintHQChartVersion()
|
|
166303
166306
|
{
|