hqchart 1.1.15480 → 1.1.15503

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.
@@ -1711,6 +1711,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1711
1711
  {
1712
1712
  var item=option.Frame[i];
1713
1713
  if (!chart.Frame.SubFrame[i]) continue;
1714
+ chart.SetSubFrameAttribute(chart.Frame.SubFrame[i], null, item);
1715
+ /*
1714
1716
  if (item.SplitCount) chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitCount=item.SplitCount;
1715
1717
  if (item.StringFormat) chart.Frame.SubFrame[i].Frame.YSplitOperator.StringFormat=item.StringFormat;
1716
1718
  if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;
@@ -1720,6 +1722,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1720
1722
 
1721
1723
  if (item.IsShowLeftText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowLeftText=item.IsShowLeftText; //显示左边刻度
1722
1724
  if (item.IsShowRightText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText; //显示右边刻度
1725
+ */
1723
1726
  }
1724
1727
  }
1725
1728
 
@@ -1734,9 +1737,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1734
1737
 
1735
1738
  if(option.KLineTitle) //股票名称 日期 周期
1736
1739
  {
1737
- if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
1738
- if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
1739
- if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
1740
+ var item=option.KLineTitle;
1741
+ var chartTitle=chart.TitlePaint[0];
1742
+ if (IFrameSplitOperator.IsBool(item.IsShowName)) chartTitle.IsShowName=item.IsShowName;
1743
+ if (IFrameSplitOperator.IsBool(item.IsShowSettingInfo)) chartTitle.IsShowSettingInfo=item.IsShowSettingInfo;
1744
+ if (IFrameSplitOperator.IsBool(item.IsShow)) chartTitle.IsShow=item.IsShow;
1745
+ if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
1746
+ if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
1740
1747
  }
1741
1748
 
1742
1749
  if (IFrameSplitOperator.IsNonEmptyArray(option.Overlay)) //叠加股票
@@ -39482,6 +39489,125 @@ function ChartText()
39482
39489
  }
39483
39490
  }
39484
39491
 
