hqchart 1.1.14238 → 1.1.14240

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.
@@ -4326,7 +4326,7 @@ for(var i=0;i<this.Texts.length;++i){var item=this.Texts[i];if(!item.Text)contin
4326
4326
  if(item.Line.Width>0)this.Canvas.lineWidth=item.Line.Width;//线宽
4327
4327
  this.Canvas.strokeStyle=item.Line.Color;this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(yText,ToFixedPoint(x));this.Canvas.lineTo(yPrice,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yText);this.Canvas.lineTo(ToFixedPoint(x),yPrice);}this.Canvas.stroke();this.Canvas.restore();}}}};this.Draw=function(){if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||this.Data.length<=0)return;if(!this.Texts)return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var mapText=this.GetShowTextData();if(mapText.size<=0)return;this.Canvas.save();this.ClipClient(this.IsHScreen);this.DrawAllText(mapText);this.Canvas.restore();};this.GetMaxMin=function(){var range={Min:null,Max:null};if(!this.Texts)return range;var xPointCount=this.ChartFrame.XPointCount;var start=this.Data.DataOffset;var end=start+xPointCount;for(var i in this.Texts){var item=this.Texts[i];if(!IFrameSplitOperator.IsNumber(item.Value))continue;if(item.Index>=start&&item.Index<end){if(range.Max==null)range.Max=item.Value;else if(range.Max<item.Value)range.Max=item.Value;if(range.Min==null)range.Min=item.Value;else if(range.Min>item.Value)range.Min=item.Value;}}return range;};}//图标集合(2.0) 支持横屏
