hqchart 1.1.14853 → 1.1.14855

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.
@@ -1214,7 +1214,7 @@ var scriptData=new JSIndexScript();if(option.ColorIndex)//五彩K线
1214
1214
  {var apiItem=item.API;chart.WindowIndex[i]=new APIScriptIndex(apiItem.Name,apiItem.Script,apiItem.Args,item);}else{var indexItem=JSIndexMap.Get(item.Index);if(indexItem){chart.WindowIndex[i]=indexItem.Create(item.Option);if(chart.WindowIndex[i].SetArgs)chart.WindowIndex[i].SetArgs(item.Args);chart.CreateWindowIndex(i);}else{var scriptData=new JSIndexScript();var _indexInfo2=scriptData.Get(item.Index);if(!_indexInfo2)continue;JSIndexScript.ModifyAttribute(_indexInfo2,item);_indexInfo2.ID=item.Index;chart.WindowIndex[i]=new ScriptIndex(_indexInfo2.Name,_indexInfo2.Script,_indexInfo2.Args,_indexInfo2);//脚本执行
1215
1215
  if(item.StringFormat>0)chart.WindowIndex[i].StringFormat=item.StringFormat;if(item.FloatPrecision>=0)chart.WindowIndex[i].FloatPrecision=item.FloatPrecision;}}var frame=chart.Frame.SubFrame[i].Frame;if(IFrameSplitOperator.IsBool(item.Modify))frame.ModifyIndex=item.Modify;if(IFrameSplitOperator.IsBool(item.Change))frame.ChangeIndex=item.Change;if(IFrameSplitOperator.IsBool(item.Close))frame.CloseIndex=item.Close;if(IFrameSplitOperator.IsBool(item.Overlay))frame.OverlayIndex=item.Overlay;if(IFrameSplitOperator.IsBool(item.Export))frame.ExportData=item.Export;if(IFrameSplitOperator.IsBool(item.MaxMin))chart.Frame.SubFrame[i].Frame.MaxMinWindow=item.MaxMin;if(IFrameSplitOperator.IsBool(item.TitleWindow))chart.Frame.SubFrame[i].Frame.TitleWindow=item.TitleWindow;if(IFrameSplitOperator.IsBool(item.AddIndexWindow))frame.AddIndexWindow=item.AddIndexWindow;if(item.IsDrawTitleBG==true)chart.Frame.SubFrame[i].Frame.IsDrawTitleBG=item.IsDrawTitleBG;if(IFrameSplitOperator.IsBool(item.IsShowNameArrow))chart.Frame.SubFrame[i].Frame.IsShowNameArrow=item.IsShowNameArrow;if(IFrameSplitOperator.IsNumber(item.TitleHeight))chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight=item.TitleHeight;else item.TitleHeight=chart.Frame.SubFrame[i].Frame.ChartBorder.TitleHeight;if(IFrameSplitOperator.IsBool(item.IsShowTitleArrow))frame.IsShowTitleArrow=item.IsShowTitleArrow;if(IFrameSplitOperator.IsNumber(item.TitleArrowType))frame.TitleArrowType=item.TitleArrowType;if(item.IsShowIndexName==false)chart.Frame.SubFrame[i].Frame.IsShowIndexName=false;if(item.IsShowOverlayIndexName==false)chart.Frame.SubFrame[i].Frame.IsShowOverlayIndexName=false;if(IFrameSplitOperator.IsNumber(item.IndexParamSpace))chart.Frame.SubFrame[i].Frame.IndexParamSpace=item.IndexParamSpace;if(IFrameSplitOperator.IsNumber(item.IndexTitleSpace))chart.Frame.SubFrame[i].Frame.IndexTitleSpace=item.IndexTitleSpace;if(!IFrameSplitOperator.IsUndefined(item.HorizontalReserved))frame.HorizontalReserved=item.HorizontalReserved;if(item.OverlayIndexType){if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.Position))chart.Frame.SubFrame[i].Frame.OverlayIndexType.Position=item.OverlayIndexType.Position;if(IFrameSplitOperator.IsNumber(item.OverlayIndexType.LineSpace))chart.Frame.SubFrame[i].Frame.OverlayIndexType.LineSpace=item.OverlayIndexType.LineSpace;}}//叠加指标宽度
1216
1216
  if(option.OverlayIndexFrameWidth>40)chart.Frame.FixedRightWidth.Overlay=option.OverlayIndexFrameWidth;//叠加指标
