hqchart 1.1.13577 → 1.1.13584

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.13577",
3
+ "version": "1.1.13584",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -2601,6 +2601,7 @@ var JSCHART_EVENT_ID=
2601
2601
  ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
2602
2602
  ON_CLICK_REPORT_CHECKBOX:141, //报价列表checkbox
2603
2603
  ON_CLICK_REPORT_BUTTON:142, //报价列表按钮
2604
+ ON_CLICK_REPORT_LINK:143, //报价列表 链接
2604
2605
 
2605
2606
 
2606
2607
  ON_CHANGE_INDEX:150, //切换指标
@@ -67439,10 +67440,46 @@ function JSChartResource()
67439
67440
  CheckBox:
67440
67441
  {
67441
67442
  Family:"iconfont", Size:15,
67442
- Checked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
67443
- Unchecked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
67443
+ Checked:{ Color:"rgb(69,147,238)", Symbol:"\ue6b3", DisableColor:"rgb(230,230,230)", MouseOnColor:"rgb(69,147,238)" },
67444
+ Unchecked:{ Color:"rgb(120,120,120)", Symbol:"\ue6b4", DisableColor:"rgb(230,230,230)", MouseOnColor:"rgb(69,147,238)" },
67444
67445
 
67445
67446
  Margin:{ Left:5, Right:5, Bottom:2, Top:4 },
67447
+ },
67448
+
67449
+ Link:
67450
+ {
67451
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
67452
+ TextColor:"rgb(30,144,255)",
67453
+
67454
+ Disable:{ TextColor:"rgb(211,211,211)" },
67455
+ MouseOn:{ TextColor:"rgb(30,144,255)" },
67456
+ },
67457
+
67458
+ ProgressBar:
67459
+ {
67460
+ BGColor:"rgb(229,231,238)",
67461
+ BarColor:"rgb(26,125,255)",
67462
+ Margin:{ Left:2, Right:2, Bottom:2, Top:2 },
67463
+ BarMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
67464
+ TextColor:"rgb(0,0,0)",
67465
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
67466
+ TextMargin:{ Left:40, Right:2, Bottom:2, Top:2},
67467
+ Disable:{ BGColor:"rgb(229,231,238)", BarColor:"rgb(131,131,131)", TextColor:"rgb(159,161,159)"}
67468
+ },
67469
+
67470
+ Button:
67471
+ {
67472
+ BGColor:"rgb(61,134,180)",
67473
+ TextColor:"rgb(255,255,255)",
67474
+ BorderColor:"rgb(200,200,200)",
67475
+
67476
+ Disable:{ BGColor:"rgb(105,105,105)", TextColor:"rgb(169,169,169)"},
67477
+ MouseOn:{ BGColor:"rgb(57,125,169)", TextColor:"rgb(230,230,230)" },
67478
+
67479
+ Margin:{ Left:5, Right:5, Bottom:2, Top:2 },
67480
+ TextMargin:{ Bottom:2 },
67481
+
67482
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`
67446
67483
  }
67447
67484
  },
67448
67485
 
@@ -68485,6 +68522,58 @@ function JSChartResource()
68485
68522
 
68486
68523
  CopyMarginConfig(dest.CheckBox.Margin, subItem.Margin);
68487
68524
  }
68525
+
68526
+ if (item.Link)
68527
+ {
68528
+ var subItem=item.Link;
68529
+ if (subItem.Font) dest.Link.Font=subItem.Font;
68530
+ if (subItem.TextColor) dest.Link.TextColor=subItem.TextColor;
68531
+ if (subItem.Disable && subItem.Disable.TextColor) dest.Link.Disable.TextColor=subItem.Disable.TextColor;
68532
+ if (subItem.MouseOn && subItem.MouseOn.TextColor) dest.Link.MouseOn.TextColor=subItem.MouseOn.TextColor;
68533
+ }
68534
+
68535
+ if (item.ProgressBar)
68536
+ {
68537
+ var subItem=item.ProgressBar;
68538
+ if (subItem.BGColor) dest.ProgressBar.BGColor=subItem.BGColor;
68539
+ if (subItem.BarColor) dest.ProgressBar.BarColor=subItem.BarColor;
68540
+ if (subItem.TextColor) dest.ProgressBar.TextColor=subItem.TextColor;
68541
+ if (subItem.Font) dest.ProgressBar.Font=subItem.Font;
68542
+ if (subItem.Disable)
68543
+ {
68544
+ if (subItem.Disable.BGColor) dest.ProgressBar.Disable.BGColor=subItem.Disable.BGColor;
68545
+ if (subItem.Disable.BarColor) dest.ProgressBar.Disable.BarColor=subItem.Disable.BarColor;
68546
+ if (subItem.Disable.TextColor) dest.ProgressBar.Disable.TextColor=subItem.Disable.TextColor;
68547
+ }
68548
+
68549
+ CopyMarginConfig(dest.ProgressBar.Margin, subItem.Margin);
68550
+ CopyMarginConfig(dest.ProgressBar.BarMargin, subItem.BarMargin);
68551
+ CopyMarginConfig(dest.ProgressBar.TextMargin, subItem.TextMargin);
68552
+ }
68553
+
68554
+ if (item.Buttom)
68555
+ {
68556
+ var subItem=item.Buttom;
68557
+ if (subItem.BGColor) dest.Buttom.BGColor=subItem.BGColor;
68558
+ if (subItem.TextColor) dest.Buttom.TextColor=subItem.TextColor;
68559
+ if (subItem.BorderColor) dest.Buttom.BorderColor=subItem.BorderColor;
68560
+ if (subItem.Font) dest.Buttom.Font=subItem.Font;
68561
+
68562
+ if (subItem.Disable)
68563
+ {
68564
+ if (subItem.Disable.BGColor) dest.Buttom.Disable.BGColor=subItem.Disable.BGColor;
68565
+ if (subItem.Disable.TextColor) dest.Buttom.Disable.TextColor=subItem.Disable.TextColor;
68566
+ }
68567
+
68568
+ if (subItem.MouseOn)
68569
+ {
68570
+ if (subItem.MouseOn.BGColor) dest.Buttom.MouseOn.BGColor=subItem.MouseOn.BGColor;
68571
+ if (subItem.MouseOn.TextColor) dest.Buttom.MouseOn.TextColor=subItem.MouseOn.TextColor;
68572
+ }
68573
+
68574
+ CopyMarginConfig(dest.Buttom.Margin, subItem.Margin);
68575
+ CopyMarginConfig(dest.Buttom.TextMargin, subItem.TextMargin);
68576
+ }
68488
68577
 
68489
68578
  }
68490
68579
 
@@ -460,7 +460,8 @@ function JSReportChartContainer(uielement)
460
460
  this.JSPopMenu; //内置菜单
461
461
  this.IsShowRightMenu=true;
462
462
 
463
- this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null };
463
+ //MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
464
+ this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
464
465
 
465
466
  this.ChartDestory=function() //销毁
466
467
  {
@@ -699,6 +700,7 @@ function JSReportChartContainer(uielement)
699
700
  this.Canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
700
701
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
701
702
  this.Canvas.lineWidth=pixelTatio; //手机端需要根据分辨率比调整线段宽度
703
+ this.LastMouseStatus.MouseOnStatus=null;
702
704
 
703
705
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash)
704
706
  {
@@ -715,14 +717,14 @@ function JSReportChartContainer(uielement)
715
717
  {
716
718
  var item=this.ChartPaint[i];
717
719
  if (item.IsDrawFirst)
718
- item.Draw();
720
+ item.Draw(this.LastMouseStatus);
719
721
  }
720
722
 
721
723
  for(var i=0; i<this.ChartPaint.length; ++i)
722
724
  {
723
725
  var item=this.ChartPaint[i];
724
726
  if (!item.IsDrawFirst)
725
- item.Draw();
727
+ item.Draw(this.LastMouseStatus);
726
728
  }
727
729
 
728
730
  if (this.GlobalOption.FlashBGCount>0)
@@ -1753,6 +1755,7 @@ function JSReportChartContainer(uielement)
1753
1755
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
1754
1756
  var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
1755
1757
 
1758
+ var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
1756
1759
  this.LastMouseStatus.OnMouseMove=null;
1757
1760
 
1758
1761
  var bDrawTooltip=false;
@@ -1764,6 +1767,7 @@ function JSReportChartContainer(uielement)
1764
1767
  if (this.DragColumnWidth) return;
1765
1768
 
1766
1769
  var tabChart=this.GetTabChart();
1770
+ var bDrawTab=false;
1767
1771
  if (tabChart)
1768
1772
  {
1769
1773
  var tabData=tabChart.PtInTab(x,y);
@@ -1773,9 +1777,18 @@ function JSReportChartContainer(uielement)
1773
1777
  if (tabChart.MoveOnTabIndex!=index)
1774
1778
  {
1775
1779
  tabChart.MoveOnTabIndex=index;
1776
- this.Draw();
1780
+ bDrawTab=true;
1777
1781
  }
1778
1782
  }
1783
+ else
1784
+ {
1785
+ if (tabChart.MoveOnTabIndex>=0)
1786
+ {
1787
+ tabChart.MoveOnTabIndex=-1;
1788
+ bDrawTab=true;
1789
+ }
1790
+
1791
+ }
1779
1792
  }
1780
1793
 
1781
1794
  this.LastMouseStatus.OnMouseMove={ X:x, Y:y };
@@ -1793,12 +1806,28 @@ function JSReportChartContainer(uielement)
1793
1806
  }
1794
1807
  else
1795
1808
  {
1796
- var bottonData=report.GetButtonData(x,y)
1797
- if (bottonData)
1809
+ var buttonData=report.GetButtonData(x,y);
1810
+ var mouseOnStatus=null;
1811
+ if (buttonData)
1798
1812
  {
1799
1813
  mouseStatus={ Cursor:"pointer", Name:"Botton"};
1814
+ if (buttonData.Type==1 || buttonData.Type==0 || buttonData.Type==2)
1815
+ {
1816
+ mouseOnStatus={ Index:buttonData.Index, ColumnIndex:buttonData.ColumnIndex };
1817
+ }
1800
1818
  }
1801
1819
 
1820
+ //console.log("[UIOnMouseMove] ", oldMouseOnStatus, mouseOnStatus)
1821
+ if ((!oldMouseOnStatus && mouseOnStatus) || (oldMouseOnStatus && !mouseOnStatus))
1822
+ {
1823
+ bDraw=true;
1824
+ }
1825
+ else if (oldMouseOnStatus && mouseOnStatus)
1826
+ {
1827
+ if (oldMouseOnStatus.Index!=mouseOnStatus.Index || oldMouseOnStatus.ColumnIndex!=mouseOnStatus.ColumnIndex)
1828
+ bDraw=true;
1829
+ }
1830
+
1802
1831
  var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
1803
1832
  if (tooltipData)
1804
1833
  {
@@ -1832,7 +1861,7 @@ function JSReportChartContainer(uielement)
1832
1861
 
1833
1862
  if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
1834
1863
 
1835
- if (bDraw) this.Draw();
1864
+ if (bDraw || bDrawTab) this.Draw();
1836
1865
  else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
1837
1866
  }
1838
1867
 
@@ -3682,6 +3711,7 @@ var REPORT_COLUMN_ID=
3682
3711
  CUSTOM_CHECKBOX_ID:104, //自定义checkbox
3683
3712
  CUSTOM_BUTTON_ID:105, //自定义按钮
3684
3713
  CUSTOM_PROGRESS_ID:106, //进度条
3714
+ CUSTOM_LINK_ID:107, //链接
3685
3715
  }
3686
3716
 
3687
3717
  var MAP_COLUMN_FIELD=new Map([
@@ -3852,6 +3882,9 @@ function ChartReport()
3852
3882
  }
3853
3883
 
3854
3884
  this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
3885
+ this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
3886
+ this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
3887
+ this.ButtonConfig=CloneData(g_JSChartResource.Report.Button);
3855
3888
 
3856
3889
  //股票代码+股票名称
3857
3890
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
@@ -3895,6 +3928,8 @@ function ChartReport()
3895
3928
  //{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
3896
3929
  this.ButtonRect=[];
3897
3930
 
3931
+ this.LastMouseStatus;
3932
+
3898
3933
  this.ReloadResource=function(resource)
3899
3934
  {
3900
3935
  this.DevicePixelRatio=GetDevicePixelRatio()
@@ -3985,6 +4020,10 @@ function ChartReport()
3985
4020
 
3986
4021
  if (this.Tab) this.Tab.ReloadResource(resource);
3987
4022
  if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
4023
+
4024
+ this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
4025
+ this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
4026
+ this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
3988
4027
  }
3989
4028
 
3990
4029
  this.SetColumn=function(aryColumn)
@@ -4056,7 +4095,7 @@ function ChartReport()
4056
4095
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
4057
4096
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
4058
4097
  if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
4059
- else colItem.CheckBox=CloneData(g_JSChartResource.Report.CheckBox);
4098
+ else colItem.CheckBox=this.CheckBoxConfig;
4060
4099
  }
4061
4100
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID)
4062
4101
  {
@@ -4064,6 +4103,7 @@ function ChartReport()
4064
4103
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
4065
4104
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
4066
4105
  if (item.Button) colItem.Button=CloneData(item.Button);
4106
+ else colItem.Button=this.ButtonConfig;
4067
4107
  }
4068
4108
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
4069
4109
  {
@@ -4071,6 +4111,15 @@ function ChartReport()
4071
4111
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
4072
4112
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
4073
4113
  if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
4114
+ else colItem.ProgressBar=this.ProgressBarConfig;
4115
+ }
4116
+ else if (item.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
4117
+ {
4118
+ if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
4119
+ if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
4120
+ if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
4121
+ if (item.Link) colItem.Link=CloneData(item.Link);
4122
+ else colItem.Link=this.LinkConfig;
4074
4123
  }
4075
4124
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
4076
4125
  {
@@ -4190,7 +4239,8 @@ function ChartReport()
4190
4239
  { Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
4191
4240
 
4192
4241
  { Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID, Title:"", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
4193
- { Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() }
4242
+ { Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
4243
+ { Type:REPORT_COLUMN_ID.CUSTOM_LINK_ID, Title:"链接地址", TextAlign:"center", MaxText:"擎擎擎擎擎" }
4194
4244
  ];
4195
4245
 
4196
4246
  for(var i=0;i<DEFAULT_COLUMN.length;++i)
@@ -4211,12 +4261,13 @@ function ChartReport()
4211
4261
  this.Canvas.clip();
4212
4262
  }
4213
4263
 
4214
- this.Draw=function()
4264
+ this.Draw=function(lastMouseStatus)
4215
4265
  {
4216
4266
  this.ShowSymbol=[];
4217
4267
  this.TooltipRect=[];
4218
4268
  this.ButtonRect=[];
4219
4269
  this.DevicePixelRatio=GetDevicePixelRatio()
4270
+ this.LastMouseStatus=lastMouseStatus;
4220
4271
 
4221
4272
  if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
4222
4273
 
@@ -4248,6 +4299,7 @@ function ChartReport()
4248
4299
  this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight, this.RectClient.Right, bottom-this.BottomToolbarHeight-4);
4249
4300
  }
4250
4301
 
4302
+ this.LastMouseStatus=null;
4251
4303
  this.SizeChange=false;
4252
4304
  }
4253
4305
 
@@ -4887,7 +4939,7 @@ function ChartReport()
4887
4939
  for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
4888
4940
  {
4889
4941
  var item=this.Column[i];
4890
- this.DrawItem(dataIndex, data, item, left, top, rowType);
4942
+ this.DrawItem(dataIndex, data, item, left, top, rowType, i);
4891
4943
  left+=item.Width;
4892
4944
 
4893
4945
  if (left>=chartRight) break;
@@ -4896,20 +4948,24 @@ function ChartReport()
4896
4948
  for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
4897
4949
  {
4898
4950
  var item=this.Column[i];
4899
- this.DrawItem(dataIndex, data, item, left, top, rowType);
4951
+ this.DrawItem(dataIndex, data, item, left, top, rowType, i);
4900
4952
  left+=item.Width;
4901
4953
 
4902
4954
  if (left>=chartRight) break;
4903
4955
  }
4904
4956
  }
4905
4957
 
4906
- this.DrawItem=function(index, data, column, left, top, rowType)
4958
+ this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
4907
4959
  {
4908
4960
  var itemWidth=column.Width;
4909
4961
  var x=left+this.ItemMergin.Left;
4910
4962
  var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
4911
4963
  var stock=data.Stock;
4912
- var drawInfo={ Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null };
4964
+ var drawInfo=
4965
+ {
4966
+ Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null,
4967
+ Index:index, ColumnIndex:columnIndex
4968
+ };
4913
4969
  var rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
4914
4970
  rtItem.Right=rtItem.Left+rtItem.Width;
4915
4971
  rtItem.Bottom=rtItem.Top+rtItem.Height;
@@ -5172,6 +5228,10 @@ function ChartReport()
5172
5228
 
5173
5229
  this.GetCustomProgressBarDrawInfo(data, column, drawInfo);
5174
5230
  }
5231
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
5232
+ {
5233
+ this.GetCustomLinkDrawInfo(data, column, drawInfo);
5234
+ }
5175
5235
 
5176
5236
 
5177
5237
  //拖拽行颜色
@@ -5198,6 +5258,10 @@ function ChartReport()
5198
5258
  {
5199
5259
  this.DrawProgressBar(drawInfo, left, top, itemWidth);
5200
5260
  }
5261
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
5262
+ {
5263
+ this.DrawLinkText(drawInfo, x, top, textWidth);
5264
+ }
5201
5265
  else
5202
5266
  {
5203
5267
  if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
@@ -5231,7 +5295,7 @@ function ChartReport()
5231
5295
 
5232
5296
  if (drawInfo.Botton)
5233
5297
  {
5234
- var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
5298
+ var buttonData={ Stock:stock, Index:index, ColumnIndex:columnIndex, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
5235
5299
  this.ButtonRect.push(buttonData);
5236
5300
  }
5237
5301
  }
@@ -5529,6 +5593,20 @@ function ChartReport()
5529
5593
  if (barData.BGColor) drawInfo.BGColor=barData.BGColor;
5530
5594
  }
5531
5595
 
5596
+ this.GetCustomLinkDrawInfo=function(data, column, drawInfo)
5597
+ {
5598
+ var linkData=this.GetExtendData(data, column);
5599
+ if (!linkData) return;
5600
+
5601
+ drawInfo.Text=linkData.Title;
5602
+ drawInfo.Link=column.Link;
5603
+ drawInfo.Enable=true;
5604
+ drawInfo.Data=linkData;
5605
+ drawInfo.MaxText=column.MaxText;
5606
+ if (IFrameSplitOperator.IsBool(linkData.Enable)) drawInfo.Enable=linkData.Enable;
5607
+ if (linkData.TextColor) drawInfo.TextColor=linkData.TextColor;
5608
+ }
5609
+
5532
5610
  this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
5533
5611
  {
5534
5612
  if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
@@ -5798,35 +5876,57 @@ function ChartReport()
5798
5876
  if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
5799
5877
  if (!drawInfo.CheckBox) return;
5800
5878
 
5801
- drawInfo.Font=`${drawInfo.CheckBox.Size*this.DevicePixelRatio}px ${drawInfo.CheckBox.Family}`;
5879
+ var config=drawInfo.CheckBox;
5880
+ drawInfo.Font=`${config.Size*this.DevicePixelRatio}px ${config.Family}`;
5802
5881
  var textAlign=drawInfo.TextAlign;
5803
5882
  var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
5804
5883
  var x=left+drawInfo.CheckBox.Margin.Left;
5805
5884
  var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
5885
+
5806
5886
  if (textAlign=='center') x=left+width/2-size/2;
5807
- else if (textAlign=='right') x=left+width-drawInfo.CheckBox.Margin.Right;
5887
+ else if (textAlign=='right') x=left+width-config.Margin.Right;
5888
+
5889
+ var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
5890
+ rtBox.Right=rtBox.Left+rtBox.Width;
5891
+ rtBox.Top=rtBox.Bottom-rtBox.Height;
5892
+
5893
+ //鼠标在上面
5894
+ var bMouseOn=false;
5895
+ if (drawInfo.Enable && this.LastMouseStatus && this.LastMouseStatus.OnMouseMove)
5896
+ {
5897
+ var xMouse=this.LastMouseStatus.OnMouseMove.X;
5898
+ var yMouse=this.LastMouseStatus.OnMouseMove.Y;
5899
+ if (xMouse>rtBox.Left && xMouse<rtBox.Right && yMouse>rtBox.Top && yMouse<rtBox.Bottom)
5900
+ {
5901
+ bMouseOn=true;
5902
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:0 };
5903
+ }
5904
+ }
5808
5905
 
5809
5906
  this.Canvas.font=drawInfo.Font;
5810
5907
  this.Canvas.textBaseline="bottom";
5811
5908
  this.Canvas.textAlign="left";
5812
5909
  if (drawInfo.Checked===true)
5813
5910
  {
5814
- if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Checked.DisableColor;
5815
- else this.Canvas.fillStyle=drawInfo.CheckBox.Checked.Color;
5816
- this.Canvas.fillText(drawInfo.CheckBox.Checked.Symbol,x,y);
5911
+ var textColor=config.Checked.Color;
5912
+ if (drawInfo.Enable===false) textColor=config.Checked.DisableColor;
5913
+ else if (bMouseOn) textColor=config.Checked.MouseOnColor;
5914
+
5915
+ this.Canvas.fillStyle=textColor;
5916
+ this.Canvas.fillText(config.Checked.Symbol,x,y);
5817
5917
  }
5818
5918
  else if (drawInfo.Checked===false)
5819
5919
  {
5820
- if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.DisableColor;
5821
- else this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.Color;
5822
- this.Canvas.fillText(drawInfo.CheckBox.Unchecked.Symbol,x,y);
5920
+ var textColor=config.Unchecked.Color;
5921
+ if (drawInfo.Enable===false) textColor=config.Unchecked.DisableColor;
5922
+ else if (bMouseOn) textColor=config.Unchecked.MouseOnColor;
5923
+
5924
+ this.Canvas.fillStyle=textColor;
5925
+ this.Canvas.fillText(config.Unchecked.Symbol,x,y);
5823
5926
  }
5824
5927
 
5825
5928
  if (drawInfo.Enable)
5826
5929
  {
5827
- var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
5828
- rtBox.Right=rtBox.Left+rtBox.Width;
5829
- rtBox.Top=rtBox.Bottom-rtBox.Height;
5830
5930
  drawInfo.Botton={ Rect:rtBox, Type:0 };
5831
5931
  }
5832
5932
  }
@@ -5835,6 +5935,7 @@ function ChartReport()
5835
5935
  {
5836
5936
  if (!drawInfo.Button) return;
5837
5937
 
5938
+ var config=drawInfo.Button;
5838
5939
  var rtBG=
5839
5940
  {
5840
5941
  Left:left+drawInfo.Button.Margin.Left, Top:top+drawInfo.Button.Margin.Top,
@@ -5844,11 +5945,26 @@ function ChartReport()
5844
5945
  rtBG.Right=rtBG.Left+rtBG.Width;
5845
5946
  rtBG.Bottom=rtBG.Top+rtBG.Height;
5846
5947
 
5847
- var bgColor=drawInfo.Button.BGColor, textColor=drawInfo.Button.TextColor;
5948
+ var bgColor=config.BGColor, textColor=config.TextColor;
5848
5949
  if (drawInfo.Enable===false)
5849
5950
  {
5850
- bgColor=drawInfo.Button.Disable.BGColor;
5851
- textColor=drawInfo.Button.Disable.TextColor;
5951
+ bgColor=config.Disable.BGColor;
5952
+ textColor=config.Disable.TextColor;
5953
+ }
5954
+ else
5955
+ {
5956
+ if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
5957
+ {
5958
+ var x=this.LastMouseStatus.OnMouseMove.X;
5959
+ var y=this.LastMouseStatus.OnMouseMove.Y;
5960
+ if (x>rtBG.Left && x<rtBG.Right && y>rtBG.Top && y<rtBG.Bottom)
5961
+ {
5962
+ bgColor=config.MouseOn.BGColor;
5963
+ textColor=config.MouseOn.TextColor;
5964
+
5965
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:1 };
5966
+ }
5967
+ }
5852
5968
  }
5853
5969
 
5854
5970
  this.Canvas.fillStyle=bgColor;
@@ -5932,6 +6048,81 @@ function ChartReport()
5932
6048
  }
5933
6049
  }
5934
6050
 
6051
+ this.DrawLinkText=function(drawInfo, left, top, width)
6052
+ {
6053
+ if (!drawInfo.Link || !drawInfo.Text) return;
6054
+
6055
+ var config=drawInfo.Link;
6056
+ var text=drawInfo.Text;
6057
+ var textAlign=drawInfo.TextAlign;
6058
+ var font=config.Font;
6059
+ var color=config.TextColor;
6060
+
6061
+
6062
+
6063
+ this.Canvas.font=font;
6064
+ var textWidth=this.Canvas.measureText(text).width;
6065
+ var textHeight=this.Canvas.measureText("擎").width;
6066
+ var x=left;
6067
+ if (width>=textWidth)
6068
+ {
6069
+ if (textAlign=='center') x=left+(width-textWidth)/2;
6070
+ else if (textAlign=='right') x=left+width-textWidth;
6071
+ }
6072
+ else
6073
+ {
6074
+ text=this.TextEllipsis(text, width, drawInfo.MaxText);
6075
+ textWidth=this.Canvas.measureText(text).width;
6076
+
6077
+ //数据截断提示信息
6078
+ drawInfo.Tooltip=
6079
+ {
6080
+ Type:2,
6081
+ Data:{ AryText:[ {Text:drawInfo.Text} ] }
6082
+ }
6083
+ }
6084
+
6085
+ var rtText={Left:x, Bottom:top+this.RowHeight-this.ItemMergin.Bottom, Height:textHeight, Width:textWidth };
6086
+ rtText.Right=rtText.Left+rtText.Width;
6087
+ rtText.Top=rtText.Bottom-rtText.Height;
6088
+
6089
+ var drawLine=false; //下划线
6090
+ if (drawInfo.Enable===false)
6091
+ {
6092
+ color=config.Disable.TextColor;
6093
+ }
6094
+ else if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
6095
+ {
6096
+ var x=this.LastMouseStatus.OnMouseMove.X;
6097
+ var y=this.LastMouseStatus.OnMouseMove.Y;
6098
+ if (x>rtText.Left && x<rtText.Right && y>rtText.Top && y<rtText.Bottom)
6099
+ {
6100
+ color=config.MouseOn.TextColor;
6101
+ drawLine=true;
6102
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:2 };
6103
+ }
6104
+ }
6105
+
6106
+ this.Canvas.textBaseline="bottom";
6107
+ this.Canvas.textAlign="left";
6108
+ this.Canvas.fillStyle=color;
6109
+ this.Canvas.fillText(text,rtText.Left, rtText.Bottom);
6110
+
6111
+ if (drawLine)
6112
+ {
6113
+ this.Canvas.strokeStyle=color;
6114
+ this.Canvas.beginPath();
6115
+ this.Canvas.moveTo(rtText.Left,rtText.Bottom);
6116
+ this.Canvas.lineTo(rtText.Right,rtText.Bottom);
6117
+ this.Canvas.stroke();
6118
+ }
6119
+
6120
+ if (drawInfo.Enable)
6121
+ {
6122
+ drawInfo.Botton={ Rect:rtText, Type:2 };
6123
+ }
6124
+ }
6125
+
5935
6126
  //字体由外面设置
5936
6127
  this.TextEllipsis=function(text, maxWidth, maxText)
5937
6128
  {
@@ -6644,6 +6835,14 @@ function ChartReport()
6644
6835
  status.Redraw=true;
6645
6836
  return true;
6646
6837
  }
6838
+ else if (buttonData.Type===2) //link
6839
+ {
6840
+ var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data };
6841
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_LINK, sendData)
6842
+
6843
+ status.Redraw=true;
6844
+ return true;
6845
+ }
6647
6846
 
6648
6847
  return false;
6649
6848
  }
@@ -6898,7 +7097,7 @@ function ChartReport()
6898
7097
 
6899
7098
  if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
6900
7099
  {
6901
- return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
7100
+ return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data, ColumnIndex:item.ColumnIndex };
6902
7101
  }
6903
7102
  }
6904
7103
  }