hqchart 1.1.14787 → 1.1.14790

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14787",
3
+ "version": "1.1.14790",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -15,6 +15,7 @@ function JSDealChart(divElement)
15
15
  {
16
16
  this.DivElement=divElement;
17
17
  this.JSChartContainer; //表格控件
18
+ this.ResizeListener; //大小变动监听
18
19
 
19
20
  //h5 canvas
20
21
  this.CanvasElement=document.createElement("canvas");
@@ -71,6 +72,8 @@ function JSDealChart(divElement)
71
72
  }
72
73
  }
73
74
 
75
+ if (option.EnableResize==true) this.CreateResizeListener();
76
+
74
77
  if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
75
78
  if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
76
79
 
@@ -84,6 +87,19 @@ function JSDealChart(divElement)
84
87
  }
85
88
  }
86
89
 
90
+ this.CreateResizeListener=function()
91
+ {
92
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
93
+ this.ResizeListener.observe(this.DivElement);
94
+ }
95
+
96
+ this.OnDivResize=function(entries)
97
+ {
98
+ JSConsole.Chart.Log("[JSDealChart::OnDivResize] entries=", entries);
99
+ this.OnSize();
100
+ }
101
+
102
+
87
103
  this.CreateJSDealChartContainer=function(option)
88
104
  {
89
105
  var chart=new JSDealChartContainer(this.CanvasElement);
@@ -1637,17 +1653,37 @@ function ChartDealList()
1637
1653
  var tableLeft=left+(this.TableWidth*i);
1638
1654
  var textLeft=tableLeft;
1639
1655
  var textTop=top;
1640
-
1641
1656
  for(j=0;j<this.RowCount && index>=0;++j, --index)
1642
1657
  {
1643
1658
  var dataItem=this.Data.Data[index];
1644
- this.DrawSelectedRow(dataItem, index, rtRow)
1659
+ var rtRow={ Left:textLeft-this.HeaderMergin.Left, Top:textTop, Height:this.RowHeight, Width:this.TableWidth };
1660
+ rtRow.Right=rtRow.Left+rtRow.Width;
1661
+ rtRow.Bottom=rtRow.Top+rtRow.Height;
1662
+
1663
+ if (dataItem.BGColor)
1664
+ {
1665
+ this.Canvas.fillStyle=dataItem.BGColor;
1666
+ this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
1667
+ }
1668
+
1669
+ if (this.DrawSelectedRow(dataItem, index, rtRow))
1670
+ selectedRowData={ Rect:rtRow };
1645
1671
 
1646
1672
  this.DrawRow(dataItem, textLeft, textTop, index);
1673
+
1674
+ this.AryCellRect.push({ Rect:rtRow, Type:1, DataIndex:index });
1647
1675
 
1648
1676
  textTop+=this.RowHeight;
1649
1677
  }
1650
1678
  }
1679
+
1680
+ if (selectedRowData && this.SelectedStyle===2)
1681
+ {
1682
+ var rtBG=selectedRowData.Rect;
1683
+ this.Canvas.fillStyle=this.SelectedConfig.LineColor;
1684
+ var lineWidth=this.SelectedConfig.LineWidth;
1685
+ this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);
1686
+ }
1651
1687
  }
1652
1688
  else
1653
1689
  {
@@ -1694,6 +1730,7 @@ function ChartDealList()
1694
1730
  {
1695
1731
  var tableLeft=left;
1696
1732
  var tableRight=left+this.TableWidth;
1733
+ var borderRight=this.RectClient.Right;
1697
1734
  for(var i=0;i<this.Column.length;++i)
1698
1735
  {
1699
1736
  var item=this.Column[i];
@@ -133828,6 +133828,7 @@ function JSDealChart(divElement)
133828
133828
  {
133829
133829
  this.DivElement=divElement;
133830
133830
  this.JSChartContainer; //表格控件
133831
+ this.ResizeListener; //大小变动监听
133831
133832
 
133832
133833
  //h5 canvas
133833
133834
  this.CanvasElement=document.createElement("canvas");
@@ -133884,6 +133885,8 @@ function JSDealChart(divElement)
133884
133885
  }
133885
133886
  }
133886
133887
 
133888
+ if (option.EnableResize==true) this.CreateResizeListener();
133889
+
133887
133890
  if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
133888
133891
  if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
133889
133892
 
@@ -133897,6 +133900,19 @@ function JSDealChart(divElement)
133897
133900
  }
133898
133901
  }