1217
- if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Windows>=chart.Frame.SubFrame.length)continue;var itemString=(0,_stringify2.default)(item);var obj=JSON.parse(itemString);if(item.Index)obj.IndexName=item.Index;if(item.Windows>=0)obj.WindowIndex=item.Windows;chart.CreateOverlayWindowsIndex(obj);}}this.AdjustTitleHeight(chart);return chart;};//自定义指数历史K线图
1217
+ if(IFrameSplitOperator.IsNonEmptyArray(option.OverlayIndex)){for(var i=0;i<option.OverlayIndex.length;++i){var item=option.OverlayIndex[i];if(item.Windows>=chart.Frame.SubFrame.length)continue;var itemString=(0,_stringify2.default)(item);var obj=JSON.parse(itemString);if(item.Index)obj.IndexName=item.Index;if(item.Windows>=0)obj.WindowIndex=item.Windows;chart.CreateOverlayWindowsIndex(obj);}}this.AdjustTitleHeight(chart);if(option.LatestPointFlash){var item=option.LatestPointFlash;if(item.Enable){this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey,{ZIndex:6});chart.CreateExtendChart("LatestPointFlashPaint",item);chart.StartLatestPointFlash();}}return chart;};//自定义指数历史K线图
1218
1218
  this.CreateCustomKLineChartContainer=function(option){var chart=new CustomKLineChartContainer(this.CanvasElement);//右键菜单
1219
1219
  if(IFrameSplitOperator.IsBool(option.IsShowRightMenu))chart.IsShowRightMenu=option.IsShowRightMenu;if(option.KLine)//k线图的属性设置
1220
1220
  {if(option.KLine.DragMode>=0)chart.DragMode=option.KLine.DragMode;if(option.KLine.Right>=0)chart.Right=option.KLine.Right;if(option.KLine.Period>=0)chart.Period=option.KLine.Period;if(option.KLine.MaxRequestDataCount>0)chart.MaxRequestDataCount=option.KLine.MaxRequestDataCount;if(option.KLine.Info&&option.KLine.Info.length>0)chart.SetKLineInfo(option.KLine.Info,false);if(option.KLine.PageSize>0)chart.PageSize=option.KLine.PageSize;if(option.KLine.IsShowTooltip==false)chart.IsShowTooltip=false;}if(option.CustomStock)chart.CustomStock=option.CustomStock;if(option.QueryDate)chart.QueryDate=option.QueryDate;if(!option.Windows||option.Windows.length<=0)return null;//创建子窗口
@@ -3748,7 +3748,8 @@ this.ChartHeatMap;//=new ChartHeatMap();
3748
3748
  this.PriceGap={Enable:false,Count:1};this.PriceGapStyple={Line:{Color:g_JSChartResource.PriceGapStyple.Line.Color},Text:{Color:g_JSChartResource.PriceGapStyple.Text.Color,Font:g_JSChartResource.PriceGapStyple.Text.Font}};this.AryPriceGapCache=[];//缺口数据 { }
3749
3749
  //面积图和收盘价线 断开点
3750
3750
  this.AryBreakPoint;//天数统计
3751
- this.DaySummary={MapDate:new _map2.default(),Enable:false};this.DaySummaryConfig={Font:g_JSChartResource.DaySummaryKLine.Font,TextColor:g_JSChartResource.DaySummaryKLine.TextColor,LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin};this.AddToDaySummary=function(kItem){if(!this.DaySummary.Enable)return false;if(!kItem)return false;if(!IFrameSplitOperator.IsPlusNumber(kItem.Date))return false;if(this.DaySummary.MapDate.has(kItem.Date))return false;this.DaySummary.MapDate.set(kItem.Date,{Date:kItem.Date});};this.ClearDaySummary=function(){this.DaySummary.MapDate.clear();};this.BuildDateTimeKey=function(item){if(!item)return null;if(!IFrameSplitOperator.IsNumber(item.Time))return''+item.Date;return item.Date+'-'+item.Time;};this.BuildBreakPoint=function(){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryBreakPoint))return null;var mapBreakPoint=new _map2.default();for(var i=0;i<this.AryBreakPoint.length;++i){var item=this.AryBreakPoint[i];var key=this.BuildDateTimeKey(item);if(key)mapBreakPoint.set(key,item);}return mapBreakPoint;};this.ReloadResource=function(resource){this.TextFont=g_JSChartResource.KLine.MaxMin.Font;this.TextColor=g_JSChartResource.KLine.MaxMin.Color;this.CloseLineColor=g_JSChartResource.CloseLineColor;this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;this.CloseLineWidth=g_JSChartResource.CloseLineWidth;this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.UnchagneColor=g_JSChartResource.UnchagneBarColor;//平盘
3751
+ this.DaySummary={MapDate:new _map2.default(),Enable:false};this.DaySummaryConfig={Font:g_JSChartResource.DaySummaryKLine.Font,TextColor:g_JSChartResource.DaySummaryKLine.TextColor,LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin};this.LastPoint={};//最后一个点的信息 {X, Y, KItem:, Date:, Time: }
3752
+ this.AddToDaySummary=function(kItem){if(!this.DaySummary.Enable)return false;if(!kItem)return false;if(!IFrameSplitOperator.IsPlusNumber(kItem.Date))return false;if(this.DaySummary.MapDate.has(kItem.Date))return false;this.DaySummary.MapDate.set(kItem.Date,{Date:kItem.Date});};this.ClearDaySummary=function(){this.DaySummary.MapDate.clear();};this.BuildDateTimeKey=function(item){if(!item)return null;if(!IFrameSplitOperator.IsNumber(item.Time))return''+item.Date;return item.Date+'-'+item.Time;};this.BuildBreakPoint=function(){if(!IFrameSplitOperator.IsNonEmptyArray(this.AryBreakPoint))return null;var mapBreakPoint=new _map2.default();for(var i=0;i<this.AryBreakPoint.length;++i){var item=this.AryBreakPoint[i];var key=this.BuildDateTimeKey(item);if(key)mapBreakPoint.set(key,item);}return mapBreakPoint;};this.ReloadResource=function(resource){this.TextFont=g_JSChartResource.KLine.MaxMin.Font;this.TextColor=g_JSChartResource.KLine.MaxMin.Color;this.CloseLineColor=g_JSChartResource.CloseLineColor;this.CloseLineAreaColor=g_JSChartResource.CloseLineAreaColor;this.CloseLineWidth=g_JSChartResource.CloseLineWidth;this.UpColor=g_JSChartResource.UpBarColor;this.DownColor=g_JSChartResource.DownBarColor;this.UnchagneColor=g_JSChartResource.UnchagneBarColor;//平盘
3752
3753
  this.HighLowBarColor=g_JSChartResource.HighLowBarColor;this.OrderFlow.UpColor={BG:g_JSChartResource.OrderFlow.UpColor.BG,Border:g_JSChartResource.OrderFlow.UpColor.Border};this.OrderFlow.DownColor={BG:g_JSChartResource.OrderFlow.DownColor.BG,Border:g_JSChartResource.OrderFlow.DownColor.Border};this.OrderFlow.UnchagneColor={BG:g_JSChartResource.OrderFlow.UnchagneColor.BG,Border:g_JSChartResource.OrderFlow.UnchagneColor.Border};this.OrderFlow.Text={Color:g_JSChartResource.OrderFlow.Text.Color,Family:g_JSChartResource.OrderFlow.Text.Family,FontMaxSize:g_JSChartResource.OrderFlow.Text.FontMaxSize,MaxValue:g_JSChartResource.OrderFlow.Text.MaxValue};this.OrderFlow.Line={UpDownColor:g_JSChartResource.OrderFlow.Line.UpDownColor,MiddleColor:g_JSChartResource.OrderFlow.Line.MiddleColor};this.PredictionConfig.Line={Color:g_JSChartResource.PredictionKLine.Line.Color,LineDash:g_JSChartResource.PredictionKLine.Line.LineDash,LineWidth:g_JSChartResource.PredictionKLine.Line.LineWidth};this.PredictionConfig.Bar={UpColor:g_JSChartResource.PredictionKLine.Bar.UpColor,DownColor:g_JSChartResource.PredictionKLine.Bar.DownColor,UnchangeColor:g_JSChartResource.PredictionKLine.Bar.UnchangeColor,DrawType:g_JSChartResource.PredictionKLine.Bar.DrawType};this.DaySummaryConfig={Font:g_JSChartResource.DaySummaryKLine.Font,TextColor:g_JSChartResource.DaySummaryKLine.TextColor,LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin};};this.ClearCustomKLine=function(){this.CustomKLine=null;};this.ClearBreakPoint=function(){this.AryBreakPoint=null;};this.GetCustomKLine=function(kItem){if(!this.CustomKLine)return null;if(!kItem)return null;var key=kItem.Date*1000000;if(IFrameSplitOperator.IsNumber(kItem.Time))key+=kItem.Time;if(!this.CustomKLine.has(key))return null;var value=this.CustomKLine.get(key);return value;};this.DrawHeatMap=function(){if(!this.ChartHeatMap)return;this.ChartHeatMap.Canvas=this.Canvas;this.ChartHeatMap.ChartBorder=this.ChartBorder;this.ChartHeatMap.ChartFrame=this.ChartFrame;this.ChartHeatMap.Data=this.Data;this.ChartHeatMap.Draw();};this.ClearHeatMap=function(){this.ChartHeatMap=null;};this.CreateHeatMap=function(){this.ChartHeatMap=new ChartHeatMap();};this.DrawAKLine=function()//美国线
3753
3754
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var upColor=this.UpColor;var downColor=this.DownColor;var unchagneColor=this.UnchagneColor;var ptMax={X:null,Y:null,Value:null,Align:'left'};var ptMin={X:null,Y:null,Value:null,Align:'left'};this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;this.DrawKRange.Start=this.Data.DataOffset;var eventUnchangeKLine=null;//定制平盘K线颜色事件
3754
3755
  if(this.GetEventCallback){eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);}var preKItemInfo=null;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];this.ShowRange.End=i;if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var yClose=this.GetYFromData(data.Close,false);this.DrawKRange.End=i;this.AddToDaySummary(data);var kItemInfo={Data:data,Coordinate:{X:x,Low:yLow,High:yHigh,Close:yClose,Open:yOpen,Left:left,Right:right}};if(ptMax.Value==null||ptMax.Value<data.High)//求最大值
