hqchart 1.1.14487 → 1.1.14489

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.
@@ -3970,7 +3970,10 @@ var drawCount=0;for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xP
3970
3970
  {var value=this.Data.Data[i];if(value==null){if(drawCount>0)this.Canvas.stroke();bFirstPoint=true;drawCount=0;ptFirst=null;continue;}if(isMinute){var x=this.ChartFrame.GetXFromIndex(j);}else{var left=xOffset;var right=xOffset+dataWidth;if(right>chartright)break;var x=left+(right-left)/2;}var y=this.GetYFromData(value,false);if(x>chartright)break;//断开
3971
3971
  if(this.BreakPoint&&this.BreakPoint.has(i)){if(drawCount>0)this.Canvas.stroke();bFirstPoint=true;drawCount=0;ptFirst=null;}if(bFirstPoint){this.Canvas.beginPath();if(bHScreen)this.Canvas.moveTo(y,x);//横屏坐标轴对调
3972
3972
  else this.Canvas.moveTo(x,y);bFirstPoint=false;ptFirst={X:x,Y:y};}else{if(bHScreen)this.Canvas.lineTo(y,x);else this.Canvas.lineTo(x,y);}++drawCount;}if(drawCount>0){if(drawCount==1&&ptFirst)//如果只有1个点, 画一个像素的横线
3973
- {if(bHScreen)this.Canvas.lineTo(ptFirst.Y,ptFirst.X+1*GetDevicePixelRatio());else this.Canvas.lineTo(ptFirst.X+1*GetDevicePixelRatio(),ptFirst.Y);}this.Canvas.stroke();}this.Canvas.restore();};}//面积图 支持横屏
3973
+ {if(bHScreen)this.Canvas.lineTo(ptFirst.Y,ptFirst.X+1*GetDevicePixelRatio());else this.Canvas.lineTo(ptFirst.X+1*GetDevicePixelRatio(),ptFirst.Y);}this.Canvas.stroke();}this.Canvas.restore();};}//标题
3974
+ function ChartIndexTitle(){this.newMethod=IChartPainting;//派生
3975
+ this.newMethod();delete this.newMethod;this.ClassName='ChartIndexTitle';//类名
3976
+ this.Draw=function(){};this.GetMaxMin=function(){return range={Min:null,Max:null};};}//面积图 支持横屏
3974
3977
  function ChartArea(){this.newMethod=IChartPainting;//派生
3975
3978
  this.newMethod();delete this.newMethod;this.ClassName='ChartArea';//类名
3976
3979
  this.Color="rgb(255,193,37)";//线段颜色
@@ -6037,7 +6040,7 @@ var value=null;var preVaildItem=null;if(item.DataType=="StraightLine")//直线
6037
6040
  {value=item.Data.Data[0];valueText=this.FormatValue(value,item);}else if(item.ChartClassName=="ChartVolProfileVisibleRange"){aryText=this.FormatVPVRTitle(this.LastPoint,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else{if(isShowLastData){var dataIndex=item.Data.Data.length-1;//显示最后一个数据
6038
6041
  }else{var index=Math.abs(this.CursorIndex);index=parseInt(index.toFixed(0));if(this.IsKLineFrame)index=this.CursorIndex;var dataIndex=item.Data.DataOffset+index;if(dataIndex>=item.Data.Data.length)dataIndex=item.Data.Data.length-1;if(dataIndex<0)return null;}if(item.DataType=="ChartMultiLine")//多线段数据
6039
6042
  {aryText=this.ForamtMultiLineTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="ChartMultiPoint"){aryText=this.ForamtMultiPointTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="ChartMultiBar"){aryText=this.ForamtMultiBarTitle(dataIndex,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}value=item.Data.Data[dataIndex];if(value==null&&item.ChartClassName=="ChartStepLine")//当前值无效,上一个值延续
6040
- {preVaildItem=this.GetPreVaildItem(item.Data.Data,dataIndex);if(!preVaildItem)return null;preText=this.FormatValue(preVaildItem.Item,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,preText);if(dyValue)preText=dyValue;}valueText='--('+preText+')';return{Text:valueText,ArrayText:aryText};}if(value==null)return null;if(item.DataType=="HistoryData-Vol"){value=value.Vol;valueText=this.FormatValue(value,item);}else if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);}else if(item.DataType=="MULTI_POINT_LINE"){valueText=this.FromatMultiDataLine(value,item);if(!valueText)return null;}else if(item.DataType=="ChartStackedBar"){aryText=this.FromatStackedBarTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="DRAWKLINE"){aryText=this.FromatKLineTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(g_ScriptIndexChartFactory.Has(item.DataType))//外部挂接
6043
+ {preVaildItem=this.GetPreVaildItem(item.Data.Data,dataIndex);if(!preVaildItem)return null;preText=this.FormatValue(preVaildItem.Item,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,preText);if(dyValue)preText=dyValue;}valueText='--('+preText+')';return{Text:valueText,ArrayText:aryText};}if(value==null)return null;if(item.DataType=="HistoryData-Vol"){value=value.Vol;valueText=this.FormatValue(value,item);}else if(item.DataType=="MultiReport"){valueText=this.FormatMultiReport(value,item);}else if(item.DataType=="MULTI_POINT_LINE"){valueText=this.FromatMultiDataLine(value,item);if(!valueText)return null;}else if(item.DataType=="ChartStackedBar"){aryText=this.FromatStackedBarTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="DRAWKLINE"){aryText=this.FromatKLineTitle(value,item);if(!aryText)return null;return{Text:null,ArrayText:aryText};}else if(item.DataType=="ChartIndexTitle"){var text=item.Data.Data[dataIndex];if(!IFrameSplitOperator.IsString(text))return null;return{Text:text,ArrayText:null};}else if(g_ScriptIndexChartFactory.Has(item.DataType))//外部挂接
6041
6044
  {var find=g_ScriptIndexChartFactory.Get(item.DataType);if(find&&find.FormatTitleCallback)return find.FormatTitleCallback(value,item,dataIndex);}else{if(this.GetEventCallback){var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_INDEX_OUT_TEXT);if(event){var data={Item:item,Index:titleIndex,Data:this.Data,FrameID:this.Frame.Identify,DataIndex:dataIndex,Value:value,Out:null};event.Callback(event,data,this);if(data.Out)return data.Out;}}if(item.DataType=="ChartBand")//默认不输出
6042
6045
  return null;var arrowSuper=null;//独立颜色
6043
6046
  if(this.IsShowUpDownArrow){var preValue=null;if(dataIndex-1>=0)preValue=item.Data.Data[dataIndex-1];if(IFrameSplitOperator.IsNumber(preValue)){if(preValue>value)arrowSuper={Text:'↓',TextColor:this.UpDownArrowConfig.DownColor};else if(preValue<value)arrowSuper={Text:'↑',TextColor:this.UpDownArrowConfig.UpColor};else arrowSuper={Text:'→',TextColor:this.UpDownArrowConfig.UnchangeColor};if(this.TitleArrowType==1)arrowSuper.TextColor=item.Color;}}valueText=this.FormatValue(value,item);if(item.Name){var dyValue=this.GetDynamicOutValue(item.Name,valueText);if(dyValue)valueText=dyValue;}if(arrowSuper){var outItem={Name:null,Text:valueText,Color:item.Color,TextEx:[arrowSuper]};if(item.Name){var text=item.Name;var dyTitle=this.GetDynamicOutName(item.Name);//动态标题
@@ -11792,7 +11795,8 @@ if(IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash))line.LineDash=varItem.L
11792
11795
  {}else{if(varItem.NoneName)hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);else hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);this.SetTitleData(hqChart.TitlePaint[titleIndex].Data[id],line);}this.SetChartIndexName(line);hqChart.ChartPaint.push(line);};this.CreateArea=function(hqChart,windowIndex,varItem,id){var line=new ChartArea();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;line.Identify=this.Guid;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.DownColor){line.AreaColor=varItem.DownColor;}else if(varItem.UpColor){line.AreaColor=varItem.UpColor;line.AreaDirection=1;}if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(IFrameSplitOperator.IsPlusNumber(width))line.LineWidth=width;}if(IFrameSplitOperator.IsNonEmptyArray(varItem.LineDash))line.LineDash=varItem.LineDash;//虚线
11793
11796
  if(varItem.IsShow==false)line.IsShow=false;var titleIndex=windowIndex+1;line.Data.Data=varItem.Data;if(varItem.IsShowTitle===false)//NOTEXT 不绘制标题
11794
11797
  {}else if(IFrameSplitOperator.IsString(varItem.Name)&&varItem.Name.indexOf("NOTEXT")==0)//标题中包含NOTEXT不绘制标题
11795
- {}else{if(varItem.NoneName)hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);else hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);hqChart.TitlePaint[titleIndex].Data[id].ChartClassName=line.ClassName;}this.SetChartIndexName(line);hqChart.ChartPaint.push(line);};this.CreateOverlayLine=function(hqChart,windowIndex,varItem,id,lineType){if(lineType==7)var line=new ChartStepLine();var line=new ChartSubLine();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}if(varItem.IsDotLine)line.IsDotLine=true;//虚线
11798
+ {}else{if(varItem.NoneName)hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,null,line.Color);else hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);hqChart.TitlePaint[titleIndex].Data[id].ChartClassName=line.ClassName;}this.SetChartIndexName(line);hqChart.ChartPaint.push(line);};//标题显示,没有图形
11799
+ this.CreateTitle=function(hqChart,windowIndex,varItem,id){var chart=new ChartIndexTitle();chart.Canvas=hqChart.Canvas;chart.Name=varItem.Name;chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;chart.Identify=this.Guid;if(varItem.Color)chart.Color=this.GetColor(varItem.Color);else chart.Color=this.GetDefaultColor(id);chart.Data.Data=varItem.Data;var titleIndex=windowIndex+1;var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);titleData.DataType="ChartIndexTitle";hqChart.TitlePaint[titleIndex].Data[id]=titleData;this.SetChartIndexName(chart);hqChart.ChartPaint.push(chart);};this.CreateOverlayLine=function(hqChart,windowIndex,varItem,id,lineType){if(lineType==7)var line=new ChartStepLine();var line=new ChartSubLine();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}if(varItem.IsDotLine)line.IsDotLine=true;//虚线
11796
11800
  if(varItem.IsShow==false)line.IsShow=false;var titleIndex=windowIndex+1;line.Data.Data=varItem.Data;hqChart.TitlePaint[titleIndex].Data[id]=new DynamicTitleData(line.Data,varItem.Name,line.Color);hqChart.TitlePaint[titleIndex].Data[id].ChartClassName=line.ClassName;hqChart.ChartPaint.push(line);};this.CreateSingleLine=function(hqChart,windowIndex,varItem,id,lineType){var line=new ChartSingleLine();line.Canvas=hqChart.Canvas;line.DrawType=1;line.Name=varItem.Name;line.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;line.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;line.Identify=this.Guid;if(varItem.Color)line.Color=this.GetColor(varItem.Color);else line.Color=this.GetDefaultColor(id);if(varItem.LineWidth){var width=parseInt(varItem.LineWidth.replace("LINETHICK",""));if(!isNaN(width)&&width>0)line.LineWidth=width;}if(varItem.IsDotLine)line.IsDotLine=true;//虚线
11797
11801
  if(varItem.IsShow==false)line.IsShow=false;var titleIndex=windowIndex+1;line.Data.Data=varItem.Data;this.ReloadChartResource(hqChart,windowIndex,line);if(varItem.IsShowTitle===false)//NOTEXT 不绘制标题
11798
11802
  {}else if(IFrameSplitOperator.IsString(varItem.Name)&&varItem.Name.indexOf("NOTEXT")==0)//标题中包含NOTEXT不绘制标题
@@ -11869,7 +11873,8 @@ if(this.YSplitScale)hqChart.Frame.SubFrame[windowIndex].Frame.YSplitScale=this.Y
11869
11873
  */for(var _i130=0;_i130<this.OutVar.length;++_i130){var _item26=this.OutVar[_i130];if(_item26.IsExData===true)continue;//扩展数据不显示图形
11870
11874
  if(_item26.Type==1000||_item26.Type==1001)continue;//数据集合, 字符串
11871
11875
  if(_item26.Type==0){if(_item26.IsOverlayLine)this.CreateOverlayLine(hqChart,windowIndex,_item26,_i130,_item26.Type);else if(_item26.IsSingleLine)this.CreateSingleLine(hqChart,windowIndex,_item26,_i130,_item26.Type);else this.CreateLine(hqChart,windowIndex,_item26,_i130,_item26.Type);}else if(_item26.Type==1){switch(_item26.Draw.DrawType){case'STICKLINE':this.CreateBar(hqChart,windowIndex,_item26,_i130);break;case'DRAWTEXT':this.CreateDrawTextV2(hqChart,windowIndex,_item26,_i130);break;case'SUPERDRAWTEXT':this.CreateText(hqChart,windowIndex,_item26,_i130);break;case'DRAWLINE':this.CreateStraightLine(hqChart,windowIndex,_item26,_i130);break;case'DRAWBAND':this.CreateBand(hqChart,windowIndex,_item26,_i130);break;case"FILLRGN":this.CreateFillRGN(hqChart,windowIndex,_item26,_i130);break;case"FILLRGN2":this.CreateFillRGN2(hqChart,windowIndex,_item26,_i130);break;case"FILLTOPRGN":case"FILLBOTTOMRGN":case"FILLVERTICALRGN":this.CreateFillBGRGN(hqChart,windowIndex,_item26,_i130);break;case"FLOATRGN":this.CreateFLOATRGN(hqChart,windowIndex,_item26,_i130);break;case'DRAWKLINE':case"DRAWKLINE1":this.CreateKLine(hqChart,windowIndex,_item26,_i130);break;case"DRAWOVERLAYKLINE":this.CreateOverlayKLine(hqChart,windowIndex,_item26,_i130);break;case"DRAWCOLORKLINE":this.CreateDrawColorKLine(hqChart,windowIndex,_item26,_i130);break;case'DRAWKLINE_IF':this.CreateKLine(hqChart,windowIndex,_item26,_i130);break;case'POLYLINE':this.CreatePolyLine(hqChart,windowIndex,_item26,_i130);break;case'DRAWGBK':case"DRAWGBK2":this.CreateBackgroud(hqChart,windowIndex,_item26,_i130);break;case"DRAWGBK_DIV":this.CreateBackgroundDiv(hqChart,windowIndex,_item26,_i130);break;case'DRAWTEXT_LINE':this.CreateTextLine(hqChart,windowIndex,_item26,_i130);break;case'DRAWNUMBER':this.CreateDrawNumber(hqChart,windowIndex,_item26,_i130);break;case"DRAWNUMBER_FIX":case'DRAWTEXT_FIX':this.CreateNumberText(hqChart,windowIndex,_item26,_i130);break;case'DRAWICON':this.CreateIcon(hqChart,windowIndex,_item26,_i130);break;case"ICON":this.CreateIcon(hqChart,windowIndex,_item26,_i130);break;case"TIPICON":this.CreateTipIcon(hqChart,windowIndex,_item26,_i130);break;case'DRAWCHANNEL':this.CreateChannel(hqChart,windowIndex,_item26,_i130);break;case'PARTLINE':this.CreatePartLine(hqChart,windowIndex,_item26,_i130);break;case'DRAWRECTREL':this.CreateRectangle(hqChart,windowIndex,_item26,_i130);break;case"DRAWTEXTABS":case"DRAWTEXTREL":this.CreateDrawText(hqChart,windowIndex,_item26,_i130);break;case"DRAWOVERLAYLINE":this.CreateScriptOverlayLine(hqChart,windowIndex,_item26,_i130);break;case"DRAWSL":this.CreateChartSlopeLine(hqChart,windowIndex,_item26,_i130);break;case"VERTLINE":this.CreateChartVericaltLine(hqChart,windowIndex,_item26,_i130);break;case"HORLINE":this.CreateChartHorizontalLine(hqChart,windowIndex,_item26,_i130);break;case'MULTI_LINE':this.CreateMultiLine(hqChart,windowIndex,_item26,_i130);break;case"MULTI_POINT":this.CreateMultiPoint(hqChart,windowIndex,_item26,_i130);break;case'MULTI_BAR':this.CreateMultiBar(hqChart,windowIndex,_item26,_i130);break;case'MULTI_TEXT':this.CreateMultiText(hqChart,windowIndex,_item26,_i130);break;case'MULTI_SVGICON':this.CreateMultiSVGIcon(hqChart,windowIndex,_item26,_i130);break;case"DRAWSVG":this.CreateChartDrawSVG(hqChart,windowIndex,_item26,_i130);break;case"MULTI_HTMLDOM":this.CreateMulitHtmlDom(hqChart,windowIndex,_item26,_i130);break;case"COLOR_KLINE":this.CreateColorKLine(hqChart,windowIndex,_item26,_i130);break;case"KLINE_BG":this.CreateBackgroud(hqChart,windowIndex,_item26,_i130);break;case"MULTI_POINT_LINE":this.CreateLineMultiData(hqChart,windowIndex,_item26,_i130);break;case"DRAW_SIMPLE_TABLE":this.CreateSimpleTable(hqChart,windowIndex,_item26,_i130);break;case"DRAW_SIMPLE_PIE":this.CreateSimplePie(hqChart,windowIndex,_item26,_i130);break;case"DRAW_SIMPLE_RADAR":this.CreateSimpleRadar(hqChart,windowIndex,_item26,_i130);break;case"DRAW_SIMPLE_DOUGHNUT":this.CreateSimpleDoughnut(hqChart,windowIndex,_item26,_i130);break;case"BUY":case"SELL":case"SELLSHORT":case"BUYSHORT":this.CreateTradeIcon(hqChart,windowIndex,_item26,_i130);break;case"DRAWLASTBARICON":case"DRAWLASTBARNUMBER":case"DRAWLASTBARTEXT":this.CreateDrawLastBarText(hqChart,windowIndex,_item26,_i130);break;case SCRIPT_CHART_NAME.OVERLAY_BARS:this.CreateStackedBar(hqChart,windowIndex,_item26,_i130);break;case SCRIPT_CHART_NAME.KLINE_TABLE:this.CreateKLineTable(hqChart,windowIndex,_item26,_i130);break;case SCRIPT_CHART_NAME.SCATTER_PLOT:this.CreateScatterPlot(hqChart,windowIndex,_item26,_i130);break;case SCRIPT_CHART_NAME.CLIP_COLOR_STICK:this.CreateClipColorStick(hqChart,windowIndex,_item26,_i130);break;default:{var find=g_ScriptIndexChartFactory.Get(_item26.Draw.DrawType);//外部挂接
11872
- if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item26,_i130,this);}break;}}else if(_item26.Type==2){this.CreateMACD(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==3){this.CreatePointDot(hqChart,windowIndex,_item26,_i130,hisData);}else if(_item26.Type==4){this.CreateLineStick(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==5){this.CreateStick(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==6){this.CreateVolStick(hqChart,windowIndex,_item26,_i130,hisData);}else if(_item26.Type==7){this.CreateLine(hqChart,windowIndex,_item26,_i130,_item26.Type);}else if(_item26.Type==8){this.CreateLine(hqChart,windowIndex,_item26,_i130,_item26.Type);}else if(_item26.Type==9){this.CreateArea(hqChart,windowIndex,_item26,_i130);}var titlePaint=hqChart.TitlePaint[windowIndex+1];if(titlePaint&&titlePaint.Data&&_i130<titlePaint.Data.length)//设置标题数值 小数位数和格式
11876
+ if(find&&find.CreateChartCallback)find.CreateChartCallback(hqChart,windowIndex,_item26,_i130,this);}break;}}else if(_item26.Type==2){this.CreateMACD(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==3){this.CreatePointDot(hqChart,windowIndex,_item26,_i130,hisData);}else if(_item26.Type==4){this.CreateLineStick(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==5){this.CreateStick(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==6){this.CreateVolStick(hqChart,windowIndex,_item26,_i130,hisData);}else if(_item26.Type==7){this.CreateLine(hqChart,windowIndex,_item26,_i130,_item26.Type);}else if(_item26.Type==8){this.CreateLine(hqChart,windowIndex,_item26,_i130,_item26.Type);}else if(_item26.Type==9){this.CreateArea(hqChart,windowIndex,_item26,_i130);}else if(_item26.Type==10)//标题
11877
+ {this.CreateTitle(hqChart,windowIndex,_item26,_i130);}var titlePaint=hqChart.TitlePaint[windowIndex+1];if(titlePaint&&titlePaint.Data&&_i130<titlePaint.Data.length)//设置标题数值 小数位数和格式
11873
11878
  {if(this.StringFormat>0)titlePaint.Data[_i130].StringFormat=this.StringFormat;if(this.FloatPrecision>=0)titlePaint.Data[_i130].FloatPrecision=this.FloatPrecision;if(this.OutName&&this.OutName.length>0&&this.Arguments&&this.Arguments.length>0){titlePaint.SetDynamicTitle(this.OutName,this.Arguments);}}}var titleIndex=windowIndex+1;var titlePaint=hqChart.TitlePaint[titleIndex];titlePaint.Title=this.Name;titlePaint.Identify=this.Guid;//指标ID
11874
11879
  titlePaint.ArgumentsText=null;titlePaint.Script=this;titlePaint.IsShowMainIndexTitle=this.IsShowIndexTitle;if(!this.IsShortTitle){var indexParam='';for(var _i131=0;_i131<this.Arguments.length;++_i131){var _item27=this.Arguments[_i131];if(indexParam.length>0)indexParam+=',';indexParam+=_item27.Value.toString();}if(indexParam.length>0)titlePaint.ArgumentsText='('+indexParam+')';}if(this.TitleFont)titlePaint.Font=this.TitleFont;return true;};//给一个默认的颜色
11875
11880
  this.GetDefaultColor=function(id){var COLOR_ARRAY=null;//使用全局线段配置
@@ -14200,10 +14205,10 @@ this.UpdatMultiSVGIconV2Tooltip=function(data){var tooltipData=data.Tooltip;if(!
14200
14205
  this.UpdatChartOXTooltip=function(data){var tooltipData=data.Tooltip;if(!tooltipData.Data||!tooltipData.Data.Data)return;var item=tooltipData.Data.Data;var period=this.HQChart.Period;var aryText=[];if(ChartData.IsDayPeriod(period,true)){var strStartDate=IFrameSplitOperator.FormatDateString(item.Start.Date,"YYYY-MM-DD");var strEndDate=IFrameSplitOperator.FormatDateString(item.End.Date,"YYYY-MM-DD");aryText.push({Title:"起始时间",Text:strStartDate,Color:this.ValueColor});aryText.push({Title:"结束时间",Text:strEndDate,Color:this.ValueColor});}else if(ChartData.IsMinutePeriod(period,true)){var strStartDate=IFrameSplitOperator.FormatDateString(item.Start.Date);var strStartTime=IFrameSplitOperator.FormatTimeString(item.Start.Time,"HH:MM");var strEndDate=IFrameSplitOperator.FormatDateString(item.End.Date);var strEndTime=IFrameSplitOperator.FormatTimeString(item.End.Time,"HH:MM");aryText.push({Title:"起始时间",Text:strStartDate+' '+strStartTime,Color:this.ValueColor});aryText.push({Title:"结束时间",Text:strEndDate+' '+strEndTime,Color:this.ValueColor});}this.AryText=aryText;this.UpdateTableDOM();this.ShowTooltip(data);};//表头图标
14201
14206
  this.ReportHeaderIconTooltip=function(data){var tooltipData=data.Tooltip;if(!tooltipData.Data||!IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText))return;this.AryText=tooltipData.Data.AryText;this.UpdateTableDOM();this.ShowTooltip(data);};//表格单元格截断内容
14202
14207
  this.ReportCellTruncateTooltip=function(data){var tooltipData=data.Tooltip;if(!tooltipData.Data||!IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText))return;var item=tooltipData.Data.AryText[0];if(!item.Text)return;this.AryText=[{Title:item.Text,IsMergeCell:true}];this.UpdateTableDOM();this.ShowTooltip(data);};this.TReportIconTooltip=function(data){var tooltipData=data.Tooltip;if(!tooltipData.Data||!IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText))return;this.AryText=tooltipData.Data.AryText;this.UpdateTableDOM();this.ShowTooltip(data);};this.UpdateTableDOM=function(){var index=0;for(index=0;index<this.AryText.length&&index<this.MaxRowCount;++index){var outItem=this.AryText[index];var item=this.AryData[index];if(outItem.HTMLTitle)item.TitleSpan.innerHTML=outItem.HTMLTitle;else item.TitleSpan.innerText=outItem.Title;item.TitleSpan.style.color=this.TextColor;if(outItem.HTMLText)item.TextSpan.innerHTML=outItem.HTMLText;else item.TextSpan.innerText=outItem.Text;item.TextSpan.style.color=outItem.Color;item.TextTd.style.color=outItem.Color;if(outItem.ClassName){item.TextSpan.className=outItem.ClassName;}else{if(item.TextSpan.className!=this.ValueAlign.Right)item.TextSpan.className=this.ValueAlign.Right;}if(outItem.IsMergeCell)//合并单元格
14203
- {item.TitleTd.colspan=2;item.TextTd.style.display="none";}else{if(item.TitleTd.colspan!=1)item.TitleTd.colspan=1;item.TextTd.style.display="";}item.Tr.style.display="";if(item.Tr2)item.Tr2.style.display="none";}for(;index<this.MaxRowCount;++index){var item=this.AryData[index];item.Tr.style.display="none";if(item.Tr2)item.Tr2.style.display="none";}};this.GetFormatKLineTooltipText=function(kItem){var data=kItem.Item;var symbol=kItem.Symbol;var upperSymbol=symbol.toUpperCase();var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
14208
+ {item.TitleTd.colspan=2;item.TextTd.style.display="none";}else{if(item.TitleTd.colspan!=1)item.TitleTd.colspan=1;item.TextTd.style.display="";}item.Tr.style.display="";if(item.Tr2)item.Tr2.style.display="none";}for(;index<this.MaxRowCount;++index){var item=this.AryData[index];item.Tr.style.display="none";if(item.Tr2)item.Tr2.style.display="none";}};this.GetFormatKLineTooltipText=function(kItem){var data=kItem.Item;var symbol=kItem.Symbol;if(data&&data.Symbol)symbol=symbol;var upperSymbol="";if(symbol)upperSymbol=symbol.toUpperCase();var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
14204
14209
  var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);//日期
14205
14210
  var dateItem=this.ForamtDate(data.Date,"YYYY/MM/DD/W",'FloatTooltip-Date');//时间
14206
- var timeItem=null;if(IFrameSplitOperator.IsNumber(data.Time))timeItem=this.FormatTime(data.Time,this.HQChart.Period,null,'FloatTooltip-Time');var overlayItem=null;if(kItem.IsOverlay||kItem.IsIndexKLine&&kItem.Name)overlayItem={Title:"",Text:kItem.Name,Color:this.TextColor,ClassName:this.ValueAlign.Left};var yClose=data.YClose;//昨收价|昨结算价
14211
+ var timeItem=null;if(IFrameSplitOperator.IsNumber(data.Time))timeItem=this.FormatTime(data.Time,this.HQChart.Period,null,'FloatTooltip-Time');var overlayItem=null;if(kItem.IsOverlay)overlayItem={Title:"",Text:kItem.Name,Color:this.TextColor,ClassName:this.ValueAlign.Left};else if(kItem.IsIndexKLine){if(kItem.Name)overlayItem={Title:"",Text:kItem.Name,Color:this.TextColor,ClassName:this.ValueAlign.Left};else if(data&&data.Name)overlayItem={Title:"",Text:data.Name,Color:this.TextColor,ClassName:this.ValueAlign.Left};}var yClose=data.YClose;//昨收价|昨结算价
14207
14212
  var aryText=[this.ForamtPrice(data.Open,yClose,defaultfloatPrecision,'FloatTooltip-Open'),this.ForamtPrice(data.High,yClose,defaultfloatPrecision,'FloatTooltip-High'),this.ForamtPrice(data.Low,yClose,defaultfloatPrecision,'FloatTooltip-Low'),this.ForamtPrice(data.Close,yClose,defaultfloatPrecision,'FloatTooltip-Close'),this.ForamtPrice(data.YClose,data.YClose,defaultfloatPrecision,'FloatTooltip-YClose'),this.FormatVol(data.Vol/unit,'FloatTooltip-Vol'),this.FormatAmount(data.Amount,'FloatTooltip-Amount'),this.FormatIncrease(data.Close,yClose,defaultfloatPrecision,'FloatTooltip-Increase'),this.FormatAmplitude(data.High,data.Low,yClose,defaultfloatPrecision,'FloatTooltip-Amplitude')];if(timeItem)aryText.unshift(timeItem);aryText.unshift(dateItem);if(overlayItem)aryText.unshift(overlayItem);//换手率
14208
14213
  if(IFrameSplitOperator.IsNumber(data.FlowCapital)){aryText.push(this.FormatExchange(data.Vol,data.FlowCapital,'FloatTooltip-Exchange'));}//持仓量 结算价
14209
14214
  if(MARKET_SUFFIX_NAME.IsFutures(upperSymbol)){aryText.push(this.FormatPosition(data.Position,'FloatTooltip-Position'));aryText.push(this.ForamtFClose(data.FClose,defaultfloatPrecision,'FloatTooltip-FClose'));aryText.push(this.ForamtFClose(data.YFClose,defaultfloatPrecision,'FloatTooltip-YSettlePrice'));}var event=this.HQChart.GetEventCallback(JSCHART_EVENT_ID.ON_FORMAT_KLINE_FLOAT_TOOLTIP);if(event&&event.Callback){var sendData={AryText:aryText,Data:kItem,HQChart:this.HQChart};event.Callback(event,sendData,this);}return aryText;};//信息地雷
@@ -14363,7 +14368,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
14363
14368
  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);};}/********************************************************************************
14364
14369
  * 版本信息输出
14365
14370
  *
14366
- */var HQCHART_VERSION="1.1.14486";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();//把给外界调用的方法暴露出来
14371
+ */var HQCHART_VERSION="1.1.14488";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();//把给外界调用的方法暴露出来
14367
14372
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
14368
14373
  // BaseIndex:BaseIndex,
14369
14374
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14487",
3
+ "version": "1.1.14489",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -1555,7 +1555,10 @@ function JSFloatTooltip()
1555
1555
  {
1556
1556
  var data=kItem.Item;
1557
1557
  var symbol=kItem.Symbol;
1558
- var upperSymbol=symbol.toUpperCase();
1558
+ if (data && data.Symbol) symbol=symbol;
1559
+ var upperSymbol="";
1560
+ if (symbol) upperSymbol=symbol.toUpperCase();
1561
+
1559
1562
  var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
1560
1563
  var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
1561
1564
 
@@ -1567,9 +1570,15 @@ function JSFloatTooltip()
1567
1570
  if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'FloatTooltip-Time');
1568
1571
 
1569
1572
  var overlayItem=null;
1570
- if (kItem.IsOverlay || (kItem.IsIndexKLine && kItem.Name))
1573
+ if (kItem.IsOverlay)
1571
1574
  overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
1572
-
1575
+ else if (kItem.IsIndexKLine)
1576
+ {
1577
+ if (kItem.Name)
1578
+ overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
1579
+ else if (data && data.Name )
1580
+ overlayItem={ Title:"", Text:data.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
1581
+ }
1573
1582
 
1574
1583
 
1575
1584
  var yClose=data.YClose; //昨收价|昨结算价
@@ -58354,6 +58354,9 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58354
58354
  IsShowTitle:true,
58355
58355
  };
58356
58356
 
58357
+
58358
+ var textData={ name:"", type:10, color:"rgb(148,0,211)", data:[], isshow:false }; //名字
58359
+
58357
58360
  var aryDate=[];
58358
58361
  var aryTime=[];
58359
58362
  for(var i=100;i<kData.Data.length-100;++i)
@@ -58374,14 +58377,16 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58374
58377
  klineData.Draw.DrawData.push(newItem);
58375
58378
 
58376
58379
  aryDate.push(kItem.Date);
58377
- aryTime.push(kItem.Time)
58380
+ aryTime.push(kItem.Time);
58381
+
58382
+ textData.data.push(kItem.YClose.toFixed(2));
58378
58383
  }
58379
58384
 
58380
58385
  var apiData=
58381
58386
  {
58382
58387
  code:0,
58383
58388
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
58384
- outdata: { date:aryDate, time:aryTime, outvar:[klineData] }
58389
+ outdata: { date:aryDate, time:aryTime, outvar:[textData, klineData] }
58385
58390
  };
58386
58391
 
58387
58392
  console.log('[HQData.APIIndex_DRAWKLINE] apiData ', apiData);
@@ -20745,7 +20745,7 @@ function ScriptIndex(name,script,args,option)
20745
20745
  hqChart.ChartPaint.push(line);
20746
20746
  }
20747
20747
 
20748
- this.CreateArea=function(hqChart, windowIndex, varItem, id,)
20748
+ this.CreateArea=function(hqChart, windowIndex, varItem, id)
20749
20749
  {
20750
20750
  var line=new ChartArea();
20751
20751
 
@@ -20801,6 +20801,29 @@ function ScriptIndex(name,script,args,option)
20801
20801
  hqChart.ChartPaint.push(line);
20802
20802
  }
20803
20803
 
20804
+ //标题显示,没有图形
20805
+ this.CreateTitle=function(hqChart, windowIndex, varItem, id)
20806
+ {
20807
+ var chart=new ChartIndexTitle();
20808
+
20809
+ chart.Canvas=hqChart.Canvas;
20810
+ chart.Name=varItem.Name;
20811
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
20812
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
20813
+ chart.Identify=this.Guid;
20814
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
20815
+ else chart.Color=this.GetDefaultColor(id);
20816
+ chart.Data.Data=varItem.Data;
20817
+
20818
+ var titleIndex=windowIndex+1;
20819
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
20820
+ titleData.DataType="ChartIndexTitle";
20821
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
20822
+
20823
+ this.SetChartIndexName(chart);
20824
+ hqChart.ChartPaint.push(chart);
20825
+ }
20826
+
20804
20827
  this.CreateOverlayLine=function(hqChart,windowIndex,varItem,id,lineType)
20805
20828
  {
20806
20829
  if (lineType==7) var line=new ChartStepLine();
@@ -22644,6 +22667,10 @@ function ScriptIndex(name,script,args,option)
22644
22667
  {
22645
22668
  this.CreateArea(hqChart,windowIndex,item,i);
22646
22669
  }
22670
+ else if (item.Type==10) //标题
22671
+ {
22672
+ this.CreateTitle(hqChart,windowIndex,item,i);
22673
+ }
22647
22674
 
22648
22675
  var titlePaint=hqChart.TitlePaint[windowIndex+1];
22649
22676
  if (titlePaint && titlePaint.Data && i<titlePaint.Data.length) //设置标题数值 小数位数和格式
@@ -33403,6 +33403,28 @@ function ChartLine()
33403
33403
  }
33404
33404
  }
33405
33405
 
33406
+
33407
+ //标题
33408
+ function ChartIndexTitle()
33409
+ {
33410
+ this.newMethod=IChartPainting; //派生
33411
+ this.newMethod();
33412
+ delete this.newMethod;
33413
+
33414
+ this.ClassName='ChartIndexTitle'; //类名
33415
+
33416
+ this.Draw=function()
33417
+ {
33418
+
33419
+ }
33420
+
33421
+ this.GetMaxMin=function()
33422
+ {
33423
+ return range={ Min:null, Max:null };
33424
+ }
33425
+ }
33426
+
33427
+
33406
33428
  //面积图 支持横屏
33407
33429
  function ChartArea()
33408
33430
  {
@@ -58579,6 +58601,7 @@ function DynamicChartTitlePainting()
58579
58601
  if (!aryText) return null;
58580
58602
  return { Text:null, ArrayText:aryText };
58581
58603
  }
58604
+
58582
58605
 
58583
58606
  value=item.Data.Data[dataIndex];
58584
58607
 
@@ -58627,6 +58650,12 @@ function DynamicChartTitlePainting()
58627
58650
  if (!aryText) return null;
58628
58651
  return { Text:null, ArrayText:aryText };
58629
58652
  }
58653
+ else if (item.DataType=="ChartIndexTitle")
58654
+ {
58655
+ var text=item.Data.Data[dataIndex];
58656
+ if (!IFrameSplitOperator.IsString(text)) return null;
58657
+ return { Text:text, ArrayText:null };
58658
+ }
58630
58659
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
58631
58660
  {
58632
58661
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -2840,6 +2840,9 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
2840
2840
  IsShowTitle:true,
2841
2841
  };
2842
2842
 
2843
+
2844
+ var textData={ name:"", type:10, color:"rgb(148,0,211)", data:[], isshow:false }; //名字
2845
+
2843
2846
  var aryDate=[];
2844
2847
  var aryTime=[];
2845
2848
  for(var i=100;i<kData.Data.length-100;++i)
@@ -2860,14 +2863,16 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
2860
2863
  klineData.Draw.DrawData.push(newItem);
2861
2864
 
2862
2865
  aryDate.push(kItem.Date);
2863
- aryTime.push(kItem.Time)
2866
+ aryTime.push(kItem.Time);
2867
+
2868
+ textData.data.push(kItem.YClose.toFixed(2));
2864
2869
  }
2865
2870
 
2866
2871
  var apiData=
2867
2872
  {
2868
2873
  code:0,
2869
2874
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
2870
- outdata: { date:aryDate, time:aryTime, outvar:[klineData] }
2875
+ outdata: { date:aryDate, time:aryTime, outvar:[textData, klineData] }
2871
2876
  };
2872
2877
 
2873
2878
  console.log('[HQData.APIIndex_DRAWKLINE] apiData ', apiData);
@@ -37328,6 +37328,28 @@ function ChartLine()
37328
37328
  }
37329
37329
  }
37330
37330
 
37331
+
37332
+ //标题
37333
+ function ChartIndexTitle()
37334
+ {
37335
+ this.newMethod=IChartPainting; //派生
37336
+ this.newMethod();
37337
+ delete this.newMethod;
37338
+
37339
+ this.ClassName='ChartIndexTitle'; //类名
37340
+
37341
+ this.Draw=function()
37342
+ {
37343
+
37344
+ }
37345
+
37346
+ this.GetMaxMin=function()
37347
+ {
37348
+ return range={ Min:null, Max:null };
37349
+ }
37350
+ }
37351
+
37352
+
37331
37353
  //面积图 支持横屏
37332
37354
  function ChartArea()
37333
37355
  {
@@ -62504,6 +62526,7 @@ function DynamicChartTitlePainting()
62504
62526
  if (!aryText) return null;
62505
62527
  return { Text:null, ArrayText:aryText };
62506
62528
  }
62529
+
62507
62530
 
62508
62531
  value=item.Data.Data[dataIndex];
62509
62532
 
@@ -62552,6 +62575,12 @@ function DynamicChartTitlePainting()
62552
62575
  if (!aryText) return null;
62553
62576
  return { Text:null, ArrayText:aryText };
62554
62577
  }
62578
+ else if (item.DataType=="ChartIndexTitle")
62579
+ {
62580
+ var text=item.Data.Data[dataIndex];
62581
+ if (!IFrameSplitOperator.IsString(text)) return null;
62582
+ return { Text:text, ArrayText:null };
62583
+ }
62555
62584
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
62556
62585
  {
62557
62586
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -123089,7 +123118,7 @@ function ScriptIndex(name,script,args,option)
123089
123118
  hqChart.ChartPaint.push(line);
123090
123119
  }
123091
123120
 
123092
- this.CreateArea=function(hqChart, windowIndex, varItem, id,)
123121
+ this.CreateArea=function(hqChart, windowIndex, varItem, id)
123093
123122
  {
123094
123123
  var line=new ChartArea();
123095
123124
 
@@ -123145,6 +123174,29 @@ function ScriptIndex(name,script,args,option)
123145
123174
  hqChart.ChartPaint.push(line);
123146
123175
  }
123147
123176
 
123177
+ //标题显示,没有图形
123178
+ this.CreateTitle=function(hqChart, windowIndex, varItem, id)
123179
+ {
123180
+ var chart=new ChartIndexTitle();
123181
+
123182
+ chart.Canvas=hqChart.Canvas;
123183
+ chart.Name=varItem.Name;
123184
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
123185
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
123186
+ chart.Identify=this.Guid;
123187
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
123188
+ else chart.Color=this.GetDefaultColor(id);
123189
+ chart.Data.Data=varItem.Data;
123190
+
123191
+ var titleIndex=windowIndex+1;
123192
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
123193
+ titleData.DataType="ChartIndexTitle";
123194
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
123195
+
123196
+ this.SetChartIndexName(chart);
123197
+ hqChart.ChartPaint.push(chart);
123198
+ }
123199
+
123148
123200
  this.CreateOverlayLine=function(hqChart,windowIndex,varItem,id,lineType)
123149
123201
  {
123150
123202
  if (lineType==7) var line=new ChartStepLine();
@@ -124988,6 +125040,10 @@ function ScriptIndex(name,script,args,option)
124988
125040
  {
124989
125041
  this.CreateArea(hqChart,windowIndex,item,i);
124990
125042
  }
125043
+ else if (item.Type==10) //标题
125044
+ {
125045
+ this.CreateTitle(hqChart,windowIndex,item,i);
125046
+ }
124991
125047
 
124992
125048
  var titlePaint=hqChart.TitlePaint[windowIndex+1];
124993
125049
  if (titlePaint && titlePaint.Data && i<titlePaint.Data.length) //设置标题数值 小数位数和格式
@@ -144078,7 +144134,7 @@ function ScrollBarBGChart()
144078
144134
 
144079
144135
 
144080
144136
 
144081
- var HQCHART_VERSION="1.1.14486";
144137
+ var HQCHART_VERSION="1.1.14488";
144082
144138
 
144083
144139
  function PrintHQChartVersion()
144084
144140
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14486";
8
+ var HQCHART_VERSION="1.1.14488";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -58372,6 +58372,9 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58372
58372
  IsShowTitle:true,
58373
58373
  };
58374
58374
 
58375
+
58376
+ var textData={ name:"", type:10, color:"rgb(148,0,211)", data:[], isshow:false }; //名字
58377
+
58375
58378
  var aryDate=[];
58376
58379
  var aryTime=[];
58377
58380
  for(var i=100;i<kData.Data.length-100;++i)
@@ -58392,14 +58395,16 @@ HQData.APIIndex_DRAWKLINE=function(data, callback)
58392
58395
  klineData.Draw.DrawData.push(newItem);
58393
58396
 
58394
58397
  aryDate.push(kItem.Date);
58395
- aryTime.push(kItem.Time)
58398
+ aryTime.push(kItem.Time);
58399
+
58400
+ textData.data.push(kItem.YClose.toFixed(2));
58396
58401
  }
58397
58402
 
58398
58403
  var apiData=
58399
58404
  {
58400
58405
  code:0,
58401
58406
  stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
58402
- outdata: { date:aryDate, time:aryTime, outvar:[klineData] }
58407
+ outdata: { date:aryDate, time:aryTime, outvar:[textData, klineData] }
58403
58408
  };
58404
58409
 
58405
58410
  console.log('[HQData.APIIndex_DRAWKLINE] apiData ', apiData);
@@ -37372,6 +37372,28 @@ function ChartLine()
37372
37372
  }
37373
37373
  }
37374
37374
 
37375
+
37376
+ //标题
37377
+ function ChartIndexTitle()
37378
+ {
37379
+ this.newMethod=IChartPainting; //派生
37380
+ this.newMethod();
37381
+ delete this.newMethod;
37382
+
37383
+ this.ClassName='ChartIndexTitle'; //类名
37384
+
37385
+ this.Draw=function()
37386
+ {
37387
+
37388
+ }
37389
+
37390
+ this.GetMaxMin=function()
37391
+ {
37392
+ return range={ Min:null, Max:null };
37393
+ }
37394
+ }
37395
+
37396
+
37375
37397
  //面积图 支持横屏
37376
37398
  function ChartArea()
37377
37399
  {
@@ -62548,6 +62570,7 @@ function DynamicChartTitlePainting()
62548
62570
  if (!aryText) return null;
62549
62571
  return { Text:null, ArrayText:aryText };
62550
62572
  }
62573
+
62551
62574
 
62552
62575
  value=item.Data.Data[dataIndex];
62553
62576
 
@@ -62596,6 +62619,12 @@ function DynamicChartTitlePainting()
62596
62619
  if (!aryText) return null;
62597
62620
  return { Text:null, ArrayText:aryText };
62598
62621
  }
62622
+ else if (item.DataType=="ChartIndexTitle")
62623
+ {
62624
+ var text=item.Data.Data[dataIndex];
62625
+ if (!IFrameSplitOperator.IsString(text)) return null;
62626
+ return { Text:text, ArrayText:null };
62627
+ }
62599
62628
  else if (g_ScriptIndexChartFactory.Has(item.DataType)) //外部挂接
62600
62629
  {
62601
62630
  var find=g_ScriptIndexChartFactory.Get(item.DataType);
@@ -123133,7 +123162,7 @@ function ScriptIndex(name,script,args,option)
123133
123162
  hqChart.ChartPaint.push(line);
123134
123163
  }
123135
123164
 
123136
- this.CreateArea=function(hqChart, windowIndex, varItem, id,)
123165
+ this.CreateArea=function(hqChart, windowIndex, varItem, id)
123137
123166
  {
123138
123167
  var line=new ChartArea();
123139
123168
 
@@ -123189,6 +123218,29 @@ function ScriptIndex(name,script,args,option)
123189
123218
  hqChart.ChartPaint.push(line);
123190
123219
  }
123191
123220
 
123221
+ //标题显示,没有图形
123222
+ this.CreateTitle=function(hqChart, windowIndex, varItem, id)
123223
+ {
123224
+ var chart=new ChartIndexTitle();
123225
+
123226
+ chart.Canvas=hqChart.Canvas;
123227
+ chart.Name=varItem.Name;
123228
+ chart.ChartBorder=hqChart.Frame.SubFrame[windowIndex].Frame.ChartBorder;
123229
+ chart.ChartFrame=hqChart.Frame.SubFrame[windowIndex].Frame;
123230
+ chart.Identify=this.Guid;
123231
+ if (varItem.Color) chart.Color=this.GetColor(varItem.Color);
123232
+ else chart.Color=this.GetDefaultColor(id);
123233
+ chart.Data.Data=varItem.Data;
123234
+
123235
+ var titleIndex=windowIndex+1;
123236
+ var titleData=new DynamicTitleData(chart.Data,varItem.Name,chart.Color);
123237
+ titleData.DataType="ChartIndexTitle";
123238
+ hqChart.TitlePaint[titleIndex].Data[id]=titleData;
123239
+
123240
+ this.SetChartIndexName(chart);
123241
+ hqChart.ChartPaint.push(chart);
123242
+ }
123243
+
123192
123244
  this.CreateOverlayLine=function(hqChart,windowIndex,varItem,id,lineType)
123193
123245
  {
123194
123246
  if (lineType==7) var line=new ChartStepLine();
@@ -125032,6 +125084,10 @@ function ScriptIndex(name,script,args,option)
125032
125084
  {
125033
125085
  this.CreateArea(hqChart,windowIndex,item,i);
125034
125086
  }
125087
+ else if (item.Type==10) //标题
125088
+ {
125089
+ this.CreateTitle(hqChart,windowIndex,item,i);
125090
+ }
125035
125091
 
125036
125092
  var titlePaint=hqChart.TitlePaint[windowIndex+1];
125037
125093
  if (titlePaint && titlePaint.Data && i<titlePaint.Data.length) //设置标题数值 小数位数和格式
@@ -151242,7 +151298,10 @@ function JSFloatTooltip()
151242
151298
  {
151243
151299
  var data=kItem.Item;
151244
151300
  var symbol=kItem.Symbol;
151245
- var upperSymbol=symbol.toUpperCase();
151301
+ if (data && data.Symbol) symbol=symbol;
151302
+ var upperSymbol="";
151303
+ if (symbol) upperSymbol=symbol.toUpperCase();
151304
+
151246
151305
  var defaultfloatPrecision=GetfloatPrecision(symbol);//价格小数位数
151247
151306
  var unit=MARKET_SUFFIX_NAME.GetVolUnit(upperSymbol);
151248
151307
 
@@ -151254,9 +151313,15 @@ function JSFloatTooltip()
151254
151313
  if (IFrameSplitOperator.IsNumber(data.Time)) timeItem=this.FormatTime(data.Time, this.HQChart.Period, null, 'FloatTooltip-Time');
151255
151314
 
151256
151315
  var overlayItem=null;
151257
- if (kItem.IsOverlay || (kItem.IsIndexKLine && kItem.Name))
151316
+ if (kItem.IsOverlay)
151258
151317
  overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
151259
-
151318
+ else if (kItem.IsIndexKLine)
151319
+ {
151320
+ if (kItem.Name)
151321
+ overlayItem={ Title:"", Text:kItem.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
151322
+ else if (data && data.Name )
151323
+ overlayItem={ Title:"", Text:data.Name, Color:this.TextColor, ClassName:this.ValueAlign.Left };
151324
+ }
151260
151325
 
151261
151326
 
151262
151327
  var yClose=data.YClose; //昨收价|昨结算价
@@ -153898,7 +153963,7 @@ function HQChartScriptWorker()
153898
153963
 
153899
153964
 
153900
153965
 
153901
- var HQCHART_VERSION="1.1.14486";
153966
+ var HQCHART_VERSION="1.1.14488";
153902
153967
 
153903
153968
  function PrintHQChartVersion()
153904
153969
  {