133899
133902
 
133903
+ this.CreateResizeListener=function()
133904
+ {
133905
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
133906
+ this.ResizeListener.observe(this.DivElement);
133907
+ }
133908
+
133909
+ this.OnDivResize=function(entries)
133910
+ {
133911
+ JSConsole.Chart.Log("[JSDealChart::OnDivResize] entries=", entries);
133912
+ this.OnSize();
133913
+ }
133914
+
133915
+
133900
133916
  this.CreateJSDealChartContainer=function(option)
133901
133917
  {
133902
133918
  var chart=new JSDealChartContainer(this.CanvasElement);
@@ -135450,17 +135466,37 @@ function ChartDealList()
135450
135466
  var tableLeft=left+(this.TableWidth*i);
135451
135467
  var textLeft=tableLeft;
135452
135468
  var textTop=top;
135453
-
135454
135469
  for(j=0;j<this.RowCount && index>=0;++j, --index)
135455
135470
  {
135456
135471
  var dataItem=this.Data.Data[index];
135457
- this.DrawSelectedRow(dataItem, index, rtRow)
135472
+ var rtRow={ Left:textLeft-this.HeaderMergin.Left, Top:textTop, Height:this.RowHeight, Width:this.TableWidth };
135473
+ rtRow.Right=rtRow.Left+rtRow.Width;
135474
+ rtRow.Bottom=rtRow.Top+rtRow.Height;
135475
+
135476
+ if (dataItem.BGColor)
135477
+ {
135478
+ this.Canvas.fillStyle=dataItem.BGColor;
135479
+ this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
135480
+ }
135481
+
135482
+ if (this.DrawSelectedRow(dataItem, index, rtRow))
135483
+ selectedRowData={ Rect:rtRow };
135458
135484
 
135459
135485
  this.DrawRow(dataItem, textLeft, textTop, index);
135486
+
135487
+ this.AryCellRect.push({ Rect:rtRow, Type:1, DataIndex:index });
135460
135488
 
135461
135489
  textTop+=this.RowHeight;
135462
135490
  }
135463
135491
  }
135492
+
135493
+ if (selectedRowData && this.SelectedStyle===2)
135494
+ {
135495
+ var rtBG=selectedRowData.Rect;
135496
+ this.Canvas.fillStyle=this.SelectedConfig.LineColor;
135497
+ var lineWidth=this.SelectedConfig.LineWidth;
135498
+ this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);
135499
+ }
135464
135500
  }
135465
135501
  else
135466
135502
  {
@@ -135507,6 +135543,7 @@ function ChartDealList()
135507
135543
  {
135508
135544
  var tableLeft=left;
135509
135545
  var tableRight=left+this.TableWidth;
135546
+ var borderRight=this.RectClient.Right;
135510
135547
  for(var i=0;i<this.Column.length;++i)
135511
135548
  {
135512
135549
  var item=this.Column[i];
@@ -149113,7 +149150,7 @@ function ScrollBarBGChart()
149113
149150
 
149114
149151
 
149115
149152
 
149116
- var HQCHART_VERSION="1.1.14786";
149153
+ var HQCHART_VERSION="1.1.14789";
149117
149154
 
149118
149155
  function PrintHQChartVersion()
149119
149156
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14786";
8
+ var HQCHART_VERSION="1.1.14789";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -133872,6 +133872,7 @@ function JSDealChart(divElement)
133872
133872
  {
133873
133873
  this.DivElement=divElement;
133874
133874
  this.JSChartContainer; //表格控件
133875
+ this.ResizeListener; //大小变动监听
133875
133876
 
133876
133877
  //h5 canvas
133877
133878
  this.CanvasElement=document.createElement("canvas");
@@ -133928,6 +133929,8 @@ function JSDealChart(divElement)
133928
133929
  }
133929
133930
  }
133930
133931
 
133932
+ if (option.EnableResize==true) this.CreateResizeListener();
133933
+
133931
133934
  if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
133932
133935
  if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
133933
133936
 
@@ -133941,6 +133944,19 @@ function JSDealChart(divElement)
133941
133944
  }
133942
133945
  }
133943
133946
 
133947
+ this.CreateResizeListener=function()
133948
+ {
133949
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
133950
+ this.ResizeListener.observe(this.DivElement);
133951
+ }
133952
+
133953
+ this.OnDivResize=function(entries)
133954
+ {
133955
+ JSConsole.Chart.Log("[JSDealChart::OnDivResize] entries=", entries);
133956
+ this.OnSize();
133957
+ }
133958
+
133959
+
133944
133960
  this.CreateJSDealChartContainer=function(option)
133945
133961
  {
133946
133962
  var chart=new JSDealChartContainer(this.CanvasElement);
@@ -135494,17 +135510,37 @@ function ChartDealList()
135494
135510
  var tableLeft=left+(this.TableWidth*i);
135495
135511
  var textLeft=tableLeft;
135496
135512
  var textTop=top;
135497
-
135498
135513
  for(j=0;j<this.RowCount && index>=0;++j, --index)
135499
135514
  {
135500
135515
  var dataItem=this.Data.Data[index];
135501
- this.DrawSelectedRow(dataItem, index, rtRow)
135516
+ var rtRow={ Left:textLeft-this.HeaderMergin.Left, Top:textTop, Height:this.RowHeight, Width:this.TableWidth };
135517
+ rtRow.Right=rtRow.Left+rtRow.Width;
135518
+ rtRow.Bottom=rtRow.Top+rtRow.Height;
135519
+
135520
+ if (dataItem.BGColor)
135521
+ {
135522
+ this.Canvas.fillStyle=dataItem.BGColor;
135523
+ this.Canvas.fillRect(rtRow.Left,rtRow.Top, rtRow.Width, rtRow.Height);
135524
+ }
135525
+
135526
+ if (this.DrawSelectedRow(dataItem, index, rtRow))
135527
+ selectedRowData={ Rect:rtRow };
135502
135528
 
135503
135529
  this.DrawRow(dataItem, textLeft, textTop, index);
135530
+
135531
+ this.AryCellRect.push({ Rect:rtRow, Type:1, DataIndex:index });
135504
135532
 
135505
135533
  textTop+=this.RowHeight;
135506
135534
  }
135507
135535
  }
135536
+
135537
+ if (selectedRowData && this.SelectedStyle===2)
135538
+ {
135539
+ var rtBG=selectedRowData.Rect;
135540
+ this.Canvas.fillStyle=this.SelectedConfig.LineColor;
135541
+ var lineWidth=this.SelectedConfig.LineWidth;
135542
+ this.Canvas.fillRect(rtBG.Left,rtBG.Bottom-lineWidth,rtBG.Width,lineWidth);
135543
+ }
135508
135544
  }
135509
135545
  else
135510
135546
  {
@@ -135551,6 +135587,7 @@ function ChartDealList()
135551
135587
  {
135552
135588
  var tableLeft=left;
135553
135589
  var tableRight=left+this.TableWidth;
135590
+ var borderRight=this.RectClient.Right;
135554
135591
  for(var i=0;i<this.Column.length;++i)
135555
135592
  {
135556
135593
  var item=this.Column[i];
@@ -160082,7 +160119,7 @@ function HQChartScriptWorker()
160082
160119
 
160083
160120
 
160084
160121
 
160085
- var HQCHART_VERSION="1.1.14786";
160122
+ var HQCHART_VERSION="1.1.14789";
160086
160123
 
160087
160124
  function PrintHQChartVersion()
160088
160125
  {