@@ -3770,11 +3771,12 @@ var yTop=yClose-barWidth/2;if(isHScreen){this.Canvas.fillRect(yTop,aryX[2],barWi
3770
3771
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var borderLeft=border.TopEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var borderLeft=border.LeftEx;}var bFirstPoint=true;var firstPoint=null;this.Canvas.beginPath();this.Canvas.strokeStyle=this.CloseLineColor;if(IFrameSplitOperator.IsNumber(this.CloseLineWidth))this.Canvas.lineWidth=this.CloseLineWidth;var ptLast=null;if(this.Data.DataOffset>0)//把最左边的一个点连上
3771
3772
  {var data=this.Data.Data[this.Data.DataOffset-1];if(data&&IFrameSplitOperator.IsNumber(data.Close)){var x=borderLeft;var yClose=this.GetYFromData(data.Close,false);if(isHScreen){this.Canvas.moveTo(yClose,x);firstPoint={X:yClose,Y:x};}else{this.Canvas.moveTo(x,yClose);firstPoint={X:x,Y:yClose};}bFirstPoint=false;}}this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;this.DrawKRange.Start=this.Data.DataOffset;var preKItemInfo=null;var prePoint=null;var xEnd=null;//最后一个点
3772
3773
  for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];this.ShowRange.End=i;if(data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yClose=this.GetYFromData(data.Close,false);this.DrawKRange.End=i;this.AddToDaySummary(data);if(data.IsVirtual&&this.PredictionConfig.Enable)//预测数据|虚拟数据
3773
- {this.AryPredictionCache.push({PrePoint:prePoint,Point:{X:x,Y:yClose}});prePoint={X:x,Y:yClose};continue;}if(bFirstPoint){if(isHScreen){this.Canvas.moveTo(yClose,x);firstPoint={X:yClose,Y:x};}else{this.Canvas.moveTo(x,yClose);firstPoint={X:x,Y:yClose};}bFirstPoint=false;}else{if(isHScreen)this.Canvas.lineTo(yClose,x);else this.Canvas.lineTo(x,yClose);}xEnd=x;prePoint={X:x,Y:yClose};if(i==this.Data.Data.length-1){ptLast={X:x,Y:yClose,XLeft:left,XRight:right,KItem:data,ChartRight:chartright};}if(this.PriceGap.Enable){var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var kItemInfo={Data:data,Coordinate:{X:x,Low:yLow,High:yHigh,Close:yClose,Open:yOpen,Left:left,Right:right}};if(preKItemInfo){this.CheckPriceGap(kItemInfo);var value=this.IsPriceGap(kItemInfo,preKItemInfo);if(value>0)this.AryPriceGapCache.push({Data:[preKItemInfo,kItemInfo],Type:value});}preKItemInfo=kItemInfo;}}this.DrawLastPointEvent(ptLast);//通知外部绘制最后一个点
3774
+ {this.AryPredictionCache.push({PrePoint:prePoint,Point:{X:x,Y:yClose}});prePoint={X:x,Y:yClose};continue;}if(bFirstPoint){if(isHScreen){this.Canvas.moveTo(yClose,x);firstPoint={X:yClose,Y:x};}else{this.Canvas.moveTo(x,yClose);firstPoint={X:x,Y:yClose};}bFirstPoint=false;}else{if(isHScreen)this.Canvas.lineTo(yClose,x);else this.Canvas.lineTo(x,yClose);}xEnd=x;prePoint={X:x,Y:yClose};if(i==this.Data.Data.length-1){ptLast={X:x,Y:yClose,XLeft:left,XRight:right,KItem:data,ChartRight:chartright};this.LastPoint={X:x,Y:yClose,KItem:data};}if(this.PriceGap.Enable){var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var kItemInfo={Data:data,Coordinate:{X:x,Low:yLow,High:yHigh,Close:yClose,Open:yOpen,Left:left,Right:right}};if(preKItemInfo){this.CheckPriceGap(kItemInfo);var value=this.IsPriceGap(kItemInfo,preKItemInfo);if(value>0)this.AryPriceGapCache.push({Data:[preKItemInfo,kItemInfo],Type:value});}preKItemInfo=kItemInfo;}}this.DrawLastPointEvent(ptLast);//通知外部绘制最后一个点
3774
3775
  if(bFirstPoint)return;this.Canvas.stroke();if(isHScreen){this.Canvas.lineTo(border.Left,xEnd);this.Canvas.lineTo(border.Left,firstPoint.Y);}else{this.Canvas.lineTo(xEnd,border.Bottom);this.Canvas.lineTo(firstPoint.X,border.Bottom);}this.Canvas.closePath();if(Array.isArray(this.CloseLineAreaColor)){if(isHScreen){var gradient=this.Canvas.createLinearGradient(this.ChartBorder.GetRightEx(),this.ChartBorder.GetTop(),this.ChartBorder.GetLeft(),this.ChartBorder.GetTop());gradient.addColorStop(0,this.CloseLineAreaColor[0]);gradient.addColorStop(1,this.CloseLineAreaColor[1]);this.Canvas.fillStyle=gradient;}else{var _gradient=this.Canvas.createLinearGradient(firstPoint.X,this.ChartBorder.GetTopEx(),firstPoint.X,this.ChartBorder.GetBottom());_gradient.addColorStop(0,this.CloseLineAreaColor[0]);_gradient.addColorStop(1,this.CloseLineAreaColor[1]);this.Canvas.fillStyle=_gradient;}}else{this.Canvas.fillStyle=this.CloseLineAreaColor;}this.Canvas.fill();};this.DrawCloseLine=function()//收盘价线
3775
3776
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;}else{var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;}var bFirstPoint=true;var drawCount=0;this.Canvas.beginPath();this.Canvas.strokeStyle=this.CloseLineColor;if(IFrameSplitOperator.IsNumber(this.CloseLineWidth))this.Canvas.lineWidth=this.CloseLineWidth;this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;this.DrawKRange.Start=this.Data.DataOffset;var mapBreakPoint=this.BuildBreakPoint();//断点
3776
3777
  var preKItemInfo=null;var prePoint=null;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth,++this.ShowRange.DataCount){var data=this.Data.Data[i];this.ShowRange.End=i;if(!data||data.Open==null||data.High==null||data.Low==null||data.Close==null)continue;var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;var yClose=this.GetYFromData(data.Close,false);this.DrawKRange.End=i;this.AddToDaySummary(data);if(data.IsVirtual&&this.PredictionConfig.Enable)//预测数据|虚拟数据
3777
- {this.AryPredictionCache.push({PrePoint:prePoint,Point:{X:x,Y:yClose}});prePoint={X:x,Y:yClose};continue;}if(bFirstPoint){if(isHScreen)this.Canvas.moveTo(yClose,x);else this.Canvas.moveTo(x,yClose);bFirstPoint=false;}else{if(isHScreen)this.Canvas.lineTo(yClose,x);else this.Canvas.lineTo(x,yClose);}++drawCount;prePoint={X:x,Y:yClose};if(this.PriceGap.Enable){var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var kItemInfo={Data:data,Coordinate:{X:x,Low:yLow,High:yHigh,Close:yClose,Open:yOpen,Left:left,Right:right}};if(preKItemInfo){this.CheckPriceGap(kItemInfo);var value=this.IsPriceGap(kItemInfo,preKItemInfo);if(value>0)this.AryPriceGapCache.push({Data:[preKItemInfo,kItemInfo],Type:value});}preKItemInfo=kItemInfo;}//断开点
3778
+ {this.AryPredictionCache.push({PrePoint:prePoint,Point:{X:x,Y:yClose}});prePoint={X:x,Y:yClose};continue;}if(bFirstPoint){if(isHScreen)this.Canvas.moveTo(yClose,x);else this.Canvas.moveTo(x,yClose);bFirstPoint=false;}else{if(isHScreen)this.Canvas.lineTo(yClose,x);else this.Canvas.lineTo(x,yClose);}++drawCount;prePoint={X:x,Y:yClose};if(i==this.Data.Data.length-1)//最后一个点
3779
+ {this.LastPoint={X:x,Y:yClose,KItem:data};}if(this.PriceGap.Enable){var yLow=this.GetYFromData(data.Low,false);var yHigh=this.GetYFromData(data.High,false);var yOpen=this.GetYFromData(data.Open,false);var kItemInfo={Data:data,Coordinate:{X:x,Low:yLow,High:yHigh,Close:yClose,Open:yOpen,Left:left,Right:right}};if(preKItemInfo){this.CheckPriceGap(kItemInfo);var value=this.IsPriceGap(kItemInfo,preKItemInfo);if(value>0)this.AryPriceGapCache.push({Data:[preKItemInfo,kItemInfo],Type:value});}preKItemInfo=kItemInfo;}//断开点
3778
3780
  if(mapBreakPoint){var kItem=data;var key=this.BuildDateTimeKey(kItem);if(key&&mapBreakPoint.has(key)){if(drawCount>0)this.Canvas.stroke();bFirstPoint=true;drawCount=0;}}}if(drawCount>0)this.Canvas.stroke();};this.DrawKBar=function()//蜡烛头
3779
3781
  {var isHScreen=this.ChartFrame.IsHScreen===true;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var border=this.ChartBorder.GetBorder();var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var xPointCount=this.ChartFrame.XPointCount;if(isHScreen){var border=this.ChartBorder.GetHScreenBorder();xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;chartright=border.BottomEx;}var ptMax={X:null,Y:null,Value:null,Align:'left'};var ptMin={X:null,Y:null,Value:null,Align:'left'};var upColor=this.UpColor;var downColor=this.DownColor;var unchagneColor=this.UnchagneColor;this.ShowRange.Start=this.Data.DataOffset;this.ShowRange.End=this.ShowRange.Start;this.ShowRange.DataCount=0;this.ShowRange.ShowCount=xPointCount;var ptLast=null;this.DrawKRange.Start=this.Data.DataOffset;var eventUnchangeKLine=null;//定制平盘K线颜色事件
3780
3782
  if(this.GetEventCallback){eventUnchangeKLine=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_UNCHANGE_KLINE_COLOR);}var preKItemInfo=null;var prePoint=null;//上一个点的位置
@@ -3926,11 +3928,11 @@ this.TooltipRect.push([i,rect]);//[0]数据索引 [1]数据区域
3926
3928
  this.Canvas.clip();};this.ClipClient=function(isHScreen)//裁剪客户端
3927
3929
  {if(isHScreen==true){var left=this.ChartBorder.GetLeftEx();var right=this.ChartBorder.GetRightEx();var top=this.ChartBorder.GetTop();var bottom=this.ChartBorder.GetBottom();}else{var left=this.ChartBorder.GetLeft();var right=this.ChartBorder.GetRight();var top=this.ChartBorder.GetTopEx();var bottom=this.ChartBorder.GetBottomEx();if(this.ChartBorder.BottomSpace>0)bottom+=1;if(this.DrawType==13)//需要显示文字,裁剪要大点
3928
3930
  {top=this.ChartBorder.GetTopTitle();bottom=this.ChartBorder.GetBottom();}}this.Canvas.beginPath();this.Canvas.rect(left,top,right-left,bottom-top);//this.Canvas.stroke(); //调试用
3929
- this.Canvas.clip();};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;this.ClearDaySummary();this.IsShowOrderText=false;this.TooltipRect=[];this.InfoTooltipRect=[];this.TradeIconTooltipRect=[];this.PtMax={X:null,Y:null,Value:null,Align:'left'};//清空最大
3931
+ this.Canvas.clip();};this.ClearLastPoint=function(){this.LastPoint={};if(this.ChartFrame.GlobalOption){var item=this.ChartFrame.GlobalOption;item.LatestPoint=null;}};this.UpdateGlobalLatestPoint=function(){if(this.Identify!="Main-KLine")return;if(!this.ChartFrame.GlobalOption)return;var item=this.ChartFrame.GlobalOption;if(IFrameSplitOperator.IsNumber(this.LastPoint.X)&&IFrameSplitOperator.IsNumber(this.LastPoint.Y))item.LatestPoint={X:this.LastPoint.X,Y:this.LastPoint.Y};};this.Draw=function(){this.ClearLastPoint();if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;this.ClearDaySummary();this.IsShowOrderText=false;this.TooltipRect=[];this.InfoTooltipRect=[];this.TradeIconTooltipRect=[];this.PtMax={X:null,Y:null,Value:null,Align:'left'};//清空最大
3930
3932
  this.PtMin={X:null,Y:null,Value:null,Align:'left'};//清空最小
3931
3933
  this.DrawKRange={Start:null,End:null};this.AryPriceGapCache=[];this.AryPredictionCache=[];this.ChartFrame.ChartKLine={Max:null,Min:null};//保存K线上 显示最大最小值坐标
3932
3934
  this.DrawHeatMap();if(!this.IsShow)return;if(this.ChartFrame.IsMinSize&&this.Name=="Self Kline")return;if(ChartData.IsTickPeriod(this.Period))//分笔图
3933
- {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();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{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();this.DrawPredictionLine();if(this.PriceGap.Enable)this.DrawPriceGap();if(this.IsShowMaxMinPrice)//标注最大值最小值
3935
+ {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{this.DrawKBar();}if(this.TradeIcon)this.DrawTradeIcon();else this.DrawTrade();this.Canvas.restore();this.UpdateGlobalLatestPoint();this.DrawPredictionLine();if(this.PriceGap.Enable)this.DrawPriceGap();if(this.IsShowMaxMinPrice)//标注最大值最小值
3934
3936
  {if(this.ChartFrame.IsHScreen===true)this.HScreenDrawMaxMinPrice(this.PtMax,this.PtMin);else this.DrawMaxMinPrice(this.PtMax,this.PtMin);}if(this.DrawType==14)//自定义图形 标注最大最小值
3935
3937
  {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);//小数位数
3936
3938
  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;//使用外部回调的数值
@@ -5318,8 +5320,9 @@ var yText=subFrame.ChartBorder.GetTopEx()+this.MerginTop;for(var i=0;i<this.Data
5318
5320
  function LatestPointFlashPaint(){this.newMethod=IExtendChartPainting;//派生
5319
5321
  this.newMethod();delete this.newMethod;this.ClassName='LatestPointFlashPaint';this.HQChart;this.Status=0;this.UpdateTime=new Date();this.FlashCount=0;//闪烁次数
5320
5322
  this.Frequency=500;//闪烁频率ms
5321
- this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;this.FlashCanvas;this.SetOption=function(option){if(this.HQChart){var extraElement=this.HQChart.GetExtraCanvas(JSChart.LatestPointFlashKey);if(extraElement&&extraElement.Canvas)this.FlashCanvas=extraElement.Canvas;//绑定独立的画布
5322
- }if(option){if(IFrameSplitOperator.IsNumber(option.Frequency))this.Frequency=option.Frequency;}};this.ReloadResource=function(resource){this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;};this.Draw=function(){if(!this.FlashCanvas)return;if(!this.HQChart)return;this.HQChart.ClearCanvas(this.FlashCanvas);if(this.FlashCount<=0)return;if(this.IsStatusChange()){this.Status=(this.Status+1)%2;--this.FlashCount;}if(this.Status==0)return;if(!this.HQChart.GlobalOption||!this.HQChart.GlobalOption.LatestPoint)return;var point=this.HQChart.GlobalOption.LatestPoint;if(!IFrameSplitOperator.IsNumber(point.X)||!IFrameSplitOperator.IsNumber(point.Y))return;this.FlashCanvas.fillStyle=this.BGColor;this.FlashCanvas.beginPath();this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);this.FlashCanvas.fill();this.FlashCanvas.closePath();//画实心圆
5323
+ this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;this.Style=1;//0=默认配置 1=图形保持一致
5324
+ this.FlashCanvas;this.SetOption=function(option){if(this.HQChart){var extraElement=this.HQChart.GetExtraCanvas(JSChart.LatestPointFlashKey);if(extraElement&&extraElement.Canvas)this.FlashCanvas=extraElement.Canvas;//绑定独立的画布
5325
+ }if(option){if(IFrameSplitOperator.IsNumber(option.Frequency))this.Frequency=option.Frequency;}};this.ReloadResource=function(resource){this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;};this.GetChartColor=function(){var chart=this.HQChart.ChartPaint[0];if(!chart)return;if(chart.ClassName=="ChartKLine"){this.PointColor=chart.CloseLineColor;this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor,0.6);}else if(chart.ClassName=="ChartMinutePriceLine"){this.PointColor=chart.Color;this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color,0.6);}};this.Draw=function(){if(!this.FlashCanvas)return;if(!this.HQChart)return;this.HQChart.ClearCanvas(this.FlashCanvas);if(this.FlashCount<=0)return;if(this.IsStatusChange()){this.Status=(this.Status+1)%2;--this.FlashCount;}if(this.Status==0)return;if(!this.HQChart.GlobalOption||!this.HQChart.GlobalOption.LatestPoint)return;var point=this.HQChart.GlobalOption.LatestPoint;if(!IFrameSplitOperator.IsNumber(point.X)||!IFrameSplitOperator.IsNumber(point.Y))return;if(this.Style==1)this.GetChartColor();this.FlashCanvas.fillStyle=this.BGColor;this.FlashCanvas.beginPath();this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);this.FlashCanvas.fill();this.FlashCanvas.closePath();//画实心圆
5323
5326
  this.FlashCanvas.fillStyle=this.PointColor;this.FlashCanvas.beginPath();this.FlashCanvas.arc(point.X,point.Y,this.PointRadius,0,360,false);this.FlashCanvas.fill();this.FlashCanvas.closePath();};this.IsStatusChange=function(){if(!this.UpdateTime){this.UpdateTime=new Date();return true;}var now=new Date();var diffValue=now.getTime()-this.UpdateTime.getTime();if(diffValue<=this.Frequency)return false;this.UpdateTime=now;return true;};}//拖拽效果图
5324
5327
  var JSCHART_DRAGCHART_TYPE_ID={MAIN_KLINE:1,OVERLAY_KLINE:2,MAIN_INDEX:3,OVERLAY_INDEX:4,OVERLAY_MINUTE:5,//叠加走势图
5325
5328
  MAIN_MINUTE:6,//走势图
@@ -7932,7 +7935,8 @@ var lastDataCount=this.GetHistoryDataCount();//保存下上一次的数据个数
7932
7935
  if(this.SourceData.Data.length==0)//第1条数据
7933
7936
  {var newItem=new HistoryData();HistoryData.CopyTo(newItem,realtimeData);this.SourceData.Data.push(newItem);}else if(item.Date==realtimeData.Date)//实时行情数据更新
7934
7937
  {JSConsole.Chart.Log('[KLineChartContainer::RecvRealtimeData] update kline by realtime data',realtimeData);HistoryData.CopyTo(item,realtimeData);}else if(item.Date<realtimeData.Date)//新增加数据
7935
- {JSConsole.Chart.Log('[KLineChartContainer::RecvRealtimeData] insert kline by realtime data',realtimeData);var newItem=new HistoryData();HistoryData.CopyTo(newItem,realtimeData);if(!IFrameSplitOperator.IsNumber(newItem.YClose)&&this.SourceData.Data.length>0)newItem.YClose=this.SourceData.Data[this.SourceData.Data.length-1].YClose;this.SourceData.Data.push(newItem);}else{var bFind=false;var aryKData=this.SourceData.Data;for(var i=aryKData.length-1;i>=0;--i){var kItem=aryKData[i];if(kItem.Date==realtimeData.Date){HistoryData.CopyTo(kItem,realtimeData);bFind=true;break;}}if(!bFind)return;}var bindData=new ChartData();bindData.Data=this.SourceData.Data;bindData.Period=this.Period;bindData.Right=this.Right;bindData.DataType=this.SourceData.DataType;bindData.Symbol=this.Symbol;if(bindData.Right>0&&ChartData.IsDayPeriod(bindData.Period,true)&&MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol)&&!this.IsApiPeriod)//复权(A股日线数据才复权)
7938
+ {JSConsole.Chart.Log('[KLineChartContainer::RecvRealtimeData] insert kline by realtime data',realtimeData);var newItem=new HistoryData();HistoryData.CopyTo(newItem,realtimeData);if(!IFrameSplitOperator.IsNumber(newItem.YClose)&&this.SourceData.Data.length>0)newItem.YClose=this.SourceData.Data[this.SourceData.Data.length-1].YClose;this.SourceData.Data.push(newItem);}else{var bFind=false;var aryKData=this.SourceData.Data;for(var i=aryKData.length-1;i>=0;--i){var kItem=aryKData[i];if(kItem.Date==realtimeData.Date){HistoryData.CopyTo(kItem,realtimeData);bFind=true;break;}}if(!bFind)return;}if(data.LatestPointFlash)//最新数据闪烁
7939
+ {var item=data.LatestPointFlash;if(IFrameSplitOperator.IsNumber(item.FlashCount))this.SetLatestPointFlash(item.FlashCount);}var bindData=new ChartData();bindData.Data=this.SourceData.Data;bindData.Period=this.Period;bindData.Right=this.Right;bindData.DataType=this.SourceData.DataType;bindData.Symbol=this.Symbol;if(bindData.Right>0&&ChartData.IsDayPeriod(bindData.Period,true)&&MARKET_SUFFIX_NAME.IsSHSZStockA(this.Symbol)&&!this.IsApiPeriod)//复权(A股日线数据才复权)
7936
7940
  {var rightData=bindData.GetRightData(bindData.Right,{AlgorithmType:this.RightFormula});bindData.Data=rightData;}if(!this.IsApiPeriod){if(ChartData.IsDayPeriod(bindData.Period,false)||ChartData.IsMinutePeriod(bindData.Period,false))//周期数据 (0= 日线,4=1分钟线 不需要处理)
7937
7941
  {var periodData=bindData.GetPeriodData(bindData.Period);bindData.Data=periodData;}}var kLineCalculate=this.GetKLineCalulate();if(kLineCalculate)//额外的K线图形计算
7938
7942
  {var newBindData=kLineCalculate.RecvHistoryData(bindData,{Symbol:this.Symbol,Function:"RecvRealtimeData"});bindData=newBindData;this.FlowCapitalReady=true;}this.UpdateMainData(bindData,lastDataCount);//更新主图数据
@@ -15074,7 +15078,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
15074
15078
  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);};}/********************************************************************************
15075
15079
  * 版本信息输出
15076
15080
  *
15077
- */var HQCHART_VERSION="1.1.14852";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();//把给外界调用的方法暴露出来
15081
+ */var HQCHART_VERSION="1.1.14854";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();//把给外界调用的方法暴露出来
15078
15082
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
15079
15083
  // BaseIndex:BaseIndex,
15080
15084
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14853",
3
+ "version": "1.1.14855",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -787,6 +787,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
787
787
 
788
788
  this.AdjustTitleHeight(chart);
789
789
 
790
+ if (option.LatestPointFlash)
791
+ {
792
+ var item=option.LatestPointFlash;
793
+ if (item.Enable)
794
+ {
795
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
796
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
797
+ chart.StartLatestPointFlash();
798
+ }
799
+ }
800
+
790
801
  return chart;
791
802
  }
792
803
 
@@ -27243,6 +27254,8 @@ function ChartKLine()
27243
27254
  LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
27244
27255
  }
27245
27256
 
27257
+ this.LastPoint={ }; //最后一个点的信息 {X, Y, KItem:, Date:, Time: }
27258
+
27246
27259
  this.AddToDaySummary=function(kItem)
27247
27260
  {
27248
27261
  if (!this.DaySummary.Enable) return false;
@@ -27746,6 +27759,8 @@ function ChartKLine()
27746
27759
  if (i==this.Data.Data.length-1)
27747
27760
  {
27748
27761
  ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
27762
+
27763
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
27749
27764
  }
27750
27765
 
27751
27766
  if (this.PriceGap.Enable )
@@ -27879,6 +27894,11 @@ function ChartKLine()
27879
27894
 
27880
27895
  prePoint={ X:x, Y:yClose};
27881
27896
 
27897
+ if (i==this.Data.Data.length-1) //最后一个点
27898
+ {
27899
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
27900
+ }
27901
+
27882
27902
  if (this.PriceGap.Enable)
27883
27903
  {
27884
27904
  var yLow=this.GetYFromData(data.Low, false);
@@ -29842,8 +29862,29 @@ function ChartKLine()
29842
29862
  this.Canvas.clip();
29843
29863
  }
29844
29864
 
29865
+ this.ClearLastPoint=function()
29866
+ {
29867
+ this.LastPoint={ };
29868
+ if (this.ChartFrame.GlobalOption)
29869
+ {
29870
+ var item=this.ChartFrame.GlobalOption;
29871
+ item.LatestPoint=null;
29872
+ }
29873
+ }
29874
+
29875
+ this.UpdateGlobalLatestPoint=function()
29876
+ {
29877
+ if (this.Identify!="Main-KLine") return;
29878
+ if (!this.ChartFrame.GlobalOption) return;
29879
+
29880
+ var item=this.ChartFrame.GlobalOption;
29881
+ if (IFrameSplitOperator.IsNumber(this.LastPoint.X) && IFrameSplitOperator.IsNumber(this.LastPoint.Y))
29882
+ item.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
29883
+ }
29884
+
29845
29885
  this.Draw=function()
29846
29886
  {
29887
+ this.ClearLastPoint();
29847
29888
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
29848
29889
  if (this.IsShowIndexTitleOnly()) return;
29849
29890
  if (this.IsHideScriptIndex()) return;
@@ -29900,6 +29941,7 @@ function ChartKLine()
29900
29941
  this.Canvas.restore();
29901
29942
  this.DrawPredictionLine();
29902
29943
  if (this.PriceGap.Enable) this.DrawPriceGap();
29944
+ this.UpdateGlobalLatestPoint();
29903
29945
  return;
29904
29946
  }
29905
29947
  else if (this.DrawType==2)
@@ -29971,6 +30013,8 @@ function ChartKLine()
29971
30013
 
29972
30014
  this.Canvas.restore();
29973
30015
 
30016
+ this.UpdateGlobalLatestPoint();
30017
+
29974
30018
  this.DrawPredictionLine();
29975
30019
  if (this.PriceGap.Enable) this.DrawPriceGap();
29976
30020
 
@@ -52074,6 +52118,7 @@ function LatestPointFlashPaint()
52074
52118
  this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
52075
52119
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
52076
52120
  this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
52121
+ this.Style=1; //0=默认配置 1=图形保持一致
52077
52122
  this.FlashCanvas;
52078
52123
 
52079
52124
  this.SetOption=function(option)
@@ -52098,6 +52143,23 @@ function LatestPointFlashPaint()
52098
52143
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
52099
52144
  }
52100
52145
 
52146
+ this.GetChartColor=function()
52147
+ {
52148
+ var chart=this.HQChart.ChartPaint[0];
52149
+ if (!chart) return;
52150
+
52151
+ if (chart.ClassName=="ChartKLine")
52152
+ {
52153
+ this.PointColor=chart.CloseLineColor;
52154
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor, 0.6);
52155
+ }
52156
+ else if (chart.ClassName=="ChartMinutePriceLine")
52157
+ {
52158
+ this.PointColor=chart.Color;
52159
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color, 0.6);
52160
+ }
52161
+ }
52162
+
52101
52163
  this.Draw=function()
52102
52164
  {
52103
52165
  if (!this.FlashCanvas) return;
@@ -52116,6 +52178,8 @@ function LatestPointFlashPaint()
52116
52178
  var point=this.HQChart.GlobalOption.LatestPoint;
52117
52179
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
52118
52180
 
52181
+ if (this.Style==1) this.GetChartColor();
52182
+
52119
52183
  this.FlashCanvas.fillStyle=this.BGColor;
52120
52184
  this.FlashCanvas.beginPath();
52121
52185
  this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
@@ -82330,6 +82394,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
82330
82394
 
82331
82395
  if (!bFind) return;
82332
82396
  }
82397
+
82398
+ if (data.LatestPointFlash) //最新数据闪烁
82399
+ {
82400
+ var item=data.LatestPointFlash;
82401
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
82402
+ this.SetLatestPointFlash(item.FlashCount)
82403
+ }
82333
82404
 
82334
82405
  var bindData=new ChartData();
82335
82406
  bindData.Data=this.SourceData.Data;
@@ -4883,6 +4883,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4883
4883
 
4884
4884
  this.AdjustTitleHeight(chart);
4885
4885
 
4886
+ if (option.LatestPointFlash)
4887
+ {
4888
+ var item=option.LatestPointFlash;
4889
+ if (item.Enable)
4890
+ {
4891
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
4892
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
4893
+ chart.StartLatestPointFlash();
4894
+ }
4895
+ }
4896
+
4886
4897
  return chart;
4887
4898
  }
4888
4899
 
@@ -31339,6 +31350,8 @@ function ChartKLine()
31339
31350
  LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
31340
31351
  }
31341
31352
 
31353
+ this.LastPoint={ }; //最后一个点的信息 {X, Y, KItem:, Date:, Time: }
31354
+
31342
31355
  this.AddToDaySummary=function(kItem)
31343
31356
  {
31344
31357
  if (!this.DaySummary.Enable) return false;
@@ -31842,6 +31855,8 @@ function ChartKLine()
31842
31855
  if (i==this.Data.Data.length-1)
31843
31856
  {
31844
31857
  ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
31858
+
31859
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
31845
31860
  }
31846
31861
 
31847
31862
  if (this.PriceGap.Enable )
@@ -31975,6 +31990,11 @@ function ChartKLine()
31975
31990
 
31976
31991
  prePoint={ X:x, Y:yClose};
31977
31992
 
31993
+ if (i==this.Data.Data.length-1) //最后一个点
31994
+ {
31995
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
31996
+ }
31997
+
31978
31998
  if (this.PriceGap.Enable)
31979
31999
  {
31980
32000
  var yLow=this.GetYFromData(data.Low, false);
@@ -33938,8 +33958,29 @@ function ChartKLine()
33938
33958
  this.Canvas.clip();
33939
33959
  }
33940
33960
 
33961
+ this.ClearLastPoint=function()
33962
+ {
33963
+ this.LastPoint={ };
33964
+ if (this.ChartFrame.GlobalOption)
33965
+ {
33966
+ var item=this.ChartFrame.GlobalOption;
33967
+ item.LatestPoint=null;
33968
+ }
33969
+ }
33970
+
33971
+ this.UpdateGlobalLatestPoint=function()
33972
+ {
33973
+ if (this.Identify!="Main-KLine") return;
33974
+ if (!this.ChartFrame.GlobalOption) return;
33975
+
33976
+ var item=this.ChartFrame.GlobalOption;
33977
+ if (IFrameSplitOperator.IsNumber(this.LastPoint.X) && IFrameSplitOperator.IsNumber(this.LastPoint.Y))
33978
+ item.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
33979
+ }
33980
+
33941
33981
  this.Draw=function()
33942
33982
  {
33983
+ this.ClearLastPoint();
33943
33984
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
33944
33985
  if (this.IsShowIndexTitleOnly()) return;
33945
33986
  if (this.IsHideScriptIndex()) return;
@@ -33996,6 +34037,7 @@ function ChartKLine()
33996
34037
  this.Canvas.restore();
33997
34038
  this.DrawPredictionLine();
33998
34039
  if (this.PriceGap.Enable) this.DrawPriceGap();
34040
+ this.UpdateGlobalLatestPoint();
33999
34041
  return;
34000
34042
  }
34001
34043
  else if (this.DrawType==2)
@@ -34067,6 +34109,8 @@ function ChartKLine()
34067
34109
 
34068
34110
  this.Canvas.restore();
34069
34111
 
34112
+ this.UpdateGlobalLatestPoint();
34113
+
34070
34114
  this.DrawPredictionLine();
34071
34115
  if (this.PriceGap.Enable) this.DrawPriceGap();
34072
34116
 
@@ -56170,6 +56214,7 @@ function LatestPointFlashPaint()
56170
56214
  this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
56171
56215
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56172
56216
  this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
56217
+ this.Style=1; //0=默认配置 1=图形保持一致
56173
56218
  this.FlashCanvas;
56174
56219
 
56175
56220
  this.SetOption=function(option)
@@ -56194,6 +56239,23 @@ function LatestPointFlashPaint()
56194
56239
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56195
56240
  }
56196
56241
 
56242
+ this.GetChartColor=function()
56243
+ {
56244
+ var chart=this.HQChart.ChartPaint[0];
56245
+ if (!chart) return;
56246
+
56247
+ if (chart.ClassName=="ChartKLine")
56248
+ {
56249
+ this.PointColor=chart.CloseLineColor;
56250
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor, 0.6);
56251
+ }
56252
+ else if (chart.ClassName=="ChartMinutePriceLine")
56253
+ {
56254
+ this.PointColor=chart.Color;
56255
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color, 0.6);
56256
+ }
56257
+ }
56258
+
56197
56259
  this.Draw=function()
56198
56260
  {
56199
56261
  if (!this.FlashCanvas) return;
@@ -56212,6 +56274,8 @@ function LatestPointFlashPaint()
56212
56274
  var point=this.HQChart.GlobalOption.LatestPoint;
56213
56275
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
56214
56276
 
56277
+ if (this.Style==1) this.GetChartColor();
56278
+
56215
56279
  this.FlashCanvas.fillStyle=this.BGColor;
56216
56280
  this.FlashCanvas.beginPath();
56217
56281
  this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
@@ -86426,6 +86490,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86426
86490
 
86427
86491
  if (!bFind) return;
86428
86492
  }
86493
+
86494
+ if (data.LatestPointFlash) //最新数据闪烁
86495
+ {
86496
+ var item=data.LatestPointFlash;
86497
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
86498
+ this.SetLatestPointFlash(item.FlashCount)
86499
+ }
86429
86500
 
86430
86501
  var bindData=new ChartData();
86431
86502
  bindData.Data=this.SourceData.Data;
@@ -150197,7 +150268,7 @@ function ScrollBarBGChart()
150197
150268
 
150198
150269
 
150199
150270
 
150200
- var HQCHART_VERSION="1.1.14852";
150271
+ var HQCHART_VERSION="1.1.14854";
150201
150272
 
150202
150273
  function PrintHQChartVersion()
150203
150274
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14852";
8
+ var HQCHART_VERSION="1.1.14854";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -4927,6 +4927,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4927
4927
 
4928
4928
  this.AdjustTitleHeight(chart);
4929
4929
 
4930
+ if (option.LatestPointFlash)
4931
+ {
4932
+ var item=option.LatestPointFlash;
4933
+ if (item.Enable)
4934
+ {
4935
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
4936
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
4937
+ chart.StartLatestPointFlash();
4938
+ }
4939
+ }
4940
+
4930
4941
  return chart;
4931
4942
  }
4932
4943
 
@@ -31383,6 +31394,8 @@ function ChartKLine()
31383
31394
  LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
31384
31395
  }
31385
31396
 
31397
+ this.LastPoint={ }; //最后一个点的信息 {X, Y, KItem:, Date:, Time: }
31398
+
31386
31399
  this.AddToDaySummary=function(kItem)
31387
31400
  {
31388
31401
  if (!this.DaySummary.Enable) return false;
@@ -31886,6 +31899,8 @@ function ChartKLine()
31886
31899
  if (i==this.Data.Data.length-1)
31887
31900
  {
31888
31901
  ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
31902
+
31903
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
31889
31904
  }
31890
31905
 
31891
31906
  if (this.PriceGap.Enable )
@@ -32019,6 +32034,11 @@ function ChartKLine()
32019
32034
 
32020
32035
  prePoint={ X:x, Y:yClose};
32021
32036
 
32037
+ if (i==this.Data.Data.length-1) //最后一个点
32038
+ {
32039
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
32040
+ }
32041
+
32022
32042
  if (this.PriceGap.Enable)
32023
32043
  {
32024
32044
  var yLow=this.GetYFromData(data.Low, false);
@@ -33982,8 +34002,29 @@ function ChartKLine()
33982
34002
  this.Canvas.clip();
33983
34003
  }
33984
34004
 
34005
+ this.ClearLastPoint=function()
34006
+ {
34007
+ this.LastPoint={ };
34008
+ if (this.ChartFrame.GlobalOption)
34009
+ {
34010
+ var item=this.ChartFrame.GlobalOption;
34011
+ item.LatestPoint=null;
34012
+ }
34013
+ }
34014
+
34015
+ this.UpdateGlobalLatestPoint=function()
34016
+ {
34017
+ if (this.Identify!="Main-KLine") return;
34018
+ if (!this.ChartFrame.GlobalOption) return;
34019
+
34020
+ var item=this.ChartFrame.GlobalOption;
34021
+ if (IFrameSplitOperator.IsNumber(this.LastPoint.X) && IFrameSplitOperator.IsNumber(this.LastPoint.Y))
34022
+ item.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
34023
+ }
34024
+
33985
34025
  this.Draw=function()
33986
34026
  {
34027
+ this.ClearLastPoint();
33987
34028
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
33988
34029
  if (this.IsShowIndexTitleOnly()) return;
33989
34030
  if (this.IsHideScriptIndex()) return;
@@ -34040,6 +34081,7 @@ function ChartKLine()
34040
34081
  this.Canvas.restore();
34041
34082
  this.DrawPredictionLine();
34042
34083
  if (this.PriceGap.Enable) this.DrawPriceGap();
34084
+ this.UpdateGlobalLatestPoint();
34043
34085
  return;
34044
34086
  }
34045
34087
  else if (this.DrawType==2)
@@ -34111,6 +34153,8 @@ function ChartKLine()
34111
34153
 
34112
34154
  this.Canvas.restore();
34113
34155
 
34156
+ this.UpdateGlobalLatestPoint();
34157
+
34114
34158
  this.DrawPredictionLine();
34115
34159
  if (this.PriceGap.Enable) this.DrawPriceGap();
34116
34160
 
@@ -56214,6 +56258,7 @@ function LatestPointFlashPaint()
56214
56258
  this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
56215
56259
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56216
56260
  this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
56261
+ this.Style=1; //0=默认配置 1=图形保持一致
56217
56262
  this.FlashCanvas;
56218
56263
 
56219
56264
  this.SetOption=function(option)
@@ -56238,6 +56283,23 @@ function LatestPointFlashPaint()
56238
56283
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56239
56284
  }
56240
56285
 
56286
+ this.GetChartColor=function()
56287
+ {
56288
+ var chart=this.HQChart.ChartPaint[0];
56289
+ if (!chart) return;
56290
+
56291
+ if (chart.ClassName=="ChartKLine")
56292
+ {
56293
+ this.PointColor=chart.CloseLineColor;
56294
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor, 0.6);
56295
+ }
56296
+ else if (chart.ClassName=="ChartMinutePriceLine")
56297
+ {
56298
+ this.PointColor=chart.Color;
56299
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color, 0.6);
56300
+ }
56301
+ }
56302
+
56241
56303
  this.Draw=function()
56242
56304
  {
56243
56305
  if (!this.FlashCanvas) return;
@@ -56256,6 +56318,8 @@ function LatestPointFlashPaint()
56256
56318
  var point=this.HQChart.GlobalOption.LatestPoint;
56257
56319
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
56258
56320
 
56321
+ if (this.Style==1) this.GetChartColor();
56322
+
56259
56323
  this.FlashCanvas.fillStyle=this.BGColor;
56260
56324
  this.FlashCanvas.beginPath();
56261
56325
  this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
@@ -86470,6 +86534,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86470
86534
 
86471
86535
  if (!bFind) return;
86472
86536
  }
86537
+
86538
+ if (data.LatestPointFlash) //最新数据闪烁
86539
+ {
86540
+ var item=data.LatestPointFlash;
86541
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
86542
+ this.SetLatestPointFlash(item.FlashCount)
86543
+ }
86473
86544
 
86474
86545
  var bindData=new ChartData();
86475
86546
  bindData.Data=this.SourceData.Data;
@@ -161237,7 +161308,7 @@ function HQChartScriptWorker()
161237
161308
 
161238
161309
 
161239
161310
 
161240
- var HQCHART_VERSION="1.1.14852";
161311
+ var HQCHART_VERSION="1.1.14854";
161241
161312
 
161242
161313
  function PrintHQChartVersion()
161243
161314
  {