4328
4328
  function ChartMultiSVGIconV2(){this.newMethod=IChartPainting;//派生
4329
- this.newMethod();delete this.newMethod;this.ClassName="ChartMultiSVGIconV2";this.AryIcon;//[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
4329
+ this.newMethod();delete this.newMethod;this.ClassName="ChartMultiSVGIconV2";this.AryIcon;//[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 }, Image:{ Data:Image图片, Width, Height } } ]
4330
4330
  this.IconSize={Max:g_JSChartResource.DRAWICON.Icon.MaxSize,Min:g_JSChartResource.DRAWICON.Icon.MinSize,//图标的最大最小值
4331
4331
  Zoom:{Type:g_JSChartResource.DRAWICON.Icon.Zoom.Type,Value:g_JSChartResource.DRAWICON.Icon.Zoom.Value//放大倍数
4332
4332
  }};this.Family;this.Color=g_JSChartResource.DefaultTextColor;this.IsHScreen=false;this.IconRect=[];//0=序号,1=区域
@@ -4335,7 +4335,8 @@ this.BuildKey=function(item){if(IFrameSplitOperator.IsNumber(item.Time))return i
4335
4335
  {if(isHScreen==true){var left=this.ChartBorder.GetLeft();var right=this.ChartBorder.GetRight();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.GetTop();var bottom=this.ChartBorder.GetBottom();}this.Canvas.beginPath();this.Canvas.rect(left,top,right-left,bottom-top);//this.Canvas.stroke(); //调试用
4336
4336
  this.Canvas.clip();};this.Draw=function(){this.IconRect=[];if(!this.IsShow||this.ChartFrame.IsMinSize||!this.IsVisible)return;if(this.IsShowIndexTitleOnly())return;if(this.IsHideScriptIndex())return;if(!this.Data||!IFrameSplitOperator.IsNonEmptyArray(this.Data.Data))return;//k线数据
4337
4337
  if(!this.Family)return;if(!this.MapCache||this.MapCache.size<=0)return;this.IsHScreen=this.ChartFrame.IsHScreen===true;var xPointCount=this.ChartFrame.XPointCount;var dataWidth=this.ChartFrame.DataWidth;var distanceWidth=this.ChartFrame.DistanceWidth;var isMinute=this.IsMinuteFrame();var border=this.GetBorder();if(this.IsHScreen){var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.BottomEx;var chartLeft=border.TopEx;}else{var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;var chartright=border.RightEx;var chartLeft=border.LeftEx;}this.Canvas.save();this.ClipClient(this.ChartFrame.IsHScreen);var fontSize=this.GetDynamicIconSize(dataWidth,distanceWidth,this.IconSize.Max,this.IconSize.Min,this.IconSize.Zoom);this.Canvas.font=fontSize+'px '+this.Family;var drawInfo={Left:chartLeft,Right:chartright,FontSize:fontSize,DataWidth:dataWidth,DistanceWidth:distanceWidth};for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length&&j<xPointCount;++i,++j,xOffset+=dataWidth+distanceWidth){var kItem=this.Data.Data[i];var key=this.BuildKey(kItem);if(!this.MapCache.has(key))continue;var mapItem=this.MapCache.get(key);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;}this.DrawItem(mapItem,kItem,x,drawInfo);}this.Canvas.restore();};this.GetKValue=function(kItem,valueName){switch(valueName){case"HIGH":case"H":return kItem.High;case"L":case"LOW":return kItem.Low;case"C":case"CLOSE":return kItem.Close;case"O":case"OPEN":return KItem.Open;default:return null;}};this.DrawItem=function(groupItem,kItem,x,drawInfo){if(!IFrameSplitOperator.IsNonEmptyArray(groupItem.Data))return;var fontSize=drawInfo.FontSize;var left=drawInfo.Left,right=drawInfo.Right;var dataWidth=drawInfo.DataWidth;//var distanceWidth=drawInfo.DistanceWidth;
4338
- for(var i=0;i<groupItem.Data.length;++i){var item=groupItem.Data[i];var value=item.Value;if(IFrameSplitOperator.IsString(item.Value))value=this.GetKValue(kItem,item.Value);if(!IFrameSplitOperator.IsNumber(value))continue;var y=this.ChartFrame.GetYFromData(item.Value,false);if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.Color;var textWidth=this.Canvas.measureText(item.Symbol).width;this.Canvas.textAlign='center';var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);if(item.Baseline==1){this.Canvas.textBaseline='top';rtIcon.Y=y;}else if(item.Baseline==2){this.Canvas.textBaseline='bottom';rtIcon.Y=y-fontSize;}else{this.Canvas.textBaseline='middle';rtIcon.Y=y-fontSize/2;}if(this.IsHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(item.Symbol,0,0);this.Canvas.restore();}else{if(IFrameSplitOperator.IsNumber(item.YMove)){y+=item.YMove;rtIcon.Y+=item.YMove;}this.Canvas.fillText(item.Symbol,x,y);if(item.Text)this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});else if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});}if(item.Line){var price=item.Line.KData=="H"?kItem.High:kItem.Low;var yPrice=this.ChartFrame.GetYFromData(price,false);var yText=y;if(Array.isArray(item.Line.Offset)&&item.Line.Offset.length==2){if(yText>yPrice)//文字在下方
4338
+ for(var i=0;i<groupItem.Data.length;++i){var item=groupItem.Data[i];var value=item.Value;if(IFrameSplitOperator.IsString(item.Value))value=this.GetKValue(kItem,item.Value);if(!IFrameSplitOperator.IsNumber(value))continue;var y=this.ChartFrame.GetYFromData(item.Value,false);if(item.Image){var imageHeight=item.Image.Height;var imageWidth=item.Image.Width;var rtIcon=new Rect(x-imageWidth/2,y-imageHeight/2,imageWidth,imageHeight);if(item.Baseline==1){this.Canvas.textBaseline='top';rtIcon.Y=y;}else if(item.Baseline==2){this.Canvas.textBaseline='bottom';rtIcon.Y=y-imageHeight;}else{this.Canvas.textBaseline='middle';rtIcon.Y=y-imageHeight/2;}if(IFrameSplitOperator.IsNumber(item.YMove)){y+=item.YMove;rtIcon.Y+=item.YMove;}this.Canvas.drawImage(item.Image.Data,rtIcon.X,rtIcon.Y,item.Image.Width,item.Image.Height);if(item.Text)this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});else if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});}else{if(item.Color)this.Canvas.fillStyle=item.Color;else this.Canvas.fillStyle=this.Color;//var textWidth=this.Canvas.measureText(item.Symbol).width;
4339
+ this.Canvas.textAlign='center';var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);if(item.Baseline==1){this.Canvas.textBaseline='top';rtIcon.Y=y;}else if(item.Baseline==2){this.Canvas.textBaseline='bottom';rtIcon.Y=y-fontSize;}else{this.Canvas.textBaseline='middle';rtIcon.Y=y-fontSize/2;}if(this.IsHScreen){this.Canvas.save();this.Canvas.translate(y,x);this.Canvas.rotate(90*Math.PI/180);this.Canvas.fillText(item.Symbol,0,0);this.Canvas.restore();}else{if(IFrameSplitOperator.IsNumber(item.YMove)){y+=item.YMove;rtIcon.Y+=item.YMove;}this.Canvas.fillText(item.Symbol,x,y);if(item.Text)this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});else if(IFrameSplitOperator.IsNonEmptyArray(item.AryText))this.IconRect.push({Rect:rtIcon,Item:item,KItem:kItem});}}if(item.Line){var price=item.Line.KData=="H"?kItem.High:kItem.Low;var yPrice=this.ChartFrame.GetYFromData(price,false);var yText=y;if(Array.isArray(item.Line.Offset)&&item.Line.Offset.length==2){if(yText>yPrice)//文字在下方
4339
4340
  {yText-=item.Line.Offset[1];yPrice+=item.Line.Offset[0];}else if(yText<yPrice){yText+=item.Line.Offset[1];yPrice-=item.Line.Offset[0];}}this.Canvas.save();if(item.Line.Dash)this.Canvas.setLineDash(item.Line.Dash);//虚线
4340
4341
  if(item.Line.Width>0)this.Canvas.lineWidth=item.Line.Width;//线宽
4341
4342
  this.Canvas.strokeStyle=item.Line.Color;this.Canvas.beginPath();if(this.IsHScreen){this.Canvas.moveTo(yText,ToFixedPoint(x));this.Canvas.lineTo(yPrice,ToFixedPoint(x));}else{this.Canvas.moveTo(ToFixedPoint(x),yText);this.Canvas.lineTo(ToFixedPoint(x),yPrice);}this.Canvas.stroke();this.Canvas.restore();}}};this.GetTooltipData=function(x,y,tooltip){if(!IFrameSplitOperator.IsNonEmptyArray(this.IconRect))return false;for(var i=0;i<this.IconRect.length;++i){var item=this.IconRect[i];if(!item.Rect)continue;var rect=item.Rect;if(rect&&rect.PtInRect(x,y)){JSConsole.Chart.Log('[ChartMultiSVGIconV2::GetTooltipData] icon ',item);tooltip.Data=item;tooltip.ChartPaint=this;tooltip.Type=4;//指标
@@ -13824,7 +13825,7 @@ hisData.Symbol=message.symbol;}var stockObj={HQDataType:HQ_DATA_TYPE.KLINE_ID,St
13824
13825
  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);};}/********************************************************************************
13825
13826
  * 版本信息输出
13826
13827
  *
13827
- */var HQCHART_VERSION="1.1.14237";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();//把给外界调用的方法暴露出来
13828
+ */var HQCHART_VERSION="1.1.14239";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();//把给外界调用的方法暴露出来
13828
13829
  exports.default=(_jsChartInit$jsChartS={jsChartInit:JSChart.Init,jsChartStyle:JSChart.SetStyle,// IsIndexSymbol:IsIndexSymbol,
13829
13830
  // BaseIndex:BaseIndex,
13830
13831
  // ChartLine:ChartLine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14238",
3
+ "version": "1.1.14240",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -40426,7 +40426,7 @@ function ChartMultiSVGIconV2()
40426
40426
  delete this.newMethod;
40427
40427
 
40428
40428
  this.ClassName="ChartMultiSVGIconV2";
40429
- this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
40429
+ this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 }, Image:{ Data:Image图片, Width, Height } } ]
40430
40430
  this.IconSize=
40431
40431
  {
40432
40432
  Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
@@ -40592,47 +40592,83 @@ function ChartMultiSVGIconV2()
40592
40592
 
40593
40593
  var y=this.ChartFrame.GetYFromData(item.Value,false);
40594
40594
 
40595
- if (item.Color) this.Canvas.fillStyle = item.Color;
40596
- else this.Canvas.fillStyle = this.Color;
40597
-
40598
- var textWidth=this.Canvas.measureText(item.Symbol).width;
40599
- this.Canvas.textAlign='center';
40600
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40601
-
40602
- if (item.Baseline==1)
40603
- {
40604
- this.Canvas.textBaseline='top';
40605
- rtIcon.Y=y;
40606
- }
40607
- else if (item.Baseline==2)
40608
- {
40609
- this.Canvas.textBaseline='bottom';
40610
- rtIcon.Y=y-fontSize;
40611
- }
40612
- else
40595
+ if (item.Image)
40613
40596
  {
40614
- this.Canvas.textBaseline = 'middle';
40615
- rtIcon.Y=y-fontSize/2;
40616
- }
40597
+ var imageHeight=item.Image.Height;
40598
+ var imageWidth=item.Image.Width;
40599
+ var rtIcon=new Rect(x-imageWidth/2,y-imageHeight/2,imageWidth,imageHeight);
40600
+ if (item.Baseline==1)
40601
+ {
40602
+ this.Canvas.textBaseline='top';
40603
+ rtIcon.Y=y;
40604
+ }
40605
+ else if (item.Baseline==2)
40606
+ {
40607
+ this.Canvas.textBaseline='bottom';
40608
+ rtIcon.Y=y-imageHeight;
40609
+ }
40610
+ else
40611
+ {
40612
+ this.Canvas.textBaseline = 'middle';
40613
+ rtIcon.Y=y-imageHeight/2;
40614
+ }
40617
40615
 
40618
- if (this.IsHScreen)
40619
- {
40620
- this.Canvas.save();
40621
- this.Canvas.translate(y, x);
40622
- this.Canvas.rotate(90 * Math.PI / 180);
40623
- this.Canvas.fillText(item.Symbol,0,0);
40624
- this.Canvas.restore();
40625
- }
40626
- else
40627
- {
40628
40616
  if (IFrameSplitOperator.IsNumber(item.YMove))
40629
40617
  {
40630
40618
  y+=item.YMove;
40631
40619
  rtIcon.Y+=item.YMove;
40632
40620
  }
40633
- this.Canvas.fillText(item.Symbol, x, y);
40621
+
40622
+ this.Canvas.drawImage(item.Image.Data, rtIcon.X, rtIcon.Y, item.Image.Width, item.Image.Height);
40623
+
40634
40624
  if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40635
40625
  else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40626
+
40627
+ }
40628
+ else
40629
+ {
40630
+ if (item.Color) this.Canvas.fillStyle = item.Color;
40631
+ else this.Canvas.fillStyle = this.Color;
40632
+
40633
+ //var textWidth=this.Canvas.measureText(item.Symbol).width;
40634
+ this.Canvas.textAlign='center';
40635
+ var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
40636
+
40637
+ if (item.Baseline==1)
40638
+ {
40639
+ this.Canvas.textBaseline='top';
40640
+ rtIcon.Y=y;
40641
+ }
40642
+ else if (item.Baseline==2)
40643
+ {
40644
+ this.Canvas.textBaseline='bottom';
40645
+ rtIcon.Y=y-fontSize;
40646
+ }
40647
+ else
40648
+ {
40649
+ this.Canvas.textBaseline = 'middle';
40650
+ rtIcon.Y=y-fontSize/2;
40651
+ }
40652
+
40653
+ if (this.IsHScreen)
40654
+ {
40655
+ this.Canvas.save();
40656
+ this.Canvas.translate(y, x);
40657
+ this.Canvas.rotate(90 * Math.PI / 180);
40658
+ this.Canvas.fillText(item.Symbol,0,0);
40659
+ this.Canvas.restore();
40660
+ }
40661
+ else
40662
+ {
40663
+ if (IFrameSplitOperator.IsNumber(item.YMove))
40664
+ {
40665
+ y+=item.YMove;
40666
+ rtIcon.Y+=item.YMove;
40667
+ }
40668
+ this.Canvas.fillText(item.Symbol, x, y);
40669
+ if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40670
+ else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
40671
+ }
40636
40672
  }
40637
40673
 
40638
40674
  if (item.Line)
@@ -44351,7 +44351,7 @@ function ChartMultiSVGIconV2()
44351
44351
  delete this.newMethod;
44352
44352
 
44353
44353
  this.ClassName="ChartMultiSVGIconV2";
44354
- this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
44354
+ this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 }, Image:{ Data:Image图片, Width, Height } } ]
44355
44355
  this.IconSize=
44356
44356
  {
44357
44357
  Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
@@ -44517,47 +44517,83 @@ function ChartMultiSVGIconV2()
44517
44517
 
44518
44518
  var y=this.ChartFrame.GetYFromData(item.Value,false);
44519
44519
 
44520
- if (item.Color) this.Canvas.fillStyle = item.Color;
44521
- else this.Canvas.fillStyle = this.Color;
44522
-
44523
- var textWidth=this.Canvas.measureText(item.Symbol).width;
44524
- this.Canvas.textAlign='center';
44525
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
44526
-
44527
- if (item.Baseline==1)
44528
- {
44529
- this.Canvas.textBaseline='top';
44530
- rtIcon.Y=y;
44531
- }
44532
- else if (item.Baseline==2)
44533
- {
44534
- this.Canvas.textBaseline='bottom';
44535
- rtIcon.Y=y-fontSize;
44536
- }
44537
- else
44520
+ if (item.Image)
44538
44521
  {
44539
- this.Canvas.textBaseline = 'middle';
44540
- rtIcon.Y=y-fontSize/2;
44541
- }
44522
+ var imageHeight=item.Image.Height;
44523
+ var imageWidth=item.Image.Width;
44524
+ var rtIcon=new Rect(x-imageWidth/2,y-imageHeight/2,imageWidth,imageHeight);
44525
+ if (item.Baseline==1)
44526
+ {
44527
+ this.Canvas.textBaseline='top';
44528
+ rtIcon.Y=y;
44529
+ }
44530
+ else if (item.Baseline==2)
44531
+ {
44532
+ this.Canvas.textBaseline='bottom';
44533
+ rtIcon.Y=y-imageHeight;
44534
+ }
44535
+ else
44536
+ {
44537
+ this.Canvas.textBaseline = 'middle';
44538
+ rtIcon.Y=y-imageHeight/2;
44539
+ }
44542
44540
 
44543
- if (this.IsHScreen)
44544
- {
44545
- this.Canvas.save();
44546
- this.Canvas.translate(y, x);
44547
- this.Canvas.rotate(90 * Math.PI / 180);
44548
- this.Canvas.fillText(item.Symbol,0,0);
44549
- this.Canvas.restore();
44550
- }
44551
- else
44552
- {
44553
44541
  if (IFrameSplitOperator.IsNumber(item.YMove))
44554
44542
  {
44555
44543
  y+=item.YMove;
44556
44544
  rtIcon.Y+=item.YMove;
44557
44545
  }
44558
- this.Canvas.fillText(item.Symbol, x, y);
44546
+
44547
+ this.Canvas.drawImage(item.Image.Data, rtIcon.X, rtIcon.Y, item.Image.Width, item.Image.Height);
44548
+
44559
44549
  if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44560
44550
  else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44551
+
44552
+ }
44553
+ else
44554
+ {
44555
+ if (item.Color) this.Canvas.fillStyle = item.Color;
44556
+ else this.Canvas.fillStyle = this.Color;
44557
+
44558
+ //var textWidth=this.Canvas.measureText(item.Symbol).width;
44559
+ this.Canvas.textAlign='center';
44560
+ var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
44561
+
44562
+ if (item.Baseline==1)
44563
+ {
44564
+ this.Canvas.textBaseline='top';
44565
+ rtIcon.Y=y;
44566
+ }
44567
+ else if (item.Baseline==2)
44568
+ {
44569
+ this.Canvas.textBaseline='bottom';
44570
+ rtIcon.Y=y-fontSize;
44571
+ }
44572
+ else
44573
+ {
44574
+ this.Canvas.textBaseline = 'middle';
44575
+ rtIcon.Y=y-fontSize/2;
44576
+ }
44577
+
44578
+ if (this.IsHScreen)
44579
+ {
44580
+ this.Canvas.save();
44581
+ this.Canvas.translate(y, x);
44582
+ this.Canvas.rotate(90 * Math.PI / 180);
44583
+ this.Canvas.fillText(item.Symbol,0,0);
44584
+ this.Canvas.restore();
44585
+ }
44586
+ else
44587
+ {
44588
+ if (IFrameSplitOperator.IsNumber(item.YMove))
44589
+ {
44590
+ y+=item.YMove;
44591
+ rtIcon.Y+=item.YMove;
44592
+ }
44593
+ this.Canvas.fillText(item.Symbol, x, y);
44594
+ if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44595
+ else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44596
+ }
44561
44597
  }
44562
44598
 
44563
44599
  if (item.Line)
@@ -140276,7 +140312,7 @@ function ScrollBarBGChart()
140276
140312
 
140277
140313
 
140278
140314
 
140279
- var HQCHART_VERSION="1.1.14237";
140315
+ var HQCHART_VERSION="1.1.14239";
140280
140316
 
140281
140317
  function PrintHQChartVersion()
140282
140318
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14237";
8
+ var HQCHART_VERSION="1.1.14239";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -44395,7 +44395,7 @@ function ChartMultiSVGIconV2()
44395
44395
  delete this.newMethod;
44396
44396
 
44397
44397
  this.ClassName="ChartMultiSVGIconV2";
44398
- this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 } } ]
44398
+ this.AryIcon; //[ {Index:, Value:, Symbol:, Color:, Baseline:, Line:{ Color:, Dash:[虚线点], KData:"H/L", Offset:[5,10], Width:线粗细 }, Image:{ Data:Image图片, Width, Height } } ]
44399
44399
  this.IconSize=
44400
44400
  {
44401
44401
  Max: g_JSChartResource.DRAWICON.Icon.MaxSize, Min:g_JSChartResource.DRAWICON.Icon.MinSize , //图标的最大最小值
@@ -44561,47 +44561,83 @@ function ChartMultiSVGIconV2()
44561
44561
 
44562
44562
  var y=this.ChartFrame.GetYFromData(item.Value,false);
44563
44563
 
44564
- if (item.Color) this.Canvas.fillStyle = item.Color;
44565
- else this.Canvas.fillStyle = this.Color;
44566
-
44567
- var textWidth=this.Canvas.measureText(item.Symbol).width;
44568
- this.Canvas.textAlign='center';
44569
- var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
44570
-
44571
- if (item.Baseline==1)
44572
- {
44573
- this.Canvas.textBaseline='top';
44574
- rtIcon.Y=y;
44575
- }
44576
- else if (item.Baseline==2)
44577
- {
44578
- this.Canvas.textBaseline='bottom';
44579
- rtIcon.Y=y-fontSize;
44580
- }
44581
- else
44564
+ if (item.Image)
44582
44565
  {
44583
- this.Canvas.textBaseline = 'middle';
44584
- rtIcon.Y=y-fontSize/2;
44585
- }
44566
+ var imageHeight=item.Image.Height;
44567
+ var imageWidth=item.Image.Width;
44568
+ var rtIcon=new Rect(x-imageWidth/2,y-imageHeight/2,imageWidth,imageHeight);
44569
+ if (item.Baseline==1)
44570
+ {
44571
+ this.Canvas.textBaseline='top';
44572
+ rtIcon.Y=y;
44573
+ }
44574
+ else if (item.Baseline==2)
44575
+ {
44576
+ this.Canvas.textBaseline='bottom';
44577
+ rtIcon.Y=y-imageHeight;
44578
+ }
44579
+ else
44580
+ {
44581
+ this.Canvas.textBaseline = 'middle';
44582
+ rtIcon.Y=y-imageHeight/2;
44583
+ }
44586
44584
 
44587
- if (this.IsHScreen)
44588
- {
44589
- this.Canvas.save();
44590
- this.Canvas.translate(y, x);
44591
- this.Canvas.rotate(90 * Math.PI / 180);
44592
- this.Canvas.fillText(item.Symbol,0,0);
44593
- this.Canvas.restore();
44594
- }
44595
- else
44596
- {
44597
44585
  if (IFrameSplitOperator.IsNumber(item.YMove))
44598
44586
  {
44599
44587
  y+=item.YMove;
44600
44588
  rtIcon.Y+=item.YMove;
44601
44589
  }
44602
- this.Canvas.fillText(item.Symbol, x, y);
44590
+
44591
+ this.Canvas.drawImage(item.Image.Data, rtIcon.X, rtIcon.Y, item.Image.Width, item.Image.Height);
44592
+
44603
44593
  if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44604
44594
  else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44595
+
44596
+ }
44597
+ else
44598
+ {
44599
+ if (item.Color) this.Canvas.fillStyle = item.Color;
44600
+ else this.Canvas.fillStyle = this.Color;
44601
+
44602
+ //var textWidth=this.Canvas.measureText(item.Symbol).width;
44603
+ this.Canvas.textAlign='center';
44604
+ var rtIcon=new Rect(x-fontSize/2,y-fontSize/2,fontSize,fontSize);
44605
+
44606
+ if (item.Baseline==1)
44607
+ {
44608
+ this.Canvas.textBaseline='top';
44609
+ rtIcon.Y=y;
44610
+ }
44611
+ else if (item.Baseline==2)
44612
+ {
44613
+ this.Canvas.textBaseline='bottom';
44614
+ rtIcon.Y=y-fontSize;
44615
+ }
44616
+ else
44617
+ {
44618
+ this.Canvas.textBaseline = 'middle';
44619
+ rtIcon.Y=y-fontSize/2;
44620
+ }
44621
+
44622
+ if (this.IsHScreen)
44623
+ {
44624
+ this.Canvas.save();
44625
+ this.Canvas.translate(y, x);
44626
+ this.Canvas.rotate(90 * Math.PI / 180);
44627
+ this.Canvas.fillText(item.Symbol,0,0);
44628
+ this.Canvas.restore();
44629
+ }
44630
+ else
44631
+ {
44632
+ if (IFrameSplitOperator.IsNumber(item.YMove))
44633
+ {
44634
+ y+=item.YMove;
44635
+ rtIcon.Y+=item.YMove;
44636
+ }
44637
+ this.Canvas.fillText(item.Symbol, x, y);
44638
+ if (item.Text) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44639
+ else if (IFrameSplitOperator.IsNonEmptyArray(item.AryText)) this.IconRect.push({ Rect:rtIcon , Item:item, KItem:kItem });
44640
+ }
44605
44641
  }
44606
44642
 
44607
44643
  if (item.Line)
@@ -149881,7 +149917,7 @@ function HQChartScriptWorker()
149881
149917
 
149882
149918
 
149883
149919
 
149884
- var HQCHART_VERSION="1.1.14237";
149920
+ var HQCHART_VERSION="1.1.14239";
149885
149921
 
149886
149922
  function PrintHQChartVersion()
149887
149923
  {