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.
@@ -6526,6 +6526,7 @@ var JSCHART_EVENT_ID=
6526
6526
  ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6527
6527
  ON_CLICK_REPORT_CHECKBOX:141, //报价列表checkbox
6528
6528
  ON_CLICK_REPORT_BUTTON:142, //报价列表按钮
6529
+ ON_CLICK_REPORT_LINK:143, //报价列表 链接
6529
6530
 
6530
6531
 
6531
6532
  ON_CHANGE_INDEX:150, //切换指标
@@ -71364,10 +71365,46 @@ function JSChartResource()
71364
71365
  CheckBox:
71365
71366
  {
71366
71367
  Family:"iconfont", Size:15,
71367
- Checked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
71368
- Unchecked:{ Color:"rgb(33,148,240)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
71368
+ Checked:{ Color:"rgb(69,147,238)", Symbol:"\ue6b3", DisableColor:"rgb(230,230,230)", MouseOnColor:"rgb(69,147,238)" },
71369
+ Unchecked:{ Color:"rgb(120,120,120)", Symbol:"\ue6b4", DisableColor:"rgb(230,230,230)", MouseOnColor:"rgb(69,147,238)" },
71369
71370
 
71370
71371
  Margin:{ Left:5, Right:5, Bottom:2, Top:4 },
71372
+ },
71373
+
71374
+ Link:
71375
+ {
71376
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
71377
+ TextColor:"rgb(30,144,255)",
71378
+
71379
+ Disable:{ TextColor:"rgb(211,211,211)" },
71380
+ MouseOn:{ TextColor:"rgb(30,144,255)" },
71381
+ },
71382
+
71383
+ ProgressBar:
71384
+ {
71385
+ BGColor:"rgb(229,231,238)",
71386
+ BarColor:"rgb(26,125,255)",
71387
+ Margin:{ Left:2, Right:2, Bottom:2, Top:2 },
71388
+ BarMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
71389
+ TextColor:"rgb(0,0,0)",
71390
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
71391
+ TextMargin:{ Left:40, Right:2, Bottom:2, Top:2},
71392
+ Disable:{ BGColor:"rgb(229,231,238)", BarColor:"rgb(131,131,131)", TextColor:"rgb(159,161,159)"}
71393
+ },
71394
+
71395
+ Button:
71396
+ {
71397
+ BGColor:"rgb(61,134,180)",
71398
+ TextColor:"rgb(255,255,255)",
71399
+ BorderColor:"rgb(200,200,200)",
71400
+
71401
+ Disable:{ BGColor:"rgb(105,105,105)", TextColor:"rgb(169,169,169)"},
71402
+ MouseOn:{ BGColor:"rgb(57,125,169)", TextColor:"rgb(230,230,230)" },
71403
+
71404
+ Margin:{ Left:5, Right:5, Bottom:2, Top:2 },
71405
+ TextMargin:{ Bottom:2 },
71406
+
71407
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`
71371
71408
  }
71372
71409
  },
71373
71410
 
@@ -72410,6 +72447,58 @@ function JSChartResource()
72410
72447
 
72411
72448
  CopyMarginConfig(dest.CheckBox.Margin, subItem.Margin);
72412
72449
  }
72450
+
72451
+ if (item.Link)
72452
+ {
72453
+ var subItem=item.Link;
72454
+ if (subItem.Font) dest.Link.Font=subItem.Font;
72455
+ if (subItem.TextColor) dest.Link.TextColor=subItem.TextColor;
72456
+ if (subItem.Disable && subItem.Disable.TextColor) dest.Link.Disable.TextColor=subItem.Disable.TextColor;
72457
+ if (subItem.MouseOn && subItem.MouseOn.TextColor) dest.Link.MouseOn.TextColor=subItem.MouseOn.TextColor;
72458
+ }
72459
+
72460
+ if (item.ProgressBar)
72461
+ {
72462
+ var subItem=item.ProgressBar;
72463
+ if (subItem.BGColor) dest.ProgressBar.BGColor=subItem.BGColor;
72464
+ if (subItem.BarColor) dest.ProgressBar.BarColor=subItem.BarColor;
72465
+ if (subItem.TextColor) dest.ProgressBar.TextColor=subItem.TextColor;
72466
+ if (subItem.Font) dest.ProgressBar.Font=subItem.Font;
72467
+ if (subItem.Disable)
72468
+ {
72469
+ if (subItem.Disable.BGColor) dest.ProgressBar.Disable.BGColor=subItem.Disable.BGColor;
72470
+ if (subItem.Disable.BarColor) dest.ProgressBar.Disable.BarColor=subItem.Disable.BarColor;
72471
+ if (subItem.Disable.TextColor) dest.ProgressBar.Disable.TextColor=subItem.Disable.TextColor;
72472
+ }
72473
+
72474
+ CopyMarginConfig(dest.ProgressBar.Margin, subItem.Margin);
72475
+ CopyMarginConfig(dest.ProgressBar.BarMargin, subItem.BarMargin);
72476
+ CopyMarginConfig(dest.ProgressBar.TextMargin, subItem.TextMargin);
72477
+ }
72478
+
72479
+ if (item.Buttom)
72480
+ {
72481
+ var subItem=item.Buttom;
72482
+ if (subItem.BGColor) dest.Buttom.BGColor=subItem.BGColor;
72483
+ if (subItem.TextColor) dest.Buttom.TextColor=subItem.TextColor;
72484
+ if (subItem.BorderColor) dest.Buttom.BorderColor=subItem.BorderColor;
72485
+ if (subItem.Font) dest.Buttom.Font=subItem.Font;
72486
+
72487
+ if (subItem.Disable)
72488
+ {
72489
+ if (subItem.Disable.BGColor) dest.Buttom.Disable.BGColor=subItem.Disable.BGColor;
72490
+ if (subItem.Disable.TextColor) dest.Buttom.Disable.TextColor=subItem.Disable.TextColor;
72491
+ }
72492
+
72493
+ if (subItem.MouseOn)
72494
+ {
72495
+ if (subItem.MouseOn.BGColor) dest.Buttom.MouseOn.BGColor=subItem.MouseOn.BGColor;
72496
+ if (subItem.MouseOn.TextColor) dest.Buttom.MouseOn.TextColor=subItem.MouseOn.TextColor;
72497
+ }
72498
+
72499
+ CopyMarginConfig(dest.Buttom.Margin, subItem.Margin);
72500
+ CopyMarginConfig(dest.Buttom.TextMargin, subItem.TextMargin);
72501
+ }
72413
72502
 
72414
72503
  }
72415
72504
 
@@ -123830,8 +123919,29 @@ function GetBlackStyle()
123830
123919
  CheckBox:
123831
123920
  {
123832
123921
  Family:"iconfont", Size:15,
123833
- Checked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b3", DisableColor:"rgb(112,128,144)" },
123834
- Unchecked:{ Color:"rgb(237,60,31)", Symbol:"\ue6b4", DisableColor:"rgb(112,128,144)" },
123922
+ Checked:{ Color:"rgb(69,147,238)", Symbol:"\ue6b3", DisableColor:"rgb(120,120,120)", MouseOnColor:"rgb(69,147,238)" },
123923
+ Unchecked:{ Color:"rgb(210,210,210)", Symbol:"\ue6b4", DisableColor:"rgb(120,120,120)", MouseOnColor:"rgb(69,147,238)" },
123924
+ },
123925
+
123926
+ Link:
123927
+ {
123928
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
123929
+ TextColor:"rgb(0,144,255)",
123930
+
123931
+ Disable:{ TextColor:"rgb(211,211,211)" },
123932
+ MouseOn:{ TextColor:"rgb(0,144,255)" },
123933
+ },
123934
+
123935
+ ProgressBar:
123936
+ {
123937
+ BGColor:"rgb(20,24,28)",
123938
+ BarColor:"rgb(47,124,197)",
123939
+ Margin:{ Left:2, Right:2, Bottom:2, Top:2 },
123940
+ BarMargin:{ Left:2, Right:2, Bottom:2, Top:2 },
123941
+ TextColor:"rgb(230,230,230)",
123942
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
123943
+ TextMargin:{ Left:40, Right:2, Bottom:2, Top:2},
123944
+ Disable:{ BGColor:"rgb(61,61,61)", BarColor:"rgb(131,131,131)", TextColor:"rgb(159,161,159)"}
123835
123945
  }
123836
123946
  },
123837
123947
 
@@ -125872,7 +125982,8 @@ function JSReportChartContainer(uielement)
125872
125982
  this.JSPopMenu; //内置菜单
125873
125983
  this.IsShowRightMenu=true;
125874
125984
 
125875
- this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null };
125985
+ //MouseOnStatus:{ RowIndex:行, ColumnIndex:列}
125986
+ this.LastMouseStatus={ MoveStatus:null, TooltipStatus:null, MouseOnStatus:null };
125876
125987
 
125877
125988
  this.ChartDestory=function() //销毁
125878
125989
  {
@@ -126111,6 +126222,7 @@ function JSReportChartContainer(uielement)
126111
126222
  this.Canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
126112
126223
  var pixelTatio = GetDevicePixelRatio(); //获取设备的分辨率
126113
126224
  this.Canvas.lineWidth=pixelTatio; //手机端需要根据分辨率比调整线段宽度
126225
+ this.LastMouseStatus.MouseOnStatus=null;
126114
126226
 
126115
126227
  if (this.ChartSplashPaint && this.ChartSplashPaint.IsEnableSplash)
126116
126228
  {
@@ -126127,14 +126239,14 @@ function JSReportChartContainer(uielement)
126127
126239
  {
126128
126240
  var item=this.ChartPaint[i];
126129
126241
  if (item.IsDrawFirst)
126130
- item.Draw();
126242
+ item.Draw(this.LastMouseStatus);
126131
126243
  }
126132
126244
 
126133
126245
  for(var i=0; i<this.ChartPaint.length; ++i)
126134
126246
  {
126135
126247
  var item=this.ChartPaint[i];
126136
126248
  if (!item.IsDrawFirst)
126137
- item.Draw();
126249
+ item.Draw(this.LastMouseStatus);
126138
126250
  }
126139
126251
 
126140
126252
  if (this.GlobalOption.FlashBGCount>0)
@@ -127165,6 +127277,7 @@ function JSReportChartContainer(uielement)
127165
127277
  var x = (e.clientX-this.UIElement.getBoundingClientRect().left)*pixelTatio;
127166
127278
  var y = (e.clientY-this.UIElement.getBoundingClientRect().top)*pixelTatio;
127167
127279
 
127280
+ var oldMouseOnStatus=this.LastMouseStatus.MouseOnStatus;
127168
127281
  this.LastMouseStatus.OnMouseMove=null;
127169
127282
 
127170
127283
  var bDrawTooltip=false;
@@ -127176,6 +127289,7 @@ function JSReportChartContainer(uielement)
127176
127289
  if (this.DragColumnWidth) return;
127177
127290
 
127178
127291
  var tabChart=this.GetTabChart();
127292
+ var bDrawTab=false;
127179
127293
  if (tabChart)
127180
127294
  {
127181
127295
  var tabData=tabChart.PtInTab(x,y);
@@ -127185,9 +127299,18 @@ function JSReportChartContainer(uielement)
127185
127299
  if (tabChart.MoveOnTabIndex!=index)
127186
127300
  {
127187
127301
  tabChart.MoveOnTabIndex=index;
127188
- this.Draw();
127302
+ bDrawTab=true;
127189
127303
  }
127190
127304
  }
127305
+ else
127306
+ {
127307
+ if (tabChart.MoveOnTabIndex>=0)
127308
+ {
127309
+ tabChart.MoveOnTabIndex=-1;
127310
+ bDrawTab=true;
127311
+ }
127312
+
127313
+ }
127191
127314
  }
127192
127315
 
127193
127316
  this.LastMouseStatus.OnMouseMove={ X:x, Y:y };
@@ -127205,12 +127328,28 @@ function JSReportChartContainer(uielement)
127205
127328
  }
127206
127329
  else
127207
127330
  {
127208
- var bottonData=report.GetButtonData(x,y)
127209
- if (bottonData)
127331
+ var buttonData=report.GetButtonData(x,y);
127332
+ var mouseOnStatus=null;
127333
+ if (buttonData)
127210
127334
  {
127211
127335
  mouseStatus={ Cursor:"pointer", Name:"Botton"};
127336
+ if (buttonData.Type==1 || buttonData.Type==0 || buttonData.Type==2)
127337
+ {
127338
+ mouseOnStatus={ Index:buttonData.Index, ColumnIndex:buttonData.ColumnIndex };
127339
+ }
127212
127340
  }
127213
127341
 
127342
+ //console.log("[UIOnMouseMove] ", oldMouseOnStatus, mouseOnStatus)
127343
+ if ((!oldMouseOnStatus && mouseOnStatus) || (oldMouseOnStatus && !mouseOnStatus))
127344
+ {
127345
+ bDraw=true;
127346
+ }
127347
+ else if (oldMouseOnStatus && mouseOnStatus)
127348
+ {
127349
+ if (oldMouseOnStatus.Index!=mouseOnStatus.Index || oldMouseOnStatus.ColumnIndex!=mouseOnStatus.ColumnIndex)
127350
+ bDraw=true;
127351
+ }
127352
+
127214
127353
  var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
127215
127354
  if (tooltipData)
127216
127355
  {
@@ -127244,7 +127383,7 @@ function JSReportChartContainer(uielement)
127244
127383
 
127245
127384
  if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
127246
127385
 
127247
- if (bDraw) this.Draw();
127386
+ if (bDraw || bDrawTab) this.Draw();
127248
127387
  else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
127249
127388
  }
127250
127389
 
@@ -129094,6 +129233,7 @@ var REPORT_COLUMN_ID=
129094
129233
  CUSTOM_CHECKBOX_ID:104, //自定义checkbox
129095
129234
  CUSTOM_BUTTON_ID:105, //自定义按钮
129096
129235
  CUSTOM_PROGRESS_ID:106, //进度条
129236
+ CUSTOM_LINK_ID:107, //链接
129097
129237
  }
129098
129238
 
129099
129239
  var MAP_COLUMN_FIELD=new Map([
@@ -129264,6 +129404,9 @@ function ChartReport()
129264
129404
  }
129265
129405
 
129266
129406
  this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
129407
+ this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
129408
+ this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
129409
+ this.ButtonConfig=CloneData(g_JSChartResource.Report.Button);
129267
129410
 
129268
129411
  //股票代码+股票名称
129269
129412
  this.ItemSymbolFontConfig={Size:g_JSChartResource.Report.Item.SymbolFont.Size, Name:g_JSChartResource.Report.Item.SymbolFont.Name};
@@ -129307,6 +129450,8 @@ function ChartReport()
129307
129450
  //{ Rect:rtItem, Type: 0=checkedbox, 1=button, 2=link , Stock, Index:index, Column:column }
129308
129451
  this.ButtonRect=[];
129309
129452
 
129453
+ this.LastMouseStatus;
129454
+
129310
129455
  this.ReloadResource=function(resource)
129311
129456
  {
129312
129457
  this.DevicePixelRatio=GetDevicePixelRatio()
@@ -129397,6 +129542,10 @@ function ChartReport()
129397
129542
 
129398
129543
  if (this.Tab) this.Tab.ReloadResource(resource);
129399
129544
  if (this.VScrollbar) this.VScrollbar.ReloadResource(resource);
129545
+
129546
+ this.CheckBoxConfig=CloneData(g_JSChartResource.Report.CheckBox);
129547
+ this.LinkConfig=CloneData(g_JSChartResource.Report.Link);
129548
+ this.ProgressBarConfig=CloneData(g_JSChartResource.Report.ProgressBar);
129400
129549
  }
129401
129550
 
129402
129551
  this.SetColumn=function(aryColumn)
@@ -129468,7 +129617,7 @@ function ChartReport()
129468
129617
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129469
129618
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129470
129619
  if (item.CheckBox) colItem.CheckBox=CloneData(item.CheckBox);
129471
- else colItem.CheckBox=CloneData(g_JSChartResource.Report.CheckBox);
129620
+ else colItem.CheckBox=this.CheckBoxConfig;
129472
129621
  }
129473
129622
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_BUTTON_ID)
129474
129623
  {
@@ -129476,6 +129625,7 @@ function ChartReport()
129476
129625
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129477
129626
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129478
129627
  if (item.Button) colItem.Button=CloneData(item.Button);
129628
+ else colItem.Button=this.ButtonConfig;
129479
129629
  }
129480
129630
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
129481
129631
  {
@@ -129483,6 +129633,15 @@ function ChartReport()
129483
129633
  if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129484
129634
  if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129485
129635
  if (item.ProgressBar) colItem.ProgressBar=CloneData(item.ProgressBar);
129636
+ else colItem.ProgressBar=this.ProgressBarConfig;
129637
+ }
129638
+ else if (item.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
129639
+ {
129640
+ if (!IFrameSplitOperator.IsNumber(item.DataIndex) && !IFrameSplitOperator.IsNumber(item.BlockIndex)) continue;
129641
+ if (IFrameSplitOperator.IsNumber(item.DataIndex)) colItem.DataIndex=item.DataIndex; //数据在扩展数据索引列
129642
+ if (IFrameSplitOperator.IsNumber(item.BlockIndex)) colItem.BlockIndex=item.BlockIndex;
129643
+ if (item.Link) colItem.Link=CloneData(item.Link);
129644
+ else colItem.Link=this.LinkConfig;
129486
129645
  }
129487
129646
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_ICON_ID)
129488
129647
  {
@@ -129602,7 +129761,8 @@ function ChartReport()
129602
129761
  { Type:REPORT_COLUMN_ID.CUSTOM_CHECKBOX_ID, Title:"", TextAlign:"center", FixedWidth:20*GetDevicePixelRatio() },
129603
129762
 
129604
129763
  { Type:REPORT_COLUMN_ID.CUSTOM_BUTTON_ID, Title:"", TextAlign:"center", FixedWidth:50*GetDevicePixelRatio() },
129605
- { Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() }
129764
+ { Type:REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID, Title:"进度条", TextAlign:"center", FixedWidth:100*GetDevicePixelRatio() },
129765
+ { Type:REPORT_COLUMN_ID.CUSTOM_LINK_ID, Title:"链接地址", TextAlign:"center", MaxText:"擎擎擎擎擎" }
129606
129766
  ];
129607
129767
 
129608
129768
  for(var i=0;i<DEFAULT_COLUMN.length;++i)
@@ -129623,12 +129783,13 @@ function ChartReport()
129623
129783
  this.Canvas.clip();
129624
129784
  }
129625
129785
 
129626
- this.Draw=function()
129786
+ this.Draw=function(lastMouseStatus)
129627
129787
  {
129628
129788
  this.ShowSymbol=[];
129629
129789
  this.TooltipRect=[];
129630
129790
  this.ButtonRect=[];
129631
129791
  this.DevicePixelRatio=GetDevicePixelRatio()
129792
+ this.LastMouseStatus=lastMouseStatus;
129632
129793
 
129633
129794
  if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
129634
129795
 
@@ -129660,6 +129821,7 @@ function ChartReport()
129660
129821
  this.VScrollbar.DrawScrollbar(this.RectClient.Left,this.RectClient.Top+this.HeaderHeight, this.RectClient.Right, bottom-this.BottomToolbarHeight-4);
129661
129822
  }
129662
129823
 
129824
+ this.LastMouseStatus=null;
129663
129825
  this.SizeChange=false;
129664
129826
  }
129665
129827
 
@@ -130299,7 +130461,7 @@ function ChartReport()
130299
130461
  for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
130300
130462
  {
130301
130463
  var item=this.Column[i];
130302
- this.DrawItem(dataIndex, data, item, left, top, rowType);
130464
+ this.DrawItem(dataIndex, data, item, left, top, rowType, i);
130303
130465
  left+=item.Width;
130304
130466
 
130305
130467
  if (left>=chartRight) break;
@@ -130308,20 +130470,24 @@ function ChartReport()
130308
130470
  for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
130309
130471
  {
130310
130472
  var item=this.Column[i];
130311
- this.DrawItem(dataIndex, data, item, left, top, rowType);
130473
+ this.DrawItem(dataIndex, data, item, left, top, rowType, i);
130312
130474
  left+=item.Width;
130313
130475
 
130314
130476
  if (left>=chartRight) break;
130315
130477
  }
130316
130478
  }
130317
130479
 
130318
- this.DrawItem=function(index, data, column, left, top, rowType)
130480
+ this.DrawItem=function(index, data, column, left, top, rowType, columnIndex)
130319
130481
  {
130320
130482
  var itemWidth=column.Width;
130321
130483
  var x=left+this.ItemMergin.Left;
130322
130484
  var textWidth=column.Width-this.ItemMergin.Left-this.ItemMergin.Right;
130323
130485
  var stock=data.Stock;
130324
- var drawInfo={ Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null };
130486
+ var drawInfo=
130487
+ {
130488
+ Text:null, TextColor:column.TextColor , TextAlign:column.TextAlign, Tooltip:null,
130489
+ Index:index, ColumnIndex:columnIndex
130490
+ };
130325
130491
  var rtItem={ Left:left, Top:top, Width:column.Width, Height:this.RowHeight };
130326
130492
  rtItem.Right=rtItem.Left+rtItem.Width;
130327
130493
  rtItem.Bottom=rtItem.Top+rtItem.Height;
@@ -130584,6 +130750,10 @@ function ChartReport()
130584
130750
 
130585
130751
  this.GetCustomProgressBarDrawInfo(data, column, drawInfo);
130586
130752
  }
130753
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
130754
+ {
130755
+ this.GetCustomLinkDrawInfo(data, column, drawInfo);
130756
+ }
130587
130757
 
130588
130758
 
130589
130759
  //拖拽行颜色
@@ -130610,6 +130780,10 @@ function ChartReport()
130610
130780
  {
130611
130781
  this.DrawProgressBar(drawInfo, left, top, itemWidth);
130612
130782
  }
130783
+ else if (column.Type==REPORT_COLUMN_ID.CUSTOM_LINK_ID)
130784
+ {
130785
+ this.DrawLinkText(drawInfo, x, top, textWidth);
130786
+ }
130613
130787
  else
130614
130788
  {
130615
130789
  if (data.FlashBG && data.FlashBG.Data && column.ID!=undefined)
@@ -130643,7 +130817,7 @@ function ChartReport()
130643
130817
 
130644
130818
  if (drawInfo.Botton)
130645
130819
  {
130646
- var buttonData={ Stock:stock, Index:index, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
130820
+ var buttonData={ Stock:stock, Index:index, ColumnIndex:columnIndex, Column:column, Rect:drawInfo.Botton.Rect, Type:drawInfo.Botton.Type, Data:drawInfo.Data };
130647
130821
  this.ButtonRect.push(buttonData);
130648
130822
  }
130649
130823
  }
@@ -130941,6 +131115,20 @@ function ChartReport()
130941
131115
  if (barData.BGColor) drawInfo.BGColor=barData.BGColor;
130942
131116
  }
130943
131117
 
131118
+ this.GetCustomLinkDrawInfo=function(data, column, drawInfo)
131119
+ {
131120
+ var linkData=this.GetExtendData(data, column);
131121
+ if (!linkData) return;
131122
+
131123
+ drawInfo.Text=linkData.Title;
131124
+ drawInfo.Link=column.Link;
131125
+ drawInfo.Enable=true;
131126
+ drawInfo.Data=linkData;
131127
+ drawInfo.MaxText=column.MaxText;
131128
+ if (IFrameSplitOperator.IsBool(linkData.Enable)) drawInfo.Enable=linkData.Enable;
131129
+ if (linkData.TextColor) drawInfo.TextColor=linkData.TextColor;
131130
+ }
131131
+
130944
131132
  this.FormaTimeDrawInfo=function(column, stock, drawInfo, data)
130945
131133
  {
130946
131134
  if (!IFrameSplitOperator.IsNumber(stock.Time)) return;
@@ -131210,35 +131398,57 @@ function ChartReport()
131210
131398
  if (!IFrameSplitOperator.IsBool(drawInfo.Checked)) return;
131211
131399
  if (!drawInfo.CheckBox) return;
131212
131400
 
131213
- drawInfo.Font=`${drawInfo.CheckBox.Size*this.DevicePixelRatio}px ${drawInfo.CheckBox.Family}`;
131401
+ var config=drawInfo.CheckBox;
131402
+ drawInfo.Font=`${config.Size*this.DevicePixelRatio}px ${config.Family}`;
131214
131403
  var textAlign=drawInfo.TextAlign;
131215
131404
  var size=drawInfo.CheckBox.Size*this.DevicePixelRatio;
131216
131405
  var x=left+drawInfo.CheckBox.Margin.Left;
131217
131406
  var y=top+this.RowHeight-drawInfo.CheckBox.Margin.Bottom;
131407
+
131218
131408
  if (textAlign=='center') x=left+width/2-size/2;
131219
- else if (textAlign=='right') x=left+width-drawInfo.CheckBox.Margin.Right;
131409
+ else if (textAlign=='right') x=left+width-config.Margin.Right;
131410
+
131411
+ var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
131412
+ rtBox.Right=rtBox.Left+rtBox.Width;
131413
+ rtBox.Top=rtBox.Bottom-rtBox.Height;
131414
+
131415
+ //鼠标在上面
131416
+ var bMouseOn=false;
131417
+ if (drawInfo.Enable && this.LastMouseStatus && this.LastMouseStatus.OnMouseMove)
131418
+ {
131419
+ var xMouse=this.LastMouseStatus.OnMouseMove.X;
131420
+ var yMouse=this.LastMouseStatus.OnMouseMove.Y;
131421
+ if (xMouse>rtBox.Left && xMouse<rtBox.Right && yMouse>rtBox.Top && yMouse<rtBox.Bottom)
131422
+ {
131423
+ bMouseOn=true;
131424
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:0 };
131425
+ }
131426
+ }
131220
131427
 
131221
131428
  this.Canvas.font=drawInfo.Font;
131222
131429
  this.Canvas.textBaseline="bottom";
131223
131430
  this.Canvas.textAlign="left";
131224
131431
  if (drawInfo.Checked===true)
131225
131432
  {
131226
- if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Checked.DisableColor;
131227
- else this.Canvas.fillStyle=drawInfo.CheckBox.Checked.Color;
131228
- this.Canvas.fillText(drawInfo.CheckBox.Checked.Symbol,x,y);
131433
+ var textColor=config.Checked.Color;
131434
+ if (drawInfo.Enable===false) textColor=config.Checked.DisableColor;
131435
+ else if (bMouseOn) textColor=config.Checked.MouseOnColor;
131436
+
131437
+ this.Canvas.fillStyle=textColor;
131438
+ this.Canvas.fillText(config.Checked.Symbol,x,y);
131229
131439
  }
131230
131440
  else if (drawInfo.Checked===false)
131231
131441
  {
131232
- if (drawInfo.Enable===false) this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.DisableColor;
131233
- else this.Canvas.fillStyle=drawInfo.CheckBox.Unchecked.Color;
131234
- this.Canvas.fillText(drawInfo.CheckBox.Unchecked.Symbol,x,y);
131442
+ var textColor=config.Unchecked.Color;
131443
+ if (drawInfo.Enable===false) textColor=config.Unchecked.DisableColor;
131444
+ else if (bMouseOn) textColor=config.Unchecked.MouseOnColor;
131445
+
131446
+ this.Canvas.fillStyle=textColor;
131447
+ this.Canvas.fillText(config.Unchecked.Symbol,x,y);
131235
131448
  }
131236
131449
 
131237
131450
  if (drawInfo.Enable)
131238
131451
  {
131239
- var rtBox={ Left:x, Bottom:y, Width:size, Height:size };
131240
- rtBox.Right=rtBox.Left+rtBox.Width;
131241
- rtBox.Top=rtBox.Bottom-rtBox.Height;
131242
131452
  drawInfo.Botton={ Rect:rtBox, Type:0 };
131243
131453
  }
131244
131454
  }
@@ -131247,6 +131457,7 @@ function ChartReport()
131247
131457
  {
131248
131458
  if (!drawInfo.Button) return;
131249
131459
 
131460
+ var config=drawInfo.Button;
131250
131461
  var rtBG=
131251
131462
  {
131252
131463
  Left:left+drawInfo.Button.Margin.Left, Top:top+drawInfo.Button.Margin.Top,
@@ -131256,11 +131467,26 @@ function ChartReport()
131256
131467
  rtBG.Right=rtBG.Left+rtBG.Width;
131257
131468
  rtBG.Bottom=rtBG.Top+rtBG.Height;
131258
131469
 
131259
- var bgColor=drawInfo.Button.BGColor, textColor=drawInfo.Button.TextColor;
131470
+ var bgColor=config.BGColor, textColor=config.TextColor;
131260
131471
  if (drawInfo.Enable===false)
131261
131472
  {
131262
- bgColor=drawInfo.Button.Disable.BGColor;
131263
- textColor=drawInfo.Button.Disable.TextColor;
131473
+ bgColor=config.Disable.BGColor;
131474
+ textColor=config.Disable.TextColor;
131475
+ }
131476
+ else
131477
+ {
131478
+ if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
131479
+ {
131480
+ var x=this.LastMouseStatus.OnMouseMove.X;
131481
+ var y=this.LastMouseStatus.OnMouseMove.Y;
131482
+ if (x>rtBG.Left && x<rtBG.Right && y>rtBG.Top && y<rtBG.Bottom)
131483
+ {
131484
+ bgColor=config.MouseOn.BGColor;
131485
+ textColor=config.MouseOn.TextColor;
131486
+
131487
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:1 };
131488
+ }
131489
+ }
131264
131490
  }
131265
131491
 
131266
131492
  this.Canvas.fillStyle=bgColor;
@@ -131344,6 +131570,81 @@ function ChartReport()
131344
131570
  }
131345
131571
  }
131346
131572
 
131573
+ this.DrawLinkText=function(drawInfo, left, top, width)
131574
+ {
131575
+ if (!drawInfo.Link || !drawInfo.Text) return;
131576
+
131577
+ var config=drawInfo.Link;
131578
+ var text=drawInfo.Text;
131579
+ var textAlign=drawInfo.TextAlign;
131580
+ var font=config.Font;
131581
+ var color=config.TextColor;
131582
+
131583
+
131584
+
131585
+ this.Canvas.font=font;
131586
+ var textWidth=this.Canvas.measureText(text).width;
131587
+ var textHeight=this.Canvas.measureText("擎").width;
131588
+ var x=left;
131589
+ if (width>=textWidth)
131590
+ {
131591
+ if (textAlign=='center') x=left+(width-textWidth)/2;
131592
+ else if (textAlign=='right') x=left+width-textWidth;
131593
+ }
131594
+ else
131595
+ {
131596
+ text=this.TextEllipsis(text, width, drawInfo.MaxText);
131597
+ textWidth=this.Canvas.measureText(text).width;
131598
+
131599
+ //数据截断提示信息
131600
+ drawInfo.Tooltip=
131601
+ {
131602
+ Type:2,
131603
+ Data:{ AryText:[ {Text:drawInfo.Text} ] }
131604
+ }
131605
+ }
131606
+
131607
+ var rtText={Left:x, Bottom:top+this.RowHeight-this.ItemMergin.Bottom, Height:textHeight, Width:textWidth };
131608
+ rtText.Right=rtText.Left+rtText.Width;
131609
+ rtText.Top=rtText.Bottom-rtText.Height;
131610
+
131611
+ var drawLine=false; //下划线
131612
+ if (drawInfo.Enable===false)
131613
+ {
131614
+ color=config.Disable.TextColor;
131615
+ }
131616
+ else if (this.LastMouseStatus && this.LastMouseStatus.OnMouseMove && config.MouseOn)
131617
+ {
131618
+ var x=this.LastMouseStatus.OnMouseMove.X;
131619
+ var y=this.LastMouseStatus.OnMouseMove.Y;
131620
+ if (x>rtText.Left && x<rtText.Right && y>rtText.Top && y<rtText.Bottom)
131621
+ {
131622
+ color=config.MouseOn.TextColor;
131623
+ drawLine=true;
131624
+ this.LastMouseStatus.MouseOnStatus={ Index:drawInfo.Index, ColumnIndex:drawInfo.ColumnIndex, Type:2 };
131625
+ }
131626
+ }
131627
+
131628
+ this.Canvas.textBaseline="bottom";
131629
+ this.Canvas.textAlign="left";
131630
+ this.Canvas.fillStyle=color;
131631
+ this.Canvas.fillText(text,rtText.Left, rtText.Bottom);
131632
+
131633
+ if (drawLine)
131634
+ {
131635
+ this.Canvas.strokeStyle=color;
131636
+ this.Canvas.beginPath();
131637
+ this.Canvas.moveTo(rtText.Left,rtText.Bottom);
131638
+ this.Canvas.lineTo(rtText.Right,rtText.Bottom);
131639
+ this.Canvas.stroke();
131640
+ }
131641
+
131642
+ if (drawInfo.Enable)
131643
+ {
131644
+ drawInfo.Botton={ Rect:rtText, Type:2 };
131645
+ }
131646
+ }
131647
+
131347
131648
  //字体由外面设置
131348
131649
  this.TextEllipsis=function(text, maxWidth, maxText)
131349
131650
  {
@@ -132056,6 +132357,14 @@ function ChartReport()
132056
132357
  status.Redraw=true;
132057
132358
  return true;
132058
132359
  }
132360
+ else if (buttonData.Type===2) //link
132361
+ {
132362
+ var sendData={ Column:buttonData.Column, Index:buttonData.Index, Stock:buttonData.Stock, Data:buttonData.Data };
132363
+ this.SendClickEvent(JSCHART_EVENT_ID.ON_CLICK_REPORT_LINK, sendData)
132364
+
132365
+ status.Redraw=true;
132366
+ return true;
132367
+ }
132059
132368
 
132060
132369
  return false;
132061
132370
  }
@@ -132310,7 +132619,7 @@ function ChartReport()
132310
132619
 
132311
132620
  if (x>=rt.Left && x<=rt.Right && y>=rt.Top && y<=rt.Bottom)
132312
132621
  {
132313
- return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data };
132622
+ return { Rect:item.Rect, Stock:item.Stock, Column:item.Column, Index:item.Index, Type:item.Type, Data:item.Data, ColumnIndex:item.ColumnIndex };
132314
132623
  }
132315
132624
  }
132316
132625
  }
@@ -134743,26 +135052,36 @@ function JSScrollBarChart(divElement)
134743
135052
  {
134744
135053
  this.DivElement=divElement;
134745
135054
  this.JSChartContainer; //表格控件
135055
+ this.ResizeListener;
134746
135056
 
134747
- //h5 canvas
134748
- this.CanvasElement=document.createElement("canvas");
134749
- this.CanvasElement.className='jsscrollbar-drawing';
134750
- this.CanvasElement.id=Guid();
134751
- this.CanvasElement.setAttribute("tabindex",0);
134752
- if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
134753
- if(divElement.hasChildNodes())
134754
- {
134755
- JSConsole.Chart.Log("[JSScrollBarChart::JSScrollBarChart] divElement hasChildNodes", divElement.childNodes);
134756
- }
134757
- divElement.appendChild(this.CanvasElement);
135057
+ //h5 canvas
135058
+ this.CanvasElement=document.createElement("canvas");
135059
+ this.CanvasElement.className='jsscrollbar-drawing';
135060
+ this.CanvasElement.id=Guid();
135061
+ this.CanvasElement.setAttribute("tabindex",0);
135062
+ if (this.CanvasElement.style) this.CanvasElement.style.outline='none';
135063
+ if(divElement.hasChildNodes())
135064
+ {
135065
+ JSConsole.Chart.Log("[JSScrollBarChart::JSScrollBarChart] divElement hasChildNodes", divElement.childNodes);
135066
+ }
135067
+ divElement.appendChild(this.CanvasElement);
134758
135068
 
134759
135069
 
134760
135070
  this.OnSize=function()
134761
135071
  {
134762
135072
  //画布大小通过div获取
134763
- var height=parseInt(this.DivElement.style.height.replace("px",""));
135073
+ var height=this.DivElement.offsetHeight;
135074
+ var width=this.DivElement.offsetWidth;
135075
+ if (this.DivElement.style.height && this.DivElement.style.width)
135076
+ {
135077
+ if (this.DivElement.style.height.includes("px"))
135078
+ height=parseInt(this.DivElement.style.height.replace("px",""));
135079
+ if (this.DivElement.style.width.includes("px"))
135080
+ width=parseInt(this.DivElement.style.width.replace("px",""));
135081
+ }
135082
+
134764
135083
  this.CanvasElement.height=height;
134765
- this.CanvasElement.width=parseInt(this.DivElement.style.width.replace("px",""));
135084
+ this.CanvasElement.width=width;
134766
135085
  this.CanvasElement.style.width=this.CanvasElement.width+'px';
134767
135086
  this.CanvasElement.style.height=this.CanvasElement.height+'px';
134768
135087
 
@@ -134784,12 +135103,14 @@ function JSScrollBarChart(divElement)
134784
135103
 
134785
135104
  if (!chart) return false;
134786
135105
 
135106
+ this.JSChartContainer=chart;
135107
+ this.DivElement.JSChart=this; //div中保存一份
135108
+
135109
+ if (option.EnableResize==true) this.CreateResizeListener();
135110
+
134787
135111
  if (option.OnCreatedCallback) option.OnCreatedCallback(chart);
134788
135112
 
134789
135113
  chart.Draw();
134790
-
134791
- this.JSChartContainer=chart;
134792
- this.DivElement.JSChart=this; //div中保存一份
134793
135114
  }
134794
135115
 
134795
135116
  this.CreateJSScrollBarChartContainer=function(option)
@@ -134834,6 +135155,18 @@ function JSScrollBarChart(divElement)
134834
135155
  if (IFrameSplitOperator.IsBool(item.AutoRight)) chart.AutoMargin.Right=item.AutoRight;
134835
135156
  }
134836
135157
 
135158
+ this.CreateResizeListener=function()
135159
+ {
135160
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
135161
+ this.ResizeListener.observe(this.DivElement);
135162
+ }
135163
+
135164
+ this.OnDivResize=function(entries)
135165
+ {
135166
+ JSConsole.Chart.Log("[JSScrollBarChart::OnDivResize] entries=", entries);
135167
+ this.OnSize( );
135168
+ }
135169
+
134837
135170
  /////////////////////////////////////////////////////////////////////////////
134838
135171
  //对外接口
134839
135172
 
@@ -134979,6 +135312,11 @@ function JSScrollBarChartContainer(uielement)
134979
135312
  this.IsDestroy=true;
134980
135313
  }
134981
135314
 
135315
+ this.GetHQChart=function()
135316
+ {
135317
+ return this.HQChart;
135318
+ }
135319
+
134982
135320
  //设置事件回调
134983
135321
  //{event:事件id, callback:回调函数}
134984
135322
  this.AddEventCallback=function(object)
@@ -135057,6 +135395,36 @@ function JSScrollBarChartContainer(uielement)
135057
135395
  //this.UIElement.ontouchend=(e)=> {this.OnTouchEnd(e); }
135058
135396
  }
135059
135397
 
135398
+ //创建一个图形
135399
+ this.CreateChartPaint=function(name)
135400
+ {
135401
+ var chart=g_ChartPaintFactory.Create(name);
135402
+ if (!chart) return null;
135403
+
135404
+ chart.ChartFrame=this.Frame;
135405
+ chart.ChartBorder=this.Frame.ChartBorder;
135406
+ chart.Canvas=this.Canvas;
135407
+ chart.Data=this.Frame.Data;
135408
+ chart.GetEventCallback=(id)=> { return this.GetEventCallback(id); }
135409
+ chart.GetHQChartCallback=()=>{ return this.GetHQChart(); }
135410
+
135411
+ return chart;
135412
+ }
135413
+
135414
+ this.GetChartPaintByClassName=function(name)
135415
+ {
135416
+ for(var i=0; i<this.ChartPaint.length; ++i)
135417
+ {
135418
+ var item=this.ChartPaint[i];
135419
+ if (item.ClassName==name)
135420
+ {
135421
+ return { Chart:item, Index:i };
135422
+ }
135423
+ }
135424
+
135425
+ return null;
135426
+ }
135427
+
135060
135428
  this.Draw=function()
135061
135429
  {
135062
135430
  if (this.UIElement.width<=0 || this.UIElement.height<=0) return;
@@ -136145,7 +136513,7 @@ function ScrollBarBGChart()
136145
136513
 
136146
136514
 
136147
136515
 
136148
- var HQCHART_VERSION="1.1.13576";
136516
+ var HQCHART_VERSION="1.1.13583";
136149
136517
 
136150
136518
  function PrintHQChartVersion()
136151
136519
  {