39492
+ function ChartDrawIconV2()
39493
+ {
39494
+ this.newMethod=IChartPainting; //派生
39495
+ this.newMethod();
39496
+ delete this.newMethod;
39497
+
39498
+ this.ClassName="ChartDrawIconV2";
39499
+ this.bHScreen=false; //是否横屏
39500
+ this.Icon=null;
39501
+ this.TextAlign='left';
39502
+ this.Direction=0; //0=middle 1=bottom 2=top
39503
+ this.ShowOffset={ X:0, Y:0 }; //显示偏移
39504
+ this.Size=null;
39505
+
39506
+ this.Draw=function()
39507
+ {
39508
+ if (!this.IsShow || this.ChartFrame.IsMinSize) return;
39509
+ if (this.IsShowIndexTitleOnly()) return;
39510
+ if (this.IsHideScriptIndex()) return;
39511
+
39512
+ if (!this.Data || !this.Data.Data) return;
39513
+ if (!this.Icon) return;
39514
+
39515
+ this.bHScreen=(this.ChartFrame.IsHScreen===true);
39516
+ var xPointCount=this.ChartFrame.XPointCount;
39517
+ var bMinute=this.IsMinuteFrame();
39518
+ var dataWidth=this.ChartFrame.DataWidth;
39519
+ var distanceWidth=this.ChartFrame.DistanceWidth;
39520
+ var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
39521
+ var chartright=this.ChartBorder.GetRight();
39522
+ var top=this.ChartBorder.GetTopEx();
39523
+ var bottom=this.ChartBorder.GetBottomEx();
39524
+
39525
+ if (this.bHScreen)
39526
+ {
39527
+ chartright=this.ChartBorder.GetBottom();
39528
+ top=this.ChartBorder.GetRightEx();
39529
+ bottom=this.ChartBorder.GetLeftEx();
39530
+ xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
39531
+ }
39532
+
39533
+ var pixelTatio = GetDevicePixelRatio();
39534
+ var iconWidth=this.Icon.Width*pixelTatio;
39535
+ var iconHeight=this.Icon.Height*pixelTatio;
39536
+ if (IFrameSplitOperator.IsNumber(this.Size)) iconWidth=iconHeight=this.Size*pixelTatio;
39537
+
39538
+
39539
+
39540
+ this.Canvas.save();
39541
+ this.ClipClient(this.ChartFrame.IsHScreen);
39542
+
39543
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
39544
+ {
39545
+ var value=this.Data.Data[i];
39546
+ if (value==null) continue;
39547
+
39548
+ if (bMinute)
39549
+ {
39550
+ var x=this.ChartFrame.GetXFromIndex(j);
39551
+ }
39552
+ else
39553
+ {
39554
+ var left=xOffset;
39555
+ var right=xOffset+dataWidth;
39556
+ if (right>chartright) break;
39557
+ var x=left+(right-left)/2;
39558
+ }
39559
+
39560
+ var y=this.ChartFrame.GetYFromData(value,false);
39561
+
39562
+ if (x>chartright) break;
39563
+
39564
+ if (this.TextAlign=="right") x-=iconWidth;
39565
+ else if (this.TextAlign=="center") x-=iconWidth/2;
39566
+
39567
+ if (this.Direction===0) y-=iconHeight/2;
39568
+ else if (this.Direction===1) y-=iconHeight;
39569
+
39570
+
39571
+ y+=this.ShowOffset.Y;
39572
+ x+=this.ShowOffset.X;
39573
+
39574
+ var drawInfo={ X:x, Y:y, Image:this.Icon.Image, Width:iconWidth, Height:iconHeight };
39575
+
39576
+ this.DrawIcon(drawInfo);
39577
+ }
39578
+
39579
+
39580
+
39581
+ this.Canvas.restore();
39582
+
39583
+ }
39584
+
39585
+ this.DrawIcon=function(drawInfo)
39586
+ {
39587
+ if (!drawInfo || !drawInfo.Image) return;
39588
+
39589
+ if (this.bHScreen)
39590
+ {
39591
+ /*
39592
+ var xCenter=drawInfo.X+drawInfo.Width/2;
39593
+ var yCenter=drawInfo.Y+drawInfo.Height/2;
39594
+ this.Canvas.save();
39595
+ this.Canvas.translate(yCenter,xCenter);
39596
+ this.Canvas.rotate(90 * Math.PI / 180);
39597
+ this.Canvas.drawImage(drawInfo.Image, 0, 0, drawInfo.Width, drawInfo.Height);
39598
+ this.Canvas.restore();
39599
+ */
39600
+
39601
+ this.Canvas.drawImage(drawInfo.Image, drawInfo.Y, drawInfo.X, drawInfo.Width, drawInfo.Height);
39602
+ }
39603
+ else
39604
+ {
39605
+ this.Canvas.drawImage(drawInfo.Image, drawInfo.X, drawInfo.Y, drawInfo.Width, drawInfo.Height);
39606
+ }
39607
+ }
39608
+ }
39609
+
39610
+
39485
39611
  /*
39486
39612
  文字输出 支持横屏
39487
39613
  数组(Data)不为null的数据中输出 this.Text文本
@@ -103006,6 +103132,26 @@ var MARKET_SUFFIX_NAME=
103006
103132
  return false;
103007
103133
  },
103008
103134
 
103135
+ IsCFFEXOption:function(upperSymbol) //中金所股票期权
103136
+ {
103137
+ if (!upperSymbol) return false;
103138
+ if (!this.IsCFFEX(upperSymbol)) return false;
103139
+ var shortSymbol=JSChart.GetShortSymbol(upperSymbol);
103140
+ //MO2602-C-6300.cffex
103141
+ var aryValue=shortSymbol.split("-");
103142
+ if (!aryValue || aryValue.length!=3) return false;
103143
+
103144
+ var strValue=aryValue[0];
103145
+ const regex = /([a-zA-Z]+)(\d+)/;
103146
+ const match = strValue.match(regex);
103147
+ if (!match || !match[1] || !match[2]) return false;
103148
+
103149
+ var prefix=match[1];
103150
+ if (["IM","IO","MO","HO"].includes(prefix)) return true;
103151
+
103152
+ return true;
103153
+ },
103154
+
103009
103155
  IsDCE: function (upperSymbol)
103010
103156
  {
103011
103157
  if (!upperSymbol) return false;
@@ -103262,6 +103408,43 @@ var MARKET_SUFFIX_NAME=
103262
103408
  return false;
103263
103409
  },
103264
103410
 
103411
+ IsSHSZETF:function(symbol) //是否是沪深ETF
103412
+ {
103413
+ if (!symbol) return false;
103414
+ var upperSymbol=symbol.toUpperCase();
103415
+ if (this.IsSHETF(upperSymbol)) return true;
103416
+ else if (this.IsSZETF(upperSymbol)) return true;
103417
+
103418
+
103419
+ return false;
103420
+ },
103421
+
103422
+ IsSHETF:function(upperSymbol)
103423
+ {
103424
+ if (upperSymbol && this.IsSH(upperSymbol))
103425
+ {
103426
+ //上证ETF:通常以51开头
103427
+ if (upperSymbol.charAt(0)=='5' && upperSymbol.charAt(1)=='1')
103428
+ return true;
103429
+ if (upperSymbol.charAt(0)=='5' && upperSymbol.charAt(1)=='8')
103430
+ return true;
103431
+ }
103432
+
103433
+ return false;
103434
+ },
103435
+
103436
+ IsSZETF:function(upperSymbol)
103437
+ {
103438
+ if (upperSymbol && this.IsSZ(upperSymbol))
103439
+ {
103440
+ //深交所上市的ETF代码以15开头
103441
+ if (upperSymbol.charAt(0)=='1' && upperSymbol.charAt(1)=='5')
103442
+ return true;
103443
+ }
103444
+
103445
+ return false;
103446
+ },
103447
+
103265
103448
  GetMarketStatus:function(symbol) //获取市场状态 0=闭市 1=盘前 2=盘中 3=盘后
103266
103449
  {
103267
103450
  if (!symbol) return 0;
@@ -103612,6 +103795,23 @@ var MARKET_SUFFIX_NAME=
103612
103795
  if (pos<=0) return symbol;
103613
103796
 
103614
103797
  return symbol.slice(0,pos);
103798
+ },
103799
+
103800
+ SplitSymbol:function(symbol, format) //分析代码 返回对象
103801
+ {
103802
+ if (!format || !symbol) return null;
103803
+ var shortSymbol=this.GetShortSymbol(symbol);
103804
+ if (format=="A+D+")
103805
+ {
103806
+ var regex=/([a-zA-Z]+)(\d+)/;
103807
+ var match=shortSymbol.match(regex);
103808
+ if (!match || !match[1] || !match[2]) return null;
103809
+
103810
+ return { AryString:[match[1], match[2]], ShortSymbol:shortSymbol, Symbol:symbol, Market:symbol.slice(shortSymbol.length) };
103811
+ }
103812
+
103813
+
103814
+ return null;
103615
103815
  }
103616
103816
 
103617
103817
  }
@@ -5807,6 +5807,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5807
5807
  {
5808
5808
  var item=option.Frame[i];
5809
5809
  if (!chart.Frame.SubFrame[i]) continue;
5810
+ chart.SetSubFrameAttribute(chart.Frame.SubFrame[i], null, item);
5811
+ /*
5810
5812
  if (item.SplitCount) chart.Frame.SubFrame[i].Frame.YSplitOperator.SplitCount=item.SplitCount;
5811
5813
  if (item.StringFormat) chart.Frame.SubFrame[i].Frame.YSplitOperator.StringFormat=item.StringFormat;
5812
5814
  if (IFrameSplitOperator.IsNumber(item.FloatPrecision)) chart.Frame.SubFrame[i].Frame.YSplitOperator.FloatPrecision=item.FloatPrecision;
@@ -5816,6 +5818,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5816
5818
 
5817
5819
  if (item.IsShowLeftText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowLeftText=item.IsShowLeftText; //显示左边刻度
5818
5820
  if (item.IsShowRightText==false) chart.Frame.SubFrame[i].Frame.YSplitOperator.IsShowRightText=item.IsShowRightText; //显示右边刻度
5821
+ */
5819
5822
  }
5820
5823
  }
5821
5824
 
@@ -5830,9 +5833,13 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5830
5833
 
5831
5834
  if(option.KLineTitle) //股票名称 日期 周期
5832
5835
  {
5833
- if(option.KLineTitle.IsShowName==false) chart.TitlePaint[0].IsShowName=false;
5834
- if(option.KLineTitle.IsShowSettingInfo==false) chart.TitlePaint[0].IsShowSettingInfo=false;
5835
- if(option.KLineTitle.IsShow == false) chart.TitlePaint[0].IsShow = false;
5836
+ var item=option.KLineTitle;
5837
+ var chartTitle=chart.TitlePaint[0];
5838
+ if (IFrameSplitOperator.IsBool(item.IsShowName)) chartTitle.IsShowName=item.IsShowName;
5839
+ if (IFrameSplitOperator.IsBool(item.IsShowSettingInfo)) chartTitle.IsShowSettingInfo=item.IsShowSettingInfo;
5840
+ if (IFrameSplitOperator.IsBool(item.IsShow)) chartTitle.IsShow=item.IsShow;
5841
+ if (IFrameSplitOperator.IsBool(item.IsShowDateTime)) chartTitle.IsShowDateTime=item.IsShowDateTime;
5842
+ if (IFrameSplitOperator.IsBool(item.IsTitleShowLatestData)) chart.IsTitleShowLatestData=item.IsTitleShowLatestData;
5836
5843
  }
5837
5844
 
5838
5845
  if (IFrameSplitOperator.IsNonEmptyArray(option.Overlay)) //叠加股票
@@ -43578,6 +43585,125 @@ function ChartText()
43578
43585
  }
43579
43586
  }
43580
43587
 
43588
+ function ChartDrawIconV2()
43589
+ {
43590
+ this.newMethod=IChartPainting; //派生
43591
+ this.newMethod();
43592
+ delete this.newMethod;
43593
+
43594
+ this.ClassName="ChartDrawIconV2";
43595
+ this.bHScreen=false; //是否横屏
43596
+ this.Icon=null;
43597
+ this.TextAlign='left';
43598
+ this.Direction=0; //0=middle 1=bottom 2=top
43599
+ this.ShowOffset={ X:0, Y:0 }; //显示偏移
43600
+ this.Size=null;
43601
+
43602
+ this.Draw=function()
43603
+ {
43604
+ if (!this.IsShow || this.ChartFrame.IsMinSize) return;
43605
+ if (this.IsShowIndexTitleOnly()) return;
43606
+ if (this.IsHideScriptIndex()) return;
43607
+
43608
+ if (!this.Data || !this.Data.Data) return;
43609
+ if (!this.Icon) return;
43610
+
43611
+ this.bHScreen=(this.ChartFrame.IsHScreen===true);
43612
+ var xPointCount=this.ChartFrame.XPointCount;
43613
+ var bMinute=this.IsMinuteFrame();
43614
+ var dataWidth=this.ChartFrame.DataWidth;
43615
+ var distanceWidth=this.ChartFrame.DistanceWidth;
43616
+ var xOffset=this.ChartBorder.GetLeft()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
43617
+ var chartright=this.ChartBorder.GetRight();
43618
+ var top=this.ChartBorder.GetTopEx();
43619
+ var bottom=this.ChartBorder.GetBottomEx();
43620
+
43621
+ if (this.bHScreen)
43622
+ {
43623
+ chartright=this.ChartBorder.GetBottom();
43624
+ top=this.ChartBorder.GetRightEx();
43625
+ bottom=this.ChartBorder.GetLeftEx();
43626
+ xOffset=this.ChartBorder.GetTop()+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
43627
+ }
43628
+
43629
+ var pixelTatio = GetDevicePixelRatio();
43630
+ var iconWidth=this.Icon.Width*pixelTatio;
43631
+ var iconHeight=this.Icon.Height*pixelTatio;
43632
+ if (IFrameSplitOperator.IsNumber(this.Size)) iconWidth=iconHeight=this.Size*pixelTatio;
43633
+
43634
+
43635
+
43636
+ this.Canvas.save();
43637
+ this.ClipClient(this.ChartFrame.IsHScreen);
43638
+
43639
+ for(var i=this.Data.DataOffset,j=0;i<this.Data.Data.length && j<xPointCount;++i,++j,xOffset+=(dataWidth+distanceWidth))
43640
+ {
43641
+ var value=this.Data.Data[i];
43642
+ if (value==null) continue;
43643
+
43644
+ if (bMinute)
43645
+ {
43646
+ var x=this.ChartFrame.GetXFromIndex(j);
43647
+ }
43648
+ else
43649
+ {
43650
+ var left=xOffset;
43651
+ var right=xOffset+dataWidth;
43652
+ if (right>chartright) break;
43653
+ var x=left+(right-left)/2;
43654
+ }
43655
+
43656
+ var y=this.ChartFrame.GetYFromData(value,false);
43657
+
43658
+ if (x>chartright) break;
43659
+
43660
+ if (this.TextAlign=="right") x-=iconWidth;
43661
+ else if (this.TextAlign=="center") x-=iconWidth/2;
43662
+
43663
+ if (this.Direction===0) y-=iconHeight/2;
43664
+ else if (this.Direction===1) y-=iconHeight;
43665
+
43666
+
43667
+ y+=this.ShowOffset.Y;
43668
+ x+=this.ShowOffset.X;
43669
+
43670
+ var drawInfo={ X:x, Y:y, Image:this.Icon.Image, Width:iconWidth, Height:iconHeight };
43671
+
43672
+ this.DrawIcon(drawInfo);
43673
+ }
43674
+
43675
+
43676
+
43677
+ this.Canvas.restore();
43678
+
43679
+ }
43680
+
43681
+ this.DrawIcon=function(drawInfo)
43682
+ {
43683
+ if (!drawInfo || !drawInfo.Image) return;
43684
+
43685
+ if (this.bHScreen)
43686
+ {
43687
+ /*
43688
+ var xCenter=drawInfo.X+drawInfo.Width/2;
43689
+ var yCenter=drawInfo.Y+drawInfo.Height/2;
43690
+ this.Canvas.save();
43691
+ this.Canvas.translate(yCenter,xCenter);
43692
+ this.Canvas.rotate(90 * Math.PI / 180);
43693
+ this.Canvas.drawImage(drawInfo.Image, 0, 0, drawInfo.Width, drawInfo.Height);
43694
+ this.Canvas.restore();
43695
+ */
43696
+
43697
+ this.Canvas.drawImage(drawInfo.Image, drawInfo.Y, drawInfo.X, drawInfo.Width, drawInfo.Height);
43698
+ }
43699
+ else
43700
+ {
43701
+ this.Canvas.drawImage(drawInfo.Image, drawInfo.X, drawInfo.Y, drawInfo.Width, drawInfo.Height);
43702
+ }
43703
+ }
43704
+ }
43705
+
43706
+
43581
43707
  /*
43582
43708
  文字输出 支持横屏
43583
43709
  数组(Data)不为null的数据中输出 this.Text文本
@@ -107102,6 +107228,26 @@ var MARKET_SUFFIX_NAME=
107102
107228
  return false;
107103
107229
  },
107104
107230
 
107231
+ IsCFFEXOption:function(upperSymbol) //中金所股票期权
107232
+ {
107233
+ if (!upperSymbol) return false;
107234
+ if (!this.IsCFFEX(upperSymbol)) return false;
107235
+ var shortSymbol=JSChart.GetShortSymbol(upperSymbol);
107236
+ //MO2602-C-6300.cffex
107237
+ var aryValue=shortSymbol.split("-");
107238
+ if (!aryValue || aryValue.length!=3) return false;
107239
+
107240
+ var strValue=aryValue[0];
107241
+ const regex = /([a-zA-Z]+)(\d+)/;
107242
+ const match = strValue.match(regex);
107243
+ if (!match || !match[1] || !match[2]) return false;
107244
+
107245
+ var prefix=match[1];
107246
+ if (["IM","IO","MO","HO"].includes(prefix)) return true;
107247
+
107248
+ return true;
107249
+ },
107250
+
107105
107251
  IsDCE: function (upperSymbol)
107106
107252
  {
107107
107253
  if (!upperSymbol) return false;
@@ -107358,6 +107504,43 @@ var MARKET_SUFFIX_NAME=
107358
107504
  return false;
107359
107505
  },
107360
107506
 
107507
+ IsSHSZETF:function(symbol) //是否是沪深ETF
107508
+ {
107509
+ if (!symbol) return false;
107510
+ var upperSymbol=symbol.toUpperCase();
107511
+ if (this.IsSHETF(upperSymbol)) return true;
107512
+ else if (this.IsSZETF(upperSymbol)) return true;
107513
+
107514
+
107515
+ return false;
107516
+ },
107517
+
107518
+ IsSHETF:function(upperSymbol)
107519
+ {
107520
+ if (upperSymbol && this.IsSH(upperSymbol))
107521
+ {
107522
+ //上证ETF:通常以51开头
107523
+ if (upperSymbol.charAt(0)=='5' && upperSymbol.charAt(1)=='1')
107524
+ return true;
107525
+ if (upperSymbol.charAt(0)=='5' && upperSymbol.charAt(1)=='8')
107526
+ return true;
107527
+ }
107528
+
107529
+ return false;
107530
+ },
107531
+
107532
+ IsSZETF:function(upperSymbol)
107533
+ {
107534
+ if (upperSymbol && this.IsSZ(upperSymbol))
107535
+ {
107536
+ //深交所上市的ETF代码以15开头
107537
+ if (upperSymbol.charAt(0)=='1' && upperSymbol.charAt(1)=='5')
107538
+ return true;
107539
+ }
107540
+
107541
+ return false;
107542
+ },
107543
+
107361
107544
  GetMarketStatus:function(symbol) //获取市场状态 0=闭市 1=盘前 2=盘中 3=盘后
107362
107545
  {
107363
107546
  if (!symbol) return 0;
@@ -107708,6 +107891,23 @@ var MARKET_SUFFIX_NAME=
107708
107891
  if (pos<=0) return symbol;
107709
107892
 
107710
107893
  return symbol.slice(0,pos);
107894
+ },
107895
+
107896
+ SplitSymbol:function(symbol, format) //分析代码 返回对象
107897
+ {
107898
+ if (!format || !symbol) return null;
107899
+ var shortSymbol=this.GetShortSymbol(symbol);
107900
+ if (format=="A+D+")
107901
+ {
107902
+ var regex=/([a-zA-Z]+)(\d+)/;
107903
+ var match=shortSymbol.match(regex);
107904
+ if (!match || !match[1] || !match[2]) return null;
107905
+
107906
+ return { AryString:[match[1], match[2]], ShortSymbol:shortSymbol, Symbol:symbol, Market:symbol.slice(shortSymbol.length) };
107907
+ }
107908
+
107909
+
107910
+ return null;
107711
107911
  }
107712
107912
 
107713
107913
  }
@@ -111608,6 +111808,7 @@ var g_JSComplierResource=
111608
111808
  Data:new Map() //自定义图标 key=id
111609
111809
  //value={ID:, Text:, Color, Family: } //svg
111610
111810
  //value={ ID:1, Symbol:'↑', Color:'rgb(238,44,44)' } //文字
111811
+ //value={ ID:, Image:, Width, Height }
111611
111812
  },
111612
111813
 
111613
111814
  CustomFunction: //定制函数
@@ -111655,20 +111856,24 @@ var g_JSComplierResource=
111655
111856
  GetDrawIcon:function(id)
111656
111857
  {
111657
111858
  var icon;
111658
- if (g_JSComplierResource.CustomDrawIcon.Data.has(id))
111859
+ if (this.CustomDrawIcon.Data.has(id))
111659
111860
  {
111660
111861
  const iconfont=g_JSComplierResource.CustomDrawIcon.Data.get(id);
111661
- if (iconfont.Symbol) //文字
111862
+
111863
+ if (iconfont.Image) //图片
111864
+ icon={ ID:id, Image:iconfont.Image, Width:iconfont.Width, Height:iconfont.Height };
111865
+ else if (iconfont.Symbol) //文字
111662
111866
  icon={ Symbol:iconfont.Symbol, Color:iconfont.Color, IconFont:false, ID:id };
111663
111867
  else //SVG图标
111664
111868
  icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:iconfont.Family, IconFont:true, ID:id };
111869
+
111665
111870
  return icon;
111666
111871
  }
111667
111872
 
111668
- if (g_JSComplierResource.DrawIcon.Data.has(id))
111873
+ if (this.DrawIcon.Data.has(id))
111669
111874
  {
111670
- const iconfont=g_JSComplierResource.DrawIcon.Data.get(id);
111671
- icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:g_JSComplierResource.DrawIcon.Family, IconFont:true, ID:id };
111875
+ const iconfont=this.DrawIcon.Data.get(id);
111876
+ icon={ Symbol:iconfont.Text, Color:iconfont.Color, Family:this.DrawIcon.Family, IconFont:true, ID:id };
111672
111877
  return icon;
111673
111878
  }
111674
111879
 
@@ -111710,6 +111915,11 @@ var g_JSComplierResource=
111710
111915
  {
111711
111916
  if (g_JSComplierResource.CustomDataFunction.Data.has(name)) return true;
111712
111917
  return false;
111918
+ },
111919
+
111920
+ AddDrawIcon:function(id, icon)
111921
+ {
111922
+ this.CustomDrawIcon.Data.set(id, icon);
111713
111923
  }
111714
111924
  }
111715
111925
 
@@ -132169,7 +132379,10 @@ JSComplier.SetDomain = function (domain, cacheDomain) //修改API地址
132169
132379
 
132170
132380
  JSComplier.AddIcon=function(obj) //添加一个obj={ID:, Text:, Color, Family: }
132171
132381
  {
132172
- g_JSComplierResource.CustomDrawIcon.Data.set(obj.ID, obj);
132382
+
132383
+ if (!obj || !obj.ID) return;
132384
+
132385
+ g_JSComplierResource.AddDrawIcon(obj.ID, obj);
132173
132386
  }
132174
132387
 
132175
132388
  JSComplier.AddFunction=function(obj) //添加函数 { Name:函数名, Description:描述信息, IsDownload:是否需要下载数据, Invoke:函数执行(可选) }
@@ -133960,7 +134173,21 @@ function ScriptIndex(name,script,args,option)
133960
134173
  //创建图标
133961
134174
  this.CreateIcon=function(hqChart,windowIndex,varItem,id)
133962
134175
  {
133963
- let chartText=new ChartSingleText();
134176
+ var chartText=null;
134177
+
134178
+ if (varItem.Draw && varItem.Draw.Icon && varItem.Draw.Icon.Image)
134179
+ {
134180
+ chartText=new ChartDrawIconV2();
134181
+ chartText.Icon=varItem.Draw.Icon;
134182
+ if (varItem.DrawFontSize>0) chartText.Size=varItem.DrawFontSize;
134183
+ }
134184
+ else
134185
+ {
134186
+ chartText=new ChartSingleText();
134187
+ if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
134188
+ }
134189
+
134190
+
133964
134191
  chartText.Canvas=hqChart.Canvas;
133965
134192
  chartText.TextAlign='center';
133966
134193
 
@@ -133991,6 +134218,10 @@ function ScriptIndex(name,script,args,option)
133991
134218
  {
133992
134219
  chartText.IconFont={ Family:icon.Family, Text:icon.Symbol, Color:icon.Color };
133993
134220
  if (varItem.Color) chartText.IconFont.Color=this.GetColor(varItem.Color);
134221
+ }
134222
+ else if (icon.Image)
134223
+ {
134224
+
133994
134225
  }
133995
134226
  else
133996
134227
  {
@@ -134000,7 +134231,7 @@ function ScriptIndex(name,script,args,option)
134000
134231
  else chartText.Color='rgb(0,0,0)';
134001
134232
  }
134002
134233
 
134003
- if (varItem.DrawFontSize>0) chartText.FixedFontSize=varItem.DrawFontSize;
134234
+
134004
134235
  if (IFrameSplitOperator.IsNumber(varItem.XOffset)) chartText.ShowOffset.X=varItem.XOffset;
134005
134236
  if (IFrameSplitOperator.IsNumber(varItem.YOffset)) chartText.ShowOffset.Y=varItem.YOffset;
134006
134237
 
@@ -136058,7 +136289,19 @@ function OverlayScriptIndex(name,script,args,option)
136058
136289
  {
136059
136290
  var overlayIndex=this.OverlayIndex;
136060
136291
  var frame=overlayIndex.Frame;
136061
- let chart=new ChartSingleText();
136292
+ var chart=null;
136293
+
136294
+ if (varItem.Draw && varItem.Draw.Icon && varItem.Draw.Icon.Image)
136295
+ {
136296
+ chart=new ChartDrawIconV2();
136297
+ chart.Icon=varItem.Draw.Icon;
136298
+ if (varItem.DrawFontSize>0) chart.Size=varItem.DrawFontSize;
136299
+ }
136300
+ else
136301
+ {
136302
+ chart=new ChartSingleText();
136303
+ }
136304
+
136062
136305
  chart.Canvas=hqChart.Canvas;
136063
136306
  chart.TextAlign='center';
136064
136307
 
@@ -136089,6 +136332,10 @@ function OverlayScriptIndex(name,script,args,option)
136089
136332
  if (icon.IconFont==true)
136090
136333
  {
136091
136334
  chart.IconFont={ Family:icon.Family, Text:icon.Symbol, Color:icon.Color };
136335
+ }
136336
+ else if (icon.Image)
136337
+ {
136338
+
136092
136339
  }
136093
136340
  else
136094
136341
  {
@@ -156556,7 +156803,7 @@ function ScrollBarBGChart()
156556
156803
 
156557
156804
 
156558
156805
 
156559
- var HQCHART_VERSION="1.1.15479";
156806
+ var HQCHART_VERSION="1.1.15502";
156560
156807
 
156561
156808
  function PrintHQChartVersion()
156562
156809
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.15479";
8
+ var HQCHART_VERSION="1.1.15502";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {