hqchart 1.1.15883 → 1.1.15898

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.
@@ -2554,7 +2554,7 @@ this.GetSymbolDecimal=function(){return GetfloatPrecision(this.Symbol);};this.Tr
2554
2554
  this.GetSymbolDecimalV2=function(){var symbol=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.Symbol;if(this.GlobalOption&&this.GlobalOption.DecimalPlaces){var result={Type:0,Decimal:2};var item=this.GlobalOption.DecimalPlaces;if(IFrameSplitOperator.IsPlusNumber(item.Decimal))result.Decimal=item.Decimal;if(IFrameSplitOperator.IsNumber(item.Denominator)){result.Type=1;result.Denominator=item.Denominator;}return result;}else{var dec=GetfloatPrecision(symbol);return{Type:0,Decimal:dec};}};//strDefault 默认值
2555
2555
  this.FormatPriceString=function(value,dec){var strDefault=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";if(!IFrameSplitOperator.IsNumber(value))return strDefault;if(!dec)return"".concat(value);if(dec.Type==1){var intValue=Math.floor(value);//整数
2556
2556
  var floatValue=value-intValue;var decValue=parseInt(floatValue/(1/dec.Denominator));//固定小数位数
2557
- var strDec=decValue.toString();var zeroCount=dec.Decimal-strDec.length;if(zeroCount>0)strDec+='0'.repeat(zeroCount);return"".concat(intValue,"'").concat(strDec);}else{return value.toFixed(dec.Decimal);}};this.GetDecimalPlacesMenu=function(){var decimalPlaces=this.GlobalOption.DecimalPlaces;var decimalMenu={Name:"价格小数位数",SubMenu:[{Name:"默认",Data:{ID:JSCHART_MENU_ID.CMD_SET_DECIMAL_PLACES_ID,Args:[null]},Checked:decimalPlaces===null}]};if(this.DecimalPlacesConfig&&IFrameSplitOperator.IsNonEmptyArray(this.DecimalPlacesConfig.Data)){for(var i=0;i<this.DecimalPlacesConfig.Data.length;++i){var item=this.DecimalPlacesConfig.Data[i];if(!item)continue;var bChecked=false;if(decimalPlaces&&decimalPlaces.ID==item.ID)bChecked=true;decimalMenu.SubMenu.push({Name:item.Name,Data:{ID:JSCHART_MENU_ID.CMD_SET_DECIMAL_PLACES_ID,Args:[item]},Checked:bChecked});}}return decimalMenu;};}function GetDevicePixelRatio(){if(typeof window=='undefined')return 1;return window.devicePixelRatio||1;}function _GetFontHeight(context,font,word){if(!context)return null;if(font)context.font=font;var text='擎';if(IFrameSplitOperator.IsString(word))text=word;var fontInfo=context.measureText(text);var textHeight=fontInfo.fontBoundingBoxAscent+fontInfo.fontBoundingBoxDescent;if(!IFrameSplitOperator.IsNumber(textHeight))textHeight=fontInfo.width+2*GetDevicePixelRatio();return textHeight;}function IsPhoneWeb(){var userAgentInfo=navigator.userAgent;var Agents=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod");for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0)return true;}return false;}function OnKeyDown(e)//键盘事件
2557
+ var strDec=decValue.toString();var zeroCount=dec.Decimal-strDec.length;if(zeroCount>0)strDec='0'.repeat(zeroCount)+strDec;return"".concat(intValue,"'").concat(strDec);}else{return value.toFixed(dec.Decimal);}};this.GetDecimalPlacesMenu=function(){var decimalPlaces=this.GlobalOption.DecimalPlaces;var decimalMenu={Name:"价格小数位数",SubMenu:[{Name:"默认",Data:{ID:JSCHART_MENU_ID.CMD_SET_DECIMAL_PLACES_ID,Args:[null]},Checked:decimalPlaces===null}]};if(this.DecimalPlacesConfig&&IFrameSplitOperator.IsNonEmptyArray(this.DecimalPlacesConfig.Data)){for(var i=0;i<this.DecimalPlacesConfig.Data.length;++i){var item=this.DecimalPlacesConfig.Data[i];if(!item)continue;var bChecked=false;if(decimalPlaces&&decimalPlaces.ID==item.ID)bChecked=true;decimalMenu.SubMenu.push({Name:item.Name,Data:{ID:JSCHART_MENU_ID.CMD_SET_DECIMAL_PLACES_ID,Args:[item]},Checked:bChecked});}}return decimalMenu;};}function GetDevicePixelRatio(){if(typeof window=='undefined')return 1;return window.devicePixelRatio||1;}function _GetFontHeight(context,font,word){if(!context)return null;if(font)context.font=font;var text='擎';if(IFrameSplitOperator.IsString(word))text=word;var fontInfo=context.measureText(text);var textHeight=fontInfo.fontBoundingBoxAscent+fontInfo.fontBoundingBoxDescent;if(!IFrameSplitOperator.IsNumber(textHeight))textHeight=fontInfo.width+2*GetDevicePixelRatio();return textHeight;}function IsPhoneWeb(){var userAgentInfo=navigator.userAgent;var Agents=new Array("Android","iPhone","SymbianOS","Windows Phone","iPad","iPod");for(var v=0;v<Agents.length;v++){if(userAgentInfo.indexOf(Agents[v])>0)return true;}return false;}function OnKeyDown(e)//键盘事件
2558
2558
  {if(this.JSChartContainer&&this.JSChartContainer.OnKeyDown)this.JSChartContainer.OnKeyDown(e);}function OnKeyUp(e)//键盘事件
2559
2559
  {if(this.JSChartContainer&&this.JSChartContainer.OnKeyUp)this.JSChartContainer.OnKeyUp(e);}function OnWheel(e)//上下滚动事件
2560
2560
  {if(this.JSChartContainer&&this.JSChartContainer.OnWheel)this.JSChartContainer.OnWheel(e);}function ToFixed(number,precision){var b=1;if(isNaN(number))return number;if(number<0)b=-1;var multiplier=Math.pow(10,precision);var value=Math.round(Math.abs(number)*multiplier)/multiplier*b;if(/^(\d+(?:\.\d+)?)(e)([\-]?\d+)$/.test(value))var s=value.toFixed2(precision);else var s=value.toString();var rs=s.indexOf('.');if(rs<0&&precision>0){rs=s.length;s+='.';}while(s.length<=rs+precision){s+='0';}return s;}function IsRectOverlap(rt,rt2){if(Math.max(rt.Left,rt2.Left)<Math.min(rt.Right,rt2.Right)&&Math.max(rt.Top,rt2.Top)<Math.min(rt.Bottom,rt2.Bottom))return true;return false;}//获取文字高度和宽度
@@ -3943,18 +3943,19 @@ this.TooltipRect.push([i,rect]);//[0]数据索引 [1]数据区域
3943
3943
  preKItemInfo=kItemInfo;}this.DrawLastPointEvent(ptLast);//通知外部绘制最后一个点
3944
3944
  this.PtMax=ptMax;this.PtMin=ptMin;};this.DrawKBar_Up=function(data,dataWidth,upColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//阳线
3945
3945
  {var isEmptyBar=false;if(drawType==3||drawType==6)isEmptyBar=true;if(dataWidth>=4){if(isEmptyBar){if(dataWidth%2!=0)dataWidth-=1;}this.Canvas.strokeStyle=upColor;if(data.High>data.Close)//上影线
3946
- {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(drawType==3?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yClose));}}this.Canvas.stroke();y=yClose;}else{y=yClose;}this.Canvas.fillStyle=upColor;if(isHScreen){if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
3946
+ {this.Canvas.beginPath();if(isHScreen){if(isEmptyBar){this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yClose),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yClose),ToFixedPoint(x));}}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yHigh));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yClose));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yClose));}}this.Canvas.stroke();y=yClose;}else{y=yClose;}this.Canvas.fillStyle=upColor;if(isHScreen){if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
3947
3947
  }else{if(isEmptyBar)//空心柱
3948
3948
  {this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yOpen-y),ToFixedRect(dataWidth));}}}else{if(Math.abs(yOpen-y)<1){this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1);//高度小于1,统一使用高度1
3949
3949
  }else{if(isEmptyBar)//空心柱
3950
3950
  {this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(y),ToFixedRect(dataWidth),ToFixedRect(yOpen-y));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yOpen)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yOpen-y)));}}}if(data.Open>data.Low)//下影线
3951
- {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(drawType==3?Math.min(yClose,yOpen):y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=upColor;this.Canvas.stroke();}};this.DrawKBar_Down=function(data,dataWidth,downColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//阴线
3951
+ {this.Canvas.beginPath();if(isHScreen){if(isEmptyBar){this.Canvas.moveTo(ToFixedPoint(yOpen),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yOpen));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=upColor;this.Canvas.stroke();}};this.DrawKBar_Down=function(data,dataWidth,downColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//阴线
3952
3952
  {var isEmptyBar=false;if(drawType==6||drawType==20)isEmptyBar=true;if(dataWidth>=4){if(isEmptyBar){if(dataWidth%2!=0)dataWidth-=1;}this.Canvas.strokeStyle=downColor;if(data.High>data.Close)//上影线
3953
- {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yOpen));}}this.Canvas.stroke();y=yOpen;}else{y=yOpen;}this.Canvas.fillStyle=downColor;if(isHScreen){if(Math.abs(yClose-y)<1)this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
3954
- else this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));}else{if(Math.abs(yClose-y)<1){this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1);//高度小于1,统一使用高度1
3953
+ {this.Canvas.beginPath();if(isHScreen){if(isEmptyBar){this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));}}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yHigh));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yOpen));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yOpen));}}this.Canvas.stroke();y=yOpen;}else{y=yOpen;}this.Canvas.fillStyle=downColor;if(isHScreen){if(Math.abs(yClose-y)<1){this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth));//高度小于1,统一使用高度1
3954
+ }else{if(isEmptyBar)//空心柱
3955
+ {this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));}}}else{if(Math.abs(yClose-y)<1){this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(y),ToFixedRect(dataWidth),1);//高度小于1,统一使用高度1
3955
3956
  }else{if(isEmptyBar)//空心柱
3956
3957
  {this.Canvas.beginPath();this.Canvas.rect(ToFixedPoint(left),ToFixedPoint(Math.min(y,yClose)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yClose-y)));this.Canvas.stroke();}else{this.Canvas.fillRect(ToFixedRect(left),ToFixedRect(Math.min(y,yClose)),ToFixedRect(dataWidth),ToFixedRect(Math.abs(yClose-y)));}}}if(data.Open>data.Low)//下影线
3957
- {this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=downColor;this.Canvas.stroke();}};this.DrawKBar_Unchagne=function(data,dataWidth,unchagneColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//平线
3958
+ {this.Canvas.beginPath();if(isHScreen){if(isEmptyBar){this.Canvas.moveTo(ToFixedPoint(yClose),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));}}else{if(isEmptyBar){var xFixed=left+dataWidth/2;this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yClose));this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));}else{this.Canvas.moveTo(ToFixedPoint(x),ToFixedPoint(y));this.Canvas.lineTo(ToFixedPoint(x),ToFixedPoint(yLow));}}this.Canvas.stroke();}}else{this.Canvas.beginPath();if(isHScreen){this.Canvas.moveTo(yHigh,ToFixedPoint(x));this.Canvas.lineTo(yLow,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yHigh);this.Canvas.lineTo(ToFixedPoint(x),yLow);}this.Canvas.strokeStyle=downColor;this.Canvas.stroke();}};this.DrawKBar_Unchagne=function(data,dataWidth,unchagneColor,drawType,x,y,left,right,yLow,yHigh,yOpen,yClose,isHScreen)//平线
3958
3959
  {if(this.UnchangeBarType==1)//十字星颜色
3959
3960
  {unchagneColor=this.GetUnchangeBarColor(data);}if(this.OneLimitBarType===1&&this.IsOneLimitBar(data))//一字板
3960
3961
  {unchagneColor=this.GetOneLimitBarColor(data);}if(dataWidth>=4){if(dataWidth%2!=0)dataWidth-=1;this.Canvas.strokeStyle=unchagneColor;this.Canvas.beginPath();if(data.High>data.Close)//上影线
@@ -4081,8 +4082,8 @@ this.DrawKRange={Start:null,End:null};this.AryPriceGapCache=[];this.AryPredictio
4081
4082
  this.DrawHeatMap();if(!this.IsShow)return;if(this.ChartFrame.IsMinSize&&this.Name=="Self Kline")return;if(ChartData.IsTickPeriod(this.Period))//分笔图
4082
4083
  {this.Canvas.save();if(this.DrawType==1){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseLine();}else if(this.DrawType==4){this.ClipClient(this.ChartFrame.IsHScreen);this.DrawCloseArea();}else{this.ClipTickClient(this.ChartFrame.IsHScreen);this.DrawTick();}this.Canvas.restore();return;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);if(this.DrawType==1){this.DrawCloseLine();this.Canvas.restore();this.DrawPredictionLine();if(this.PriceGap.Enable)this.DrawPriceGap();this.UpdateGlobalLatestPoint();return;}else if(this.DrawType==2){this.DrawAKLine();}else if(this.DrawType==4){this.DrawCloseArea();}else if(this.DrawType==5){this.DrawOrderFlow();}else if(this.DrawType==7){this.DrawOrderFlow_Style2();}else if(this.DrawType==8){this.DrawOrderFlow_Style3();}else if(this.DrawType==9){this.DrawKBar();}else if(this.DrawType==10){this.DrawRenkoCandle();}else if(this.DrawType==12){this.DrawLineBreak();}else if(this.DrawType==13){this.DrawHighLow();}else if(this.DrawType==14){if(this.FFKChart&&this.FFKChart.Draw){this.FFKChart.Draw(this);}}else if(this.DrawType==15){this.DrawHLCArea();}else if(this.DrawType==16){this.DrawKagi();}else if(this.DrawType==17){this.DrawOrderFlow_Style4();}else if(this.DrawType==18){this.DrawOrderFlow_Style5();}else if(this.DrawType==19){this.DrawHLCBars();}else if(this.DrawType==21){this.DrawOrderFlow_Style6();}else{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();if(this.PriceGap.Enable)this.DrawPriceGap();this.Canvas.restore();this.UpdateGlobalLatestPoint();this.DrawPredictionLine();if(this.IsShowMaxMinPrice)//标注最大值最小值
4083
4084
  {if(this.ChartFrame.IsHScreen===true)this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);else this.DrawMaxMinPrice(this.PtMax,this.PtMin);}if(this.DrawType==14)//自定义图形 标注最大最小值
4084
- {if(this.FFKChart&&this.FFKChart.DrawMaxMinPrice){this.FFKChart.DrawMaxMinPrice();}}this.DrawDaySummary();};this.OnFormatHighLowTitle=function(ptMax,ptMin){if(!ptMax||!ptMin)return null;if(!IFrameSplitOperator.IsNumber(ptMax.Value)||!IFrameSplitOperator.IsNumber(ptMin.Value))return null;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//小数位数
4085
- var title={High:ptMax.Value.toFixed(defaultfloatPrecision),Low:ptMin.Value.toFixed(defaultfloatPrecision)};if(!this.GetEventCallback)return title;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_HIGH_LOW_TITLE);if(!event||!event.Callback)return title;var data={Max:ptMax,Min:ptMin,Symbol:this.Symbol,Title:{High:title.High,Low:title.Low},Decimal:defaultfloatPrecision,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault)return data.Title;//使用外部回调的数值
4085
+ {if(this.FFKChart&&this.FFKChart.DrawMaxMinPrice){this.FFKChart.DrawMaxMinPrice();}}this.DrawDaySummary();};this.OnFormatHighLowTitle=function(ptMax,ptMin){if(!ptMax||!ptMin)return null;if(!IFrameSplitOperator.IsNumber(ptMax.Value)||!IFrameSplitOperator.IsNumber(ptMin.Value))return null;if(this.ChartFrame.HQChart){var decConfig=this.ChartFrame.HQChart.GetSymbolDecimalV2(this.Symbol);var title={High:this.HQChart.FormatPriceString(ptMax.Value,decConfig,""),Low:this.HQChart.FormatPriceString(ptMin.Value,decConfig,"")};}else{var defaultfloatPrecision=GetfloatPrecision(this.Symbol);//小数位数
4086
+ var title={High:ptMax.Value.toFixed(defaultfloatPrecision),Low:ptMin.Value.toFixed(defaultfloatPrecision)};}if(!this.GetEventCallback)return title;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_HIGH_LOW_TITLE);if(!event||!event.Callback)return title;var data={Max:ptMax,Min:ptMin,Symbol:this.Symbol,Title:{High:title.High,Low:title.Low},Decimal:defaultfloatPrecision,PreventDefault:false};event.Callback(event,data,this);if(data.PreventDefault)return data.Title;//使用外部回调的数值
4086
4087
  return title;};this.DrawMaxMinPrice=function(ptMax,ptMin){if(ptMax.X==null||ptMax.Y==null||ptMax.Value==null)return;if(ptMin.X==null||ptMin.Y==null||ptMin.Value==null)return;var title=this.OnFormatHighLowTitle(ptMax,ptMin);if(!title)return;var leftArrow=g_JSChartResource.KLine.MaxMin.LeftArrow;var rightArrow=g_JSChartResource.KLine.MaxMin.RightArrow;var highYOffset=g_JSChartResource.KLine.MaxMin.HighYOffset;var lowYOffset=g_JSChartResource.KLine.MaxMin.LowYOffset;var defaultfloatPrecision=GetfloatPrecision(this.Symbol);this.Canvas.font=this.TextFont;var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();var ptTop=ptMax;var text=title.High;var textColor=this.TextColor;if(this.ChartFrame.CoordinateType==1)//反转坐标
4087
4088
  {if(ptMax.Y<ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='top';var text=title.Low;if(title.LowColor)textColor=title.LowColor;}else{if(ptMax.Y>ptMin.Y)ptTop=ptMin;this.Canvas.textBaseline='bottom';if(title.HighColor)textColor=title.HighColor;}this.Canvas.fillStyle=textColor;this.Canvas.textAlign=ptTop.Align;var left=ptTop.Align=='left'?ptTop.X:ptTop.X;if(IFrameSplitOperator.IsNumber(highYOffset))ptTop.Y+=highYOffset;//var text=ptTop.Value.toFixed(defaultfloatPrecision);
4088
4089
  if(ptTop.Align=='left')text=leftArrow+text;else text=text+rightArrow;if(ptTop.Y>top-2){var textSize=GetTextSize(this.Canvas,text);var textWidth=textSize.Width;var textHeight=textSize.Height;if(this.ChartFrame.CoordinateType==1)//反转坐标
@@ -8180,11 +8181,11 @@ if(!this.ChartCorssCursor||!this.ChartCorssCursor.IsShowCorss||this.ChartCorssCu
8180
8181
  this.GetKLineChart=function(){if(!this.ChartPaint[0])return null;return this.ChartPaint[0];};//创建子窗口
8181
8182
  this.CreateChildWindow=function(windowCount){var _this24=this;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=g_ChartFrameFactory.Create("KLineFrame",{ID:i});frame.Canvas=this.Canvas;frame.GetExtraCanvas=function(name){return _this24.GetExtraCanvas(name);};frame.ChartBorder=border;frame.Identify=i;//窗口序号
8182
8183
  frame.RightSpaceCount=this.RightSpaceCount;//右边
8183
- frame.GetEventCallback=function(id){return _this24.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.CreateDivFrameToolbar(this,i,this.UIElement.parentNode);frame.CreateLockPaint();frame.HorizontalMax=20;frame.HorizontalMin=10;if(i==0){frame.YSplitOperator=new FrameSplitKLinePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this24.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this24.GetKLineChart();};frame.YSplitOperator.HQChart=this;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
8184
+ frame.GetEventCallback=function(id){return _this24.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.CreateDivFrameToolbar(this,i,this.UIElement.parentNode);frame.CreateLockPaint();frame.HQChart=this;frame.HorizontalMax=20;frame.HorizontalMin=10;if(i==0){frame.YSplitOperator=new FrameSplitKLinePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this24.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this24.GetKLineChart();};frame.YSplitOperator.HQChart=this;var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
8184
8185
  border.BottomSpace=15*pixelTatio;//主图上下留空间
8185
8186
  border.TopSpace=15*pixelTatio;frame.GetEventCallback=function(id){return _this24.GetEventCallback(id);};}else{frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.GetEventCallback=function(id){return _this24.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this24.GetKLineChart();};frame.YSplitOperator.HQChart=this;//frame.IsLocked = true;
8186
8187
  }frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitKLineX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.LanguageID=this.LanguageID;frame.XSplitOperator.GetEventCallback=function(id){return _this24.GetEventCallback(id);};if(i!=windowCount-1)frame.XSplitOperator.ShowText=false;for(var j=frame.HorizontalMin;j<=frame.HorizontalMax;j+=1){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=j;if(i==0&&j==frame.HorizontalMin)continue;frame.HorizontalInfo[j].Message[1]=j.toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;if(i==0)subFrame.Height=20;else subFrame.Height=10;this.Frame.SubFrame[i]=subFrame;if(event&&event.Callback){var sendData={SubFrame:this.Frame.SubFrame[i],WindowIndex:i};event.Callback(event,sendData,this);}}};this.CreateSubFrameItem=function(id){var _this25=this;var border=new ChartBorder();border.UIElement=this.UIElement;var frameClassName="KLineFrame";if(this.ClassName=="KLineChartHScreenContainer")frameClassName="KLineHScreenFrame";var frame=g_ChartFrameFactory.Create(frameClassName,{ID:id});frame.Canvas=this.Canvas;frame.GetExtraCanvas=function(name){return _this25.GetExtraCanvas(name);};frame.ChartBorder=border;frame.Identify=id;//窗口序号
8187
- frame.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.HorizontalMax=20;frame.HorizontalMin=10;frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitKLineX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.ShowText=false;frame.XSplitOperator.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.YSplitOperator.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this25.GetKLineChart();};frame.YSplitOperator.HQChart=this;frame.XSplitOperator.Symbol=this.Symbol;frame.XSplitOperator.Period=this.Period;frame.CreateDivFrameToolbar(this,id,this.UIElement.parentNode);frame.CreateLockPaint();//K线数据绑定
8188
+ frame.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.HorizontalMax=20;frame.HorizontalMin=10;frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitKLineX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.ShowText=false;frame.XSplitOperator.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.YSplitOperator.GetEventCallback=function(id){return _this25.GetEventCallback(id);};frame.YSplitOperator.GetKLineChartCallback=function(){return _this25.GetKLineChart();};frame.YSplitOperator.HQChart=this;frame.XSplitOperator.Symbol=this.Symbol;frame.XSplitOperator.Period=this.Period;frame.CreateDivFrameToolbar(this,id,this.UIElement.parentNode);frame.CreateLockPaint();frame.HQChart=this;//K线数据绑定
8188
8189
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;frame.XPointCount=xPointCouont;frame.Data=this.ChartPaint[0].Data;for(var j=frame.HorizontalMin;j<=frame.HorizontalMax;j+=1){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=j;frame.HorizontalInfo[j].Message[1]=j.toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;subFrame.Height=10;var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CREATE_FRAME);if(event&&event.Callback){var sendData={SubFrame:subFrame,WindowIndex:id};event.Callback(event,sendData,this);}return subFrame;};//创建主图K线画法
8189
8190
  this.CreateMainKLine=function(){var _this26=this;var kline=g_ChartPaintFactory.Create("ChartKLine");kline.Canvas=this.Canvas;kline.ChartBorder=this.Frame.SubFrame[0].Frame.ChartBorder;kline.ChartFrame=this.Frame.SubFrame[0].Frame;kline.Name="Main-KLine";kline.DrawType=this.KLineDrawType;kline.Identify="Main-KLine";kline.HQChart=this;kline.GetEventCallback=function(id){return _this26.GetEventCallback(id);};this.ChartPaint[0]=kline;this.TitlePaint[0]=new DynamicKLineTitlePainting();this.TitlePaint[0].Frame=this.Frame.SubFrame[0].Frame;this.TitlePaint[0].Canvas=this.Canvas;this.TitlePaint[0].OverlayChartPaint=this.OverlayChartPaint;//绑定叠加
8190
8191
  this.TitlePaint[0].LanguageID=this.LanguageID;this.TitlePaint[0].HQChart=this;this.TitlePaint[0].GetEventCallback=function(id){return _this26.GetEventCallback(id);};};this.BindKLineBreakPoint=function(data){var klineChart=this.ChartPaint[0];if(!klineChart)return;if(!IFrameSplitOperator.IsNonEmptyArray(data.AryBreakPoint))return;klineChart.AryBreakPoint=data.AryBreakPoint.slice();};//绑定主图K线数据
@@ -10002,7 +10003,7 @@ this.ChartSplashPaint.Frame=this.Frame;this.CreateChildWindow(windowCount);this.
10002
10003
  for(var i in this.Frame.SubFrame){var titlePaint=new DynamicChartTitlePainting();titlePaint.Frame=this.Frame.SubFrame[i].Frame;titlePaint.Canvas=this.Canvas;titlePaint.LanguageID=this.LanguageID;titlePaint.GetEventCallback=function(id){return _this42.GetEventCallback(id);};titlePaint.GetSymbolDecimalCallback=function(){return _this42.GetSymbolDecimal();};titlePaint.SelectedChart=this.SelectedChart;titlePaint.HQChart=this;this.TitlePaint.push(titlePaint);}this.AddDefaultEventListener({KeyDown:true,Wheel:false});};//创建子窗口
10003
10004
  this.CreateChildWindow=function(windowCount){var _this43=this;for(var i=0;i<windowCount;++i){var border=new ChartBorder();border.UIElement=this.UIElement;var frame=g_ChartFrameFactory.Create("KLineHScreenFrame",{ID:i});frame.Canvas=this.Canvas;frame.GetExtraCanvas=function(name){return _this43.GetExtraCanvas(name);};frame.ChartBorder=border;frame.Identify=i;//窗口序号
10004
10005
  frame.RightSpaceCount=this.RightSpaceCount;//右边
10005
- frame.GetEventCallback=function(id){return _this43.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.CreateLockPaint();frame.HorizontalMax=20;frame.HorizontalMin=10;if(i==0){frame.YSplitOperator=new FrameSplitKLinePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this43.GetEventCallback(id);};frame.YSplitOperator.HQChart=this;//主图上下间距
10006
+ frame.GetEventCallback=function(id){return _this43.GetEventCallback(id);};frame.GlobalOption=this.GlobalOption;frame.CreateLockPaint();frame.HQChart=this;frame.HorizontalMax=20;frame.HorizontalMin=10;if(i==0){frame.YSplitOperator=new FrameSplitKLinePriceY();frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('price');frame.YSplitOperator.FrameSplitData2=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this43.GetEventCallback(id);};frame.YSplitOperator.HQChart=this;//主图上下间距
10006
10007
  var pixelTatio=GetDevicePixelRatio();//获取设备的分辨率
10007
10008
  border.TopSpace=12*pixelTatio;border.BottomSpace=12*pixelTatio;}else{frame.YSplitOperator=new FrameSplitY();frame.YSplitOperator.LanguageID=this.LanguageID;frame.YSplitOperator.FrameSplitData=this.FrameSplitData.get('double');frame.YSplitOperator.GetEventCallback=function(id){return _this43.GetEventCallback(id);};frame.YSplitOperator.HQChart=this;//frame.IsLocked = true;
10008
10009
  }frame.YSplitOperator.Frame=frame;frame.YSplitOperator.ChartBorder=border;frame.XSplitOperator=new FrameSplitKLineX();frame.XSplitOperator.Frame=frame;frame.XSplitOperator.ChartBorder=border;frame.XSplitOperator.GetEventCallback=function(id){return _this43.GetEventCallback(id);};if(i!=windowCount-1)frame.XSplitOperator.ShowText=false;for(var j=frame.HorizontalMin;j<=frame.HorizontalMax;j+=1){frame.HorizontalInfo[j]=new CoordinateInfo();frame.HorizontalInfo[j].Value=j;if(i==0&&j==frame.HorizontalMin)continue;frame.HorizontalInfo[j].Message[1]=j.toString();frame.HorizontalInfo[j].Font="14px 微软雅黑";}var subFrame=new SubFrameItem();frame.FrameData.SubFrameItem=subFrame;subFrame.Frame=frame;if(i==0)subFrame.Height=20;else subFrame.Height=10;this.Frame.SubFrame[i]=subFrame;}};this.CreateStockChipPhone=function(option){var chart=new StockChipPhone();chart.Canvas=this.Canvas;chart.ChartBorder=this.Frame.ChartBorder;chart.ChartFrame=this.Frame;chart.HQChart=this;chart.Left=this.Frame.ChartBorder.Bottom;//左边间距使用当前框架间距
@@ -16783,7 +16784,7 @@ if(dayItem.Text){var textWidth=this.Canvas.measureText(dayItem.Text).width;xText
16783
16784
  {yCell=rtCell.Bottom;xCell=left;}++j;}}},{key:"DrawMarkDay",value:function DrawMarkDay(dayItem,markItem,rtCell,yText){var config=this.MarkDayConfig;var radius=config.Dots.Radius;var yOffset=config.Dots.YOffset;var color=config.Dots.Color;if(markItem.Color)color=markItem.Color;if(IFrameSplitOperator.IsNumber(markItem.YOffset))yOffset=markItem.YOffset;if(IFrameSplitOperator.IsNumber(markItem.Radius))radius=markItem.Radius;var x=rtCell.Left+rtCell.Width/2;var y=yText+yOffset;this.Canvas.fillStyle=color;this.Canvas.beginPath();this.Canvas.arc(x,y,radius,0,Math.PI*2);this.Canvas.fill();}},{key:"PtInCell",value:function PtInCell(x,y){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryCellRect))return null;for(var i=0;i<this.AryCellRect.length;++i){var item=this.AryCellRect[i];var rtCell=item.Rect;if(x>=rtCell.Left&&x<=rtCell.Right&&y>=rtCell.Top&&y<=rtCell.Bottom){var data={Rect:rtCell,Type:item.Type,Data:item.Data};return data;}}return null;}},{key:"OnMouseOn",value:function OnMouseOn(x,y,e){var pixelTatio=GetDevicePixelRatio();var insidePoint={X:x/pixelTatio,Y:y/pixelTatio};var uiElement;if(this.UIElement)uiElement={Left:this.UIElement.getBoundingClientRect().left,Top:this.UIElement.getBoundingClientRect().top};else uiElement={Left:null,Top:null};var bDraw=false;var cell=this.PtInCell(x,y);if(cell){bDraw=false;var selData=this.MoveOnData.Data;if(selData&&cell.Type==selData.Type){if(cell.Type===JSCHART_CALENDAR_BUTTON_ID.DAY_CELL_ID||cell.Type===JSCHART_CALENDAR_BUTTON_ID.MONTH_CELL_ID){if(cell.Data.Date!=selData.Data.Date){this.MoveOnData.Data={Type:cell.Type,Data:cell.Data};bDraw=true;}}}else{this.MoveOnData.Data={Type:cell.Type,Data:cell.Data};bDraw=true;}return{Redraw:bDraw,Cell:cell};}if(this.MoveOnData.Data){this.MoveOnData.Data=null;bDraw=true;}return{Redraw:bDraw,Cell:null};}},{key:"OnMouseDown",value:function OnMouseDown(x,y,e){var cell=this.PtInCell(x,y);if(!cell)return null;var bDraw=false;return{Type:cell.Type,Redraw:bDraw,Data:cell.Data};}},{key:"SetSelectedDay",value:function SetSelectedDay(aryData){this.ArySelectedDay=[];if(IFrameSplitOperator.IsNonEmptyArray(aryData))this.ArySelectedDay=aryData.slice();}}]);}();/********************************************************************************
16784
16785
  * 版本信息输出
16785
16786
  *
16786
- */var HQCHART_VERSION="1.1.15882";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: ".concat(HQCHART_VERSION," \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ");console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
16787
+ */var HQCHART_VERSION="1.1.15897";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: ".concat(HQCHART_VERSION," \n* License: Apache License 2.0 \n* Source: https://github.com/jones2000/HQChart\n*\n************************************************************************************************************************************************************************** \n ");console.log(logo);}PrintHQChartVersion();//把给外界调用的方法暴露出来
16787
16788
  var _default=exports["default"]=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
16788
16789
  // BaseIndex:BaseIndex,
16789
16790
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.15883",
3
+ "version": "1.1.15898",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -17617,7 +17617,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
17617
17617
  //固定小数位数
17618
17618
  var strDec=decValue.toString();
17619
17619
  var zeroCount = dec.Decimal - strDec.length;
17620
- if (zeroCount > 0) strDec += '0'.repeat(zeroCount);
17620
+ if (zeroCount > 0) strDec= '0'.repeat(zeroCount)+strDec;
17621
17621
 
17622
17622
  return `${intValue}'${strDec}`;
17623
17623
  }
@@ -34144,16 +34144,25 @@ function ChartKLine()
34144
34144
  this.Canvas.beginPath();
34145
34145
  if (isHScreen)
34146
34146
  {
34147
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34148
- this.Canvas.lineTo(ToFixedPoint(drawType==3?Math.max(yClose,yOpen):yClose),ToFixedPoint(x));
34147
+ if (isEmptyBar)
34148
+ {
34149
+ this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));
34150
+ this.Canvas.lineTo(ToFixedPoint(yClose),ToFixedPoint(x));
34151
+ }
34152
+ else
34153
+ {
34154
+ this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34155
+ this.Canvas.lineTo(ToFixedPoint(yClose),ToFixedPoint(x));
34156
+ }
34157
+
34149
34158
  }
34150
34159
  else
34151
34160
  {
34152
34161
  if (isEmptyBar)
34153
34162
  {
34154
34163
  var xFixed=left+dataWidth/2;
34155
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
34156
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
34164
+ this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yHigh));
34165
+ this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yClose));
34157
34166
  }
34158
34167
  else
34159
34168
  {
@@ -34217,15 +34226,24 @@ function ChartKLine()
34217
34226
  this.Canvas.beginPath();
34218
34227
  if (isHScreen)
34219
34228
  {
34220
- this.Canvas.moveTo(ToFixedPoint(drawType==3?Math.min(yClose,yOpen):y),ToFixedPoint(x));
34221
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34229
+ if (isEmptyBar)
34230
+ {
34231
+ this.Canvas.moveTo(ToFixedPoint(yOpen),ToFixedPoint(x));
34232
+ this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34233
+ }
34234
+ else
34235
+ {
34236
+ this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34237
+ this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34238
+ }
34239
+
34222
34240
  }
34223
34241
  else
34224
34242
  {
34225
34243
  if (isEmptyBar)
34226
34244
  {
34227
34245
  var xFixed=left+dataWidth/2;
34228
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
34246
+ this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yOpen));
34229
34247
  this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
34230
34248
  }
34231
34249
  else
@@ -34274,16 +34292,25 @@ function ChartKLine()
34274
34292
  this.Canvas.beginPath();
34275
34293
  if (isHScreen)
34276
34294
  {
34277
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34278
- this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));
34295
+ if (isEmptyBar)
34296
+ {
34297
+ this.Canvas.moveTo(ToFixedPoint(yHigh),ToFixedPoint(x));
34298
+ this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));
34299
+ }
34300
+ else
34301
+ {
34302
+ this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34303
+ this.Canvas.lineTo(ToFixedPoint(yOpen),ToFixedPoint(x));
34304
+ }
34305
+
34279
34306
  }
34280
34307
  else
34281
34308
  {
34282
34309
  if (isEmptyBar)
34283
34310
  {
34284
34311
  var xFixed=left+dataWidth/2;
34285
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(y));
34286
- this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(Math.min(yClose,yOpen)));
34312
+ this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yHigh));
34313
+ this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yOpen));
34287
34314
  }
34288
34315
  else
34289
34316
  {
@@ -34302,8 +34329,23 @@ function ChartKLine()
34302
34329
  this.Canvas.fillStyle=downColor;
34303
34330
  if (isHScreen)
34304
34331
  {
34305
- if (Math.abs(yClose-y)<1) this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
34306
- else this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));
34332
+ if (Math.abs(yClose-y)<1)
34333
+ {
34334
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),1,ToFixedRect(dataWidth)); //高度小于1,统一使用高度1
34335
+ }
34336
+ else
34337
+ {
34338
+ if (isEmptyBar) //空心柱
34339
+ {
34340
+ this.Canvas.beginPath();
34341
+ this.Canvas.rect(ToFixedPoint(y),ToFixedPoint(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));
34342
+ this.Canvas.stroke();
34343
+ }
34344
+ else
34345
+ {
34346
+ this.Canvas.fillRect(ToFixedRect(y),ToFixedRect(left),ToFixedRect(yClose-y),ToFixedRect(dataWidth));
34347
+ }
34348
+ }
34307
34349
  }
34308
34350
  else
34309
34351
  {
@@ -34332,15 +34374,23 @@ function ChartKLine()
34332
34374
  this.Canvas.beginPath();
34333
34375
  if (isHScreen)
34334
34376
  {
34335
- this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34336
- this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34377
+ if (isEmptyBar)
34378
+ {
34379
+ this.Canvas.moveTo(ToFixedPoint(yClose),ToFixedPoint(x));
34380
+ this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34381
+ }
34382
+ else
34383
+ {
34384
+ this.Canvas.moveTo(ToFixedPoint(y),ToFixedPoint(x));
34385
+ this.Canvas.lineTo(ToFixedPoint(yLow),ToFixedPoint(x));
34386
+ }
34337
34387
  }
34338
34388
  else
34339
34389
  {
34340
34390
  if (isEmptyBar)
34341
34391
  {
34342
34392
  var xFixed=left+dataWidth/2;
34343
- this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(Math.max(yClose,yOpen)));
34393
+ this.Canvas.moveTo(ToFixedPoint(xFixed),ToFixedPoint(yClose));
34344
34394
  this.Canvas.lineTo(ToFixedPoint(xFixed),ToFixedPoint(yLow));
34345
34395
  }
34346
34396
  else
@@ -36056,12 +36106,24 @@ function ChartKLine()
36056
36106
  if (!ptMax || !ptMin) return null;
36057
36107
  if (!IFrameSplitOperator.IsNumber(ptMax.Value) || !IFrameSplitOperator.IsNumber(ptMin.Value)) return null;
36058
36108
 
36059
- var defaultfloatPrecision=GetfloatPrecision(this.Symbol); //小数位数
36060
- var title=
36061
- {
36062
- High:ptMax.Value.toFixed(defaultfloatPrecision),
36063
- Low:ptMin.Value.toFixed(defaultfloatPrecision)
36064
- };
36109
+ if (this.ChartFrame.HQChart)
36110
+ {
36111
+ var decConfig=this.ChartFrame.HQChart.GetSymbolDecimalV2(this.Symbol);
36112
+ var title=
36113
+ {
36114
+ High:this.HQChart.FormatPriceString(ptMax.Value, decConfig, ""),
36115
+ Low:this.HQChart.FormatPriceString(ptMin.Value, decConfig, ""),
36116
+ };
36117
+ }
36118
+ else
36119
+ {
36120
+ var defaultfloatPrecision=GetfloatPrecision(this.Symbol); //小数位数
36121
+ var title=
36122
+ {
36123
+ High:ptMax.Value.toFixed(defaultfloatPrecision),
36124
+ Low:ptMin.Value.toFixed(defaultfloatPrecision)
36125
+ };
36126
+ }
36065
36127
 
36066
36128
  if (!this.GetEventCallback) return title;
36067
36129
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_HIGH_LOW_TITLE);
@@ -61337,7 +61399,6 @@ function FrameButtomToolbarPaint()
61337
61399
  var item=this.AryRButton[i];
61338
61400
  if (!item.Title && !(item.SVGButton && item.SVGButton.Symbol)) continue;
61339
61401
 
61340
-
61341
61402
  var textWidth=0;
61342
61403
  if (item.Title)
61343
61404
  {
@@ -91619,6 +91680,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91619
91680
  frame.GlobalOption=this.GlobalOption;
91620
91681
  frame.CreateDivFrameToolbar(this, i, this.UIElement.parentNode);
91621
91682
  frame.CreateLockPaint();
91683
+ frame.HQChart=this;
91622
91684
 
91623
91685
  frame.HorizontalMax=20;
91624
91686
  frame.HorizontalMin=10;
@@ -91721,6 +91783,7 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
91721
91783
  frame.XSplitOperator.Period=this.Period;
91722
91784
  frame.CreateDivFrameToolbar(this, id, this.UIElement.parentNode);
91723
91785
  frame.CreateLockPaint();
91786
+ frame.HQChart=this;
91724
91787
 
91725
91788
  //K线数据绑定
91726
91789
  var xPointCouont=this.Frame.SubFrame[0].Frame.XPointCount;
@@ -108113,6 +108176,7 @@ function KLineChartHScreenContainer(uielement)
108113
108176
  frame.GetEventCallback=(id)=> { return this.GetEventCallback(id); };
108114
108177
  frame.GlobalOption=this.GlobalOption;
108115
108178
  frame.CreateLockPaint();
108179
+ frame.HQChart=this;
108116
108180
 
108117
108181
  frame.HorizontalMax=20;
108118
108182
  frame.HorizontalMin=10;
@@ -178076,7 +178140,7 @@ function ChartScrollText()
178076
178140
 
178077
178141
 
178078
178142
 
178079
- var HQCHART_VERSION="1.1.15882";
178143
+ var HQCHART_VERSION="1.1.15897";
178080
178144
 
178081
178145
  function PrintHQChartVersion()
178082
178146
  {