hqchart 1.1.13520 → 1.1.13526

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.13520",
3
+ "version": "1.1.13526",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -27,6 +27,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
27
27
  this.DivElement=divElement;
28
28
  this.DivToolElement=null; //工具条
29
29
  this.JSChartContainer; //画图控件
30
+ this.ResizeListener;
30
31
 
31
32
  //h5 canvas
32
33
  this.CanvasElement=document.createElement("canvas");
@@ -1704,6 +1705,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1704
1705
  this.JSChartContainer=chart;
1705
1706
  chart.DivElement=this.DivElement;
1706
1707
 
1708
+ if (option.EnableResize==true) this.CreateResizeListener();
1709
+
1707
1710
  if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
1708
1711
  if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
1709
1712
 
@@ -1746,6 +1749,19 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1746
1749
  }
1747
1750
  }
1748
1751
 
1752
+ this.CreateResizeListener=function()
1753
+ {
1754
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
1755
+ this.ResizeListener.observe(this.DivElement);
1756
+ }
1757
+
1758
+ this.OnDivResize=function(entries)
1759
+ {
1760
+ JSConsole.Chart.Log("[JSChart::OnDivResize] entries=", entries);
1761
+
1762
+ this.OnSize( {Type:1} );
1763
+ }
1764
+
1749
1765
  //创建工具条
1750
1766
  this.CreateToolbar=function(option)
1751
1767
  {
@@ -37981,6 +37997,7 @@ function ChartMultiText()
37981
37997
  {
37982
37998
  var border=this.ChartBorder.GetHScreenBorder();
37983
37999
  var chartright=border.BottomEx;
38000
+ var chartleft=border.TopEx;
37984
38001
  var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
37985
38002
  var left=this.ChartBorder.GetTop();
37986
38003
  var right=this.ChartBorder.GetBottom();
@@ -37992,6 +38009,7 @@ function ChartMultiText()
37992
38009
  var border=this.ChartBorder.GetBorder();
37993
38010
  var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
37994
38011
  var chartright=border.RightEx;
38012
+ var chartleft=border.LeftEx;
37995
38013
  var left=this.ChartBorder.GetLeft();
37996
38014
  var right=this.ChartBorder.GetRight();
37997
38015
  var top=border.TopEx;
@@ -38027,16 +38045,17 @@ function ChartMultiText()
38027
38045
 
38028
38046
  var textWidth=this.Canvas.measureText(item.Text).width;
38029
38047
  this.Canvas.textAlign='center';
38030
- if (x+textWidth/2>=right)
38048
+ if (x+textWidth/2>=chartright)
38031
38049
  {
38032
38050
  this.Canvas.textAlign='right';
38033
- x=right;
38051
+ x=chartright;
38034
38052
  }
38035
- else if (x-textWidth/2<left)
38053
+ else if (x-textWidth/2<chartleft)
38036
38054
  {
38037
38055
  this.Canvas.textAlign = 'left';
38038
- x=left;
38056
+ x=chartleft;
38039
38057
  }
38058
+
38040
38059
  if (item.Baseline==1) this.Canvas.textBaseline='top';
38041
38060
  else if (item.Baseline==2) this.Canvas.textBaseline='bottom';
38042
38061
  else this.Canvas.textBaseline = 'middle';
@@ -16,18 +16,76 @@ function JSReportChart(divElement)
16
16
  this.DivElement=divElement;
17
17
  this.JSChartContainer; //表格控件
18
18
 
19
- //h5 canvas
20
- this.CanvasElement=document.createElement("canvas");
21
- this.CanvasElement.className='jsreportlist-drawing';
22
- this.CanvasElement.id=Guid();
23
- this.CanvasElement.setAttribute("tabindex",0);
24
- if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
25
- if(divElement.hasChildNodes())
26
- {
27
- JSConsole.Chart.Log("[JSReportChart::JSReportChart] divElement hasChildNodes", divElement.childNodes);
28
- }
29
- divElement.appendChild(this.CanvasElement);
19
+ //h5 canvas
20
+ this.CanvasElement=document.createElement("canvas");
21
+ this.CanvasElement.className='jsreportlist-drawing';
22
+ this.CanvasElement.id=Guid();
23
+ this.CanvasElement.setAttribute("tabindex",0);
24
+ if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
25
+ if(divElement.hasChildNodes())
26
+ {
27
+ JSConsole.Chart.Log("[JSReportChart::JSReportChart] divElement hasChildNodes", divElement.childNodes);
28
+ }
29
+ divElement.appendChild(this.CanvasElement);
30
+
31
+ //额外的画布
32
+ this.MapExtraCanvasElement=new Map(); //key=画布名字, value={ Element:, Canvas:}
33
+
34
+ this.CreateExtraCanvasElement=function(name, option)
35
+ {
36
+ if (this.MapExtraCanvasElement.has(name)) return this.MapExtraCanvasElement.get(name);
37
+
38
+ var element=document.createElement("canvas");
39
+ element.className='jsreportlist-drawing-extra';
40
+ element.id=Guid();
41
+ if (name==JSChart.CorssCursorCanvasKey)
42
+ element.setAttribute("tabindex",5);
43
+ else
44
+ element.setAttribute("tabindex",1);
45
+
46
+ if (element.style)
47
+ {
48
+ element.style.outline='none';
49
+ element.style.position="absolute";
50
+ element.style.left='0px';
51
+ element.style.top='0px';
52
+ element.style["pointer-events"]="none";
53
+ }
54
+
55
+ if (option)
56
+ {
57
+ if (IFrameSplitOperator.IsNumber(option.TabIndex)) element.setAttribute("tabindex",option.TabIndex);
58
+ if (IFrameSplitOperator.IsNumber(option.ZIndex)) element.style["z-index"]=option.ZIndex;
59
+ }
60
+
61
+ if (this.CanvasElement)
62
+ {
63
+ element.height=this.CanvasElement.height;
64
+ element.width=this.CanvasElement.width;
65
+ if (element.style)
66
+ {
67
+ element.style.width=this.CanvasElement.style.width;
68
+ element.style.height=this.CanvasElement.style.height
69
+ }
70
+ }
71
+
72
+ divElement.appendChild(element);
73
+
74
+ var item={ Element:element, Canvas:null };
75
+ this.MapExtraCanvasElement.set(name, item);
76
+ }
77
+
78
+ this.GetExtraCanvas=function(name)
79
+ {
80
+ if (!this.MapExtraCanvasElement.has(name)) return null;
30
81
 
82
+ var item=this.MapExtraCanvasElement.get(name);
83
+ if (!item.Element) return null;
84
+
85
+ if (!item.Canvas) item.Canvas=item.Element.getContext("2d");
86
+
87
+ return item;
88
+ }
31
89
 
32
90
  this.OnSize=function()
33
91
  {
@@ -42,6 +100,19 @@ function JSReportChart(divElement)
42
100
  this.CanvasElement.height*=pixelTatio;
43
101
  this.CanvasElement.width*=pixelTatio;
44
102
 
103
+ //扩展画布
104
+ for(var mapItem of this.MapExtraCanvasElement)
105
+ {
106
+ var item=mapItem[1];
107
+ var element=item.Element;
108
+ if (!element) continue;
109
+
110
+ element.height=this.CanvasElement.height;
111
+ element.width=this.CanvasElement.width;
112
+ element.style.width=this.CanvasElement.style.width;
113
+ element.style.height=this.CanvasElement.style.height;
114
+ }
115
+
45
116
  JSConsole.Chart.Log(`[JSReportChart::OnSize] devicePixelRatio=${window.devicePixelRatio}, height=${this.CanvasElement.height}, width=${this.CanvasElement.width}`);
46
117
 
47
118
  if (this.JSChartContainer && this.JSChartContainer.OnSize)
@@ -203,6 +274,8 @@ function JSReportChart(divElement)
203
274
  }
204
275
  }
205
276
 
277
+ JSReportChart.TooltipCursorCanvasKey="hq_report_tooltip"; //提示信息
278
+
206
279
 
207
280
  JSReportChart.Init=function(divElement)
208
281
  {
@@ -421,6 +494,15 @@ function JSReportChartContainer(uielement)
421
494
  }
422
495
 
423
496
 
497
+ //清空画布
498
+ this.ClearCanvas=function(canvas)
499
+ {
500
+ if (!canvas) return;
501
+ if (!this.UIElement) return;
502
+
503
+ canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
504
+ }
505
+
424
506
  //清空固定行数据
425
507
  this.ClearFixedRowData=function()
426
508
  {
@@ -3669,8 +3751,10 @@ function ChartReport()
3669
3751
  if (item.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
3670
3752
  {
3671
3753
  if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
3754
+ colItem.FormatType=0; //0=默认格式 1=长度不够使用...
3672
3755
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
3673
3756
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
3757
+ if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType; //输出样式
3674
3758
  }
3675
3759
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID)
3676
3760
  {
@@ -4626,8 +4710,67 @@ function ChartReport()
4626
4710
  }
4627
4711
 
4628
4712
  this.DrawItemBG(drawInfo);
4629
- this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
4713
+
4714
+ if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
4715
+ this.DrawCustomText(drawInfo,column, x, top, textWidth);
4716
+ else
4717
+ this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
4718
+ }
4719
+ }
4720
+
4721
+ this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
4722
+ {
4723
+ if (!drawInfo.Text) return;
4724
+
4725
+ var text=drawInfo.Text;
4726
+ var x=left;
4727
+ if (drawInfo.TextAlign=='center')
4728
+ {
4729
+ x=left+cellWidth/2;
4730
+ this.Canvas.textAlign="center";
4731
+ }
4732
+ else if (drawInfo.TextAlign=='right')
4733
+ {
4734
+ x=left+cellWidth-2;
4735
+ this.Canvas.textAlign="right";
4736
+ }
4737
+ else
4738
+ {
4739
+ x+=2;
4740
+ this.Canvas.textAlign="left";
4741
+ }
4742
+
4743
+ var textWidth=this.Canvas.measureText(text).width+1;
4744
+ var bClip=false;
4745
+ if (textWidth>=cellWidth) //长度超过单元格 裁剪
4746
+ {
4747
+ if (column.FormatType==2)
4748
+ {
4749
+ var count=text.length+5;
4750
+ text="";
4751
+ for(var i=0;i<count;++i)
4752
+ text+="#";
4753
+ }
4754
+ else if (column.FormatType==1)
4755
+ {
4756
+ text=this.TextEllipsis(text, cellWidth, column.MaxText);
4757
+ }
4758
+
4759
+ this.Canvas.save();
4760
+ bClip=true;
4761
+
4762
+ var rtCell={ Left:left, Top:top+this.ItemMergin.Top, Width:cellWidth, Height:this.RowHeight };
4763
+ this.Canvas.beginPath();
4764
+ this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
4765
+ //this.Canvas.stroke(); //调试用
4766
+ this.Canvas.clip();
4630
4767
  }
4768
+
4769
+ this.Canvas.textBaseline="middle";
4770
+ this.Canvas.fillStyle=drawInfo.TextColor;
4771
+ this.Canvas.fillText(text,x,top+this.ItemMergin.Top+this.RowHeight/2);
4772
+
4773
+ if (bClip) this.Canvas.restore();
4631
4774
  }
4632
4775
 
4633
4776
  this.DrawSymbolName=function(data, column, left, top, rowType)
@@ -3952,6 +3952,7 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
3952
3952
  this.DivElement=divElement;
3953
3953
  this.DivToolElement=null; //工具条
3954
3954
  this.JSChartContainer; //画图控件
3955
+ this.ResizeListener;
3955
3956
 
3956
3957
  //h5 canvas
3957
3958
  this.CanvasElement=document.createElement("canvas");
@@ -5629,6 +5630,8 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5629
5630
  this.JSChartContainer=chart;
5630
5631
  chart.DivElement=this.DivElement;
5631
5632
 
5633
+ if (option.EnableResize==true) this.CreateResizeListener();
5634
+
5632
5635
  if (option.DefaultCursor) chart.DefaultCursor=option.DefaultCursor;
5633
5636
  if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
5634
5637
 
@@ -5671,6 +5674,19 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5671
5674
  }
5672
5675
  }
5673
5676
 
5677
+ this.CreateResizeListener=function()
5678
+ {
5679
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
5680
+ this.ResizeListener.observe(this.DivElement);
5681
+ }
5682
+
5683
+ this.OnDivResize=function(entries)
5684
+ {
5685
+ JSConsole.Chart.Log("[JSChart::OnDivResize] entries=", entries);
5686
+
5687
+ this.OnSize( {Type:1} );
5688
+ }
5689
+
5674
5690
  //创建工具条
5675
5691
  this.CreateToolbar=function(option)
5676
5692
  {
@@ -41906,6 +41922,7 @@ function ChartMultiText()
41906
41922
  {
41907
41923
  var border=this.ChartBorder.GetHScreenBorder();
41908
41924
  var chartright=border.BottomEx;
41925
+ var chartleft=border.TopEx;
41909
41926
  var xOffset=border.TopEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
41910
41927
  var left=this.ChartBorder.GetTop();
41911
41928
  var right=this.ChartBorder.GetBottom();
@@ -41917,6 +41934,7 @@ function ChartMultiText()
41917
41934
  var border=this.ChartBorder.GetBorder();
41918
41935
  var xOffset=border.LeftEx+distanceWidth/2.0+g_JSChartResource.FrameLeftMargin;
41919
41936
  var chartright=border.RightEx;
41937
+ var chartleft=border.LeftEx;
41920
41938
  var left=this.ChartBorder.GetLeft();
41921
41939
  var right=this.ChartBorder.GetRight();
41922
41940
  var top=border.TopEx;
@@ -41952,16 +41970,17 @@ function ChartMultiText()
41952
41970
 
41953
41971
  var textWidth=this.Canvas.measureText(item.Text).width;
41954
41972
  this.Canvas.textAlign='center';
41955
- if (x+textWidth/2>=right)
41973
+ if (x+textWidth/2>=chartright)
41956
41974
  {
41957
41975
  this.Canvas.textAlign='right';
41958
- x=right;
41976
+ x=chartright;
41959
41977
  }
41960
- else if (x-textWidth/2<left)
41978
+ else if (x-textWidth/2<chartleft)
41961
41979
  {
41962
41980
  this.Canvas.textAlign = 'left';
41963
- x=left;
41981
+ x=chartleft;
41964
41982
  }
41983
+
41965
41984
  if (item.Baseline==1) this.Canvas.textBaseline='top';
41966
41985
  else if (item.Baseline==2) this.Canvas.textBaseline='bottom';
41967
41986
  else this.Canvas.textBaseline = 'middle';
@@ -125146,18 +125165,76 @@ function JSReportChart(divElement)
125146
125165
  this.DivElement=divElement;
125147
125166
  this.JSChartContainer; //表格控件
125148
125167
 
125149
- //h5 canvas
125150
- this.CanvasElement=document.createElement("canvas");
125151
- this.CanvasElement.className='jsreportlist-drawing';
125152
- this.CanvasElement.id=Guid();
125153
- this.CanvasElement.setAttribute("tabindex",0);
125154
- if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
125155
- if(divElement.hasChildNodes())
125156
- {
125157
- JSConsole.Chart.Log("[JSReportChart::JSReportChart] divElement hasChildNodes", divElement.childNodes);
125158
- }
125159
- divElement.appendChild(this.CanvasElement);
125168
+ //h5 canvas
125169
+ this.CanvasElement=document.createElement("canvas");
125170
+ this.CanvasElement.className='jsreportlist-drawing';
125171
+ this.CanvasElement.id=Guid();
125172
+ this.CanvasElement.setAttribute("tabindex",0);
125173
+ if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
125174
+ if(divElement.hasChildNodes())
125175
+ {
125176
+ JSConsole.Chart.Log("[JSReportChart::JSReportChart] divElement hasChildNodes", divElement.childNodes);
125177
+ }
125178
+ divElement.appendChild(this.CanvasElement);
125179
+
125180
+ //额外的画布
125181
+ this.MapExtraCanvasElement=new Map(); //key=画布名字, value={ Element:, Canvas:}
125182
+
125183
+ this.CreateExtraCanvasElement=function(name, option)
125184
+ {
125185
+ if (this.MapExtraCanvasElement.has(name)) return this.MapExtraCanvasElement.get(name);
125186
+
125187
+ var element=document.createElement("canvas");
125188
+ element.className='jsreportlist-drawing-extra';
125189
+ element.id=Guid();
125190
+ if (name==JSChart.CorssCursorCanvasKey)
125191
+ element.setAttribute("tabindex",5);
125192
+ else
125193
+ element.setAttribute("tabindex",1);
125194
+
125195
+ if (element.style)
125196
+ {
125197
+ element.style.outline='none';
125198
+ element.style.position="absolute";
125199
+ element.style.left='0px';
125200
+ element.style.top='0px';
125201
+ element.style["pointer-events"]="none";
125202
+ }
125203
+
125204
+ if (option)
125205
+ {
125206
+ if (IFrameSplitOperator.IsNumber(option.TabIndex)) element.setAttribute("tabindex",option.TabIndex);
125207
+ if (IFrameSplitOperator.IsNumber(option.ZIndex)) element.style["z-index"]=option.ZIndex;
125208
+ }
125209
+
125210
+ if (this.CanvasElement)
125211
+ {
125212
+ element.height=this.CanvasElement.height;
125213
+ element.width=this.CanvasElement.width;
125214
+ if (element.style)
125215
+ {
125216
+ element.style.width=this.CanvasElement.style.width;
125217
+ element.style.height=this.CanvasElement.style.height
125218
+ }
125219
+ }
125220
+
125221
+ divElement.appendChild(element);
125222
+
125223
+ var item={ Element:element, Canvas:null };
125224
+ this.MapExtraCanvasElement.set(name, item);
125225
+ }
125226
+
125227
+ this.GetExtraCanvas=function(name)
125228
+ {
125229
+ if (!this.MapExtraCanvasElement.has(name)) return null;
125160
125230
 
125231
+ var item=this.MapExtraCanvasElement.get(name);
125232
+ if (!item.Element) return null;
125233
+
125234
+ if (!item.Canvas) item.Canvas=item.Element.getContext("2d");
125235
+
125236
+ return item;
125237
+ }
125161
125238
 
125162
125239
  this.OnSize=function()
125163
125240
  {
@@ -125172,6 +125249,19 @@ function JSReportChart(divElement)
125172
125249
  this.CanvasElement.height*=pixelTatio;
125173
125250
  this.CanvasElement.width*=pixelTatio;
125174
125251
 
125252
+ //扩展画布
125253
+ for(var mapItem of this.MapExtraCanvasElement)
125254
+ {
125255
+ var item=mapItem[1];
125256
+ var element=item.Element;
125257
+ if (!element) continue;
125258
+
125259
+ element.height=this.CanvasElement.height;
125260
+ element.width=this.CanvasElement.width;
125261
+ element.style.width=this.CanvasElement.style.width;
125262
+ element.style.height=this.CanvasElement.style.height;
125263
+ }
125264
+
125175
125265
  JSConsole.Chart.Log(`[JSReportChart::OnSize] devicePixelRatio=${window.devicePixelRatio}, height=${this.CanvasElement.height}, width=${this.CanvasElement.width}`);
125176
125266
 
125177
125267
  if (this.JSChartContainer && this.JSChartContainer.OnSize)
@@ -125333,6 +125423,8 @@ function JSReportChart(divElement)
125333
125423
  }
125334
125424
  }
125335
125425
 
125426
+ JSReportChart.TooltipCursorCanvasKey="hq_report_tooltip"; //提示信息
125427
+
125336
125428
 
125337
125429
  JSReportChart.Init=function(divElement)
125338
125430
  {
@@ -125551,6 +125643,15 @@ function JSReportChartContainer(uielement)
125551
125643
  }
125552
125644
 
125553
125645
 
125646
+ //清空画布
125647
+ this.ClearCanvas=function(canvas)
125648
+ {
125649
+ if (!canvas) return;
125650
+ if (!this.UIElement) return;
125651
+
125652
+ canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
125653
+ }
125654
+
125554
125655
  //清空固定行数据
125555
125656
  this.ClearFixedRowData=function()
125556
125657
  {
@@ -128799,8 +128900,10 @@ function ChartReport()
128799
128900
  if (item.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
128800
128901
  {
128801
128902
  if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
128903
+ colItem.FormatType=0; //0=默认格式 1=长度不够使用...
128802
128904
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
128803
128905
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
128906
+ if (IFrameSplitOperator.IsNumber(item.FormatType)) colItem.FormatType=item.FormatType; //输出样式
128804
128907
  }
128805
128908
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID)
128806
128909
  {
@@ -129756,8 +129859,67 @@ function ChartReport()
129756
129859
  }
129757
129860
 
129758
129861
  this.DrawItemBG(drawInfo);
129759
- this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
129862
+
129863
+ if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
129864
+ this.DrawCustomText(drawInfo,column, x, top, textWidth);
129865
+ else
129866
+ this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
129867
+ }
129868
+ }
129869
+
129870
+ this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
129871
+ {
129872
+ if (!drawInfo.Text) return;
129873
+
129874
+ var text=drawInfo.Text;
129875
+ var x=left;
129876
+ if (drawInfo.TextAlign=='center')
129877
+ {
129878
+ x=left+cellWidth/2;
129879
+ this.Canvas.textAlign="center";
129880
+ }
129881
+ else if (drawInfo.TextAlign=='right')
129882
+ {
129883
+ x=left+cellWidth-2;
129884
+ this.Canvas.textAlign="right";
129885
+ }
129886
+ else
129887
+ {
129888
+ x+=2;
129889
+ this.Canvas.textAlign="left";
129890
+ }
129891
+
129892
+ var textWidth=this.Canvas.measureText(text).width+1;
129893
+ var bClip=false;
129894
+ if (textWidth>=cellWidth) //长度超过单元格 裁剪
129895
+ {
129896
+ if (column.FormatType==2)
129897
+ {
129898
+ var count=text.length+5;
129899
+ text="";
129900
+ for(var i=0;i<count;++i)
129901
+ text+="#";
129902
+ }
129903
+ else if (column.FormatType==1)
129904
+ {
129905
+ text=this.TextEllipsis(text, cellWidth, column.MaxText);
129906
+ }
129907
+
129908
+ this.Canvas.save();
129909
+ bClip=true;
129910
+
129911
+ var rtCell={ Left:left, Top:top+this.ItemMergin.Top, Width:cellWidth, Height:this.RowHeight };
129912
+ this.Canvas.beginPath();
129913
+ this.Canvas.rect(rtCell.Left, rtCell.Top, rtCell.Width, rtCell.Height);
129914
+ //this.Canvas.stroke(); //调试用
129915
+ this.Canvas.clip();
129760
129916
  }
129917
+
129918
+ this.Canvas.textBaseline="middle";
129919
+ this.Canvas.fillStyle=drawInfo.TextColor;
129920
+ this.Canvas.fillText(text,x,top+this.ItemMergin.Top+this.RowHeight/2);
129921
+
129922
+ if (bClip) this.Canvas.restore();
129761
129923
  }
129762
129924
 
129763
129925
  this.DrawSymbolName=function(data, column, left, top, rowType)
@@ -134713,7 +134875,7 @@ function ScrollBarBGChart()
134713
134875
 
134714
134876
 
134715
134877
 
134716
- var HQCHART_VERSION="1.1.13519";
134878
+ var HQCHART_VERSION="1.1.13525";
134717
134879
 
134718
134880
  function PrintHQChartVersion()
134719
134881
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13519";
8
+ var HQCHART_VERSION="1.1.13525";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {