hqchart 1.1.13541 → 1.1.13550

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.
@@ -6567,6 +6567,8 @@ var JSCHART_EVENT_ID=
6567
6567
  ON_TREPORT_LOCAL_SORT:126, //T型报价列表本地排序
6568
6568
  ON_CLICK_TREPORT_ROW:127, //左键点击点击T型报价列表
6569
6569
 
6570
+ ON_DRAW_REPORT_ROW_BG:140, //报价列表整行背景
6571
+
6570
6572
 
6571
6573
  ON_CHANGE_INDEX:150, //切换指标
6572
6574
  ON_MENU_COMMAND:151, //菜单事件回调
@@ -71093,8 +71095,17 @@ function JSChartResource()
71093
71095
  {
71094
71096
  Color:"rgb(60,60,60)", //表头文字颜色
71095
71097
  SortColor:"rgb(255,0,0)", //排序箭头颜色
71096
- Mergin:{ Left:5, Right:5, Top:4, Bottom:2}, //表头四周间距
71097
- Font:{ Size:12, Name:"微软雅黑" } //表头字体
71098
+ Mergin:{ Left:5, Right:5, Top:4, Bottom:4 }, //表头四周间距
71099
+ Font:{ Size:12, Name:"微软雅黑" }, //表头字体
71100
+ },
71101
+
71102
+ //排序图标
71103
+ SortIcon:
71104
+ {
71105
+ Size:12, Family:"iconfont",
71106
+ Arrow:[null, "\ue6b2", "\ue6b1"],
71107
+ Color:[null, "rgb(255,0,0)", "rgb(255,0,0)"],
71108
+ Margin:{ Left:0, Bottom:6 }
71098
71109
  },
71099
71110
 
71100
71111
  Item:
@@ -72039,7 +72050,6 @@ function JSChartResource()
72039
72050
  {
72040
72051
  var header=item.Header;
72041
72052
  if (header.Color) this.Report.Header.Color=header.Color;
72042
- if (header.SortColor) this.Report.Header.SortColor=header.SortColor;
72043
72053
  if (header.Mergin)
72044
72054
  {
72045
72055
  var mergin=header.Mergin;
@@ -123520,7 +123530,7 @@ function GetBlackStyle()
123520
123530
  {
123521
123531
  Color:"RGB(245,245,245)",
123522
123532
  SortColor:"rgb(255,0,0)",
123523
- Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
123533
+ //Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
123524
123534
  Font:{ Size:12, Name:"微软雅黑" }
123525
123535
  },
123526
123536
 
@@ -128851,7 +128861,7 @@ function ChartReport()
128851
128861
  //表头配置
128852
128862
  this.HeaderFontConfig={ Size:g_JSChartResource.Report.Header.Font.Size, Name:g_JSChartResource.Report.Header.Font.Name };
128853
128863
  this.HeaderColor=g_JSChartResource.Report.Header.Color;
128854
- this.SortColor=g_JSChartResource.Report.Header.SortColor; //排序箭头颜色
128864
+
128855
128865
  this.HeaderMergin=
128856
128866
  {
128857
128867
  Left:g_JSChartResource.Report.Header.Mergin.Left,
@@ -128860,6 +128870,20 @@ function ChartReport()
128860
128870
  Bottom:g_JSChartResource.Report.Header.Mergin.Bottom
128861
128871
  };
128862
128872
 
128873
+ //排序图标
128874
+ this.SortConfig=
128875
+ {
128876
+ Size:g_JSChartResource.Report.SortIcon.Size,
128877
+ Family:g_JSChartResource.Report.SortIcon.Family,
128878
+ Arrow:g_JSChartResource.Report.SortIcon.Arrow.slice(),
128879
+ Color:g_JSChartResource.Report.SortIcon.Color.slice(),
128880
+ Margin:
128881
+ {
128882
+ Left:g_JSChartResource.Report.SortIcon.Margin.Left,
128883
+ Bottom:g_JSChartResource.Report.SortIcon.Margin.Bottom
128884
+ }
128885
+ }
128886
+
128863
128887
  //表格内容配置
128864
128888
  this.ItemFontConfig={ Size:g_JSChartResource.Report.Item.Font.Size, Name:g_JSChartResource.Report.Item.Font.Name };
128865
128889
  this.ItemFixedFontConfg={ Size:g_JSChartResource.Report.FixedItem.Font.Size, Name:g_JSChartResource.Report.FixedItem.Font.Name }; //固定行
@@ -128922,6 +128946,7 @@ function ChartReport()
128922
128946
 
128923
128947
  //缓存
128924
128948
  this.HeaderFont=12*GetDevicePixelRatio() +"px 微软雅黑";
128949
+ this.SortFont=null,
128925
128950
  this.ItemFont=15*GetDevicePixelRatio() +"px 微软雅黑";
128926
128951
  this.ItemFixedFont=15*GetDevicePixelRatio() +"px 微软雅黑";
128927
128952
  this.ItemSymbolFont=12*GetDevicePixelRatio() +"px 微软雅黑";
@@ -128965,7 +128990,7 @@ function ChartReport()
128965
128990
  //表头配置
128966
128991
  this.HeaderFontConfig={ Size:g_JSChartResource.Report.Header.Font.Size, Name:g_JSChartResource.Report.Header.Font.Name };
128967
128992
  this.HeaderColor=g_JSChartResource.Report.Header.Color;
128968
- this.SortColor=g_JSChartResource.Report.Header.SortColor; //排序箭头颜色
128993
+
128969
128994
  this.HeaderMergin=
128970
128995
  {
128971
128996
  Left:g_JSChartResource.Report.Header.Mergin.Left,
@@ -129000,6 +129025,20 @@ function ChartReport()
129000
129025
  Bottom:g_JSChartResource.Report.LimitBorder.Mergin.Bottom
129001
129026
  }
129002
129027
 
129028
+ //排序图标
129029
+ this.SortConfig=
129030
+ {
129031
+ Size:g_JSChartResource.Report.SortIcon.Size,
129032
+ Family:g_JSChartResource.Report.SortIcon.Family,
129033
+ Arrow:g_JSChartResource.Report.SortIcon.Arrow.slice(),
129034
+ Color:g_JSChartResource.Report.SortIcon.Color.slice(),
129035
+ Margin:
129036
+ {
129037
+ Left:g_JSChartResource.Report.SortIcon.Margin.Left,
129038
+ Bottom:g_JSChartResource.Report.SortIcon.Margin.Bottom
129039
+ }
129040
+ }
129041
+
129003
129042
  for(var i=0;i<this.Column.length;++i)
129004
129043
  {
129005
129044
  var item=this.Column[i];
@@ -129326,6 +129365,7 @@ function ChartReport()
129326
129365
 
129327
129366
  this.RowHeight=this.GetFontHeight(this.ItemFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
129328
129367
  this.FixedRowHeight=this.GetFontHeight(this.ItemFixedFont,"擎")+ this.ItemMergin.Top+ this.ItemMergin.Bottom;
129368
+ this.SortFont=`${this.SortConfig.Size*pixelRatio}px ${ this.SortConfig.Family}`;
129329
129369
 
129330
129370
  this.Canvas.font=this.ItemFont;
129331
129371
  var itemWidth=0;
@@ -129378,8 +129418,8 @@ function ChartReport()
129378
129418
  var item=this.Column[i];
129379
129419
  if (!item.Title || item.Title.length<=0) continue;
129380
129420
  var text=item.Title;
129381
- if (item.Sort>0) text+="↓";
129382
129421
  itemWidth=this.Canvas.measureText(text).width;
129422
+ if (item.Sort>0) itemWidth+this.SortConfig.Size*pixelRatio;
129383
129423
  itemWidth+=(4+this.HeaderMergin.Left+this.HeaderMergin.Right);
129384
129424
  if (item.Width<itemWidth) item.Width=itemWidth;
129385
129425
  }
@@ -129387,7 +129427,6 @@ function ChartReport()
129387
129427
  this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+ this.HeaderMergin.Top+ this.HeaderMergin.Bottom;
129388
129428
  if (!this.IsShowHeader) this.HeaderHeight=0;
129389
129429
  if (this.FixedRowCount<=0) this.FixedRowHeight=0;
129390
-
129391
129430
 
129392
129431
  this.RowCount=parseInt((this.RectClient.Bottom-this.RectClient.Top-this.HeaderHeight-(this.FixedRowHeight*this.FixedRowCount))/this.RowHeight);
129393
129432
 
@@ -129409,6 +129448,7 @@ function ChartReport()
129409
129448
  var left=this.RectClient.Left;
129410
129449
  var top=this.RectClient.Top;
129411
129450
  var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;
129451
+ var yBottom=top+this.HeaderHeight;
129412
129452
 
129413
129453
  this.Canvas.font=this.HeaderFont;
129414
129454
 
@@ -129448,16 +129488,16 @@ function ChartReport()
129448
129488
  var textSize={ }
129449
129489
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
129450
129490
  {
129451
- this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort, textSize);
129491
+ this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort, textSize);
129452
129492
  }
129453
129493
  else
129454
129494
  {
129455
- this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
129495
+ this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
129456
129496
  }
129457
129497
 
129458
129498
  if (iconWidth>0)
129459
129499
  {
129460
- this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
129500
+ this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
129461
129501
  this.Canvas.font=this.HeaderFont;
129462
129502
  }
129463
129503
 
@@ -129501,16 +129541,16 @@ function ChartReport()
129501
129541
  var textSize={ }
129502
129542
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
129503
129543
  {
129504
- this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort,textSize);
129544
+ this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort,textSize);
129505
129545
  }
129506
129546
  else
129507
129547
  {
129508
- this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
129548
+ this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
129509
129549
  }
129510
129550
 
129511
129551
  if (iconWidth>0)
129512
129552
  {
129513
- this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
129553
+ this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
129514
129554
  this.Canvas.font=this.HeaderFont;
129515
129555
  }
129516
129556
 
@@ -129518,7 +129558,7 @@ function ChartReport()
129518
129558
  }
129519
129559
  }
129520
129560
 
129521
- this.DrawText=function(text, textAlign, x, y, cellWidth, textSize)
129561
+ this.DrawText=function(text, textAlign, x, yBottom, cellWidth, textSize)
129522
129562
  {
129523
129563
  var textWidth=this.Canvas.measureText(text).width;
129524
129564
  if (textAlign=='center')
@@ -129531,8 +129571,8 @@ function ChartReport()
129531
129571
  }
129532
129572
 
129533
129573
  this.Canvas.textAlign="left";
129534
- this.Canvas.textBaseline="middle";
129535
- this.Canvas.fillText(text,x,y);
129574
+ this.Canvas.textBaseline="bottom";
129575
+ this.Canvas.fillText(text,x,yBottom-this.HeaderMergin.Bottom);
129536
129576
 
129537
129577
  if (textSize)
129538
129578
  {
@@ -129541,7 +129581,7 @@ function ChartReport()
129541
129581
  }
129542
129582
  }
129543
129583
 
129544
- this.DrawHeaderIcon=function(icon, x, y, index, column)
129584
+ this.DrawHeaderIcon=function(icon, x, yBottom, index, column)
129545
129585
  {
129546
129586
  var iconFont=`${icon.Size}px ${icon.Family}`;
129547
129587
  this.Canvas.font=iconFont;
@@ -129549,29 +129589,29 @@ function ChartReport()
129549
129589
  if (icon.Color) this.Canvas.fillStyle=icon.Color;
129550
129590
 
129551
129591
  var xIcon=x;
129552
- var yIcon=y;
129592
+ var yIcon=yBottom;
129553
129593
  if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xIcon+=icon.Margin.Left;
129554
129594
  if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yIcon-=icon.Margin.Bottom;
129555
129595
  this.Canvas.fillText(icon.Symbol, xIcon, yIcon);
129556
129596
 
129557
129597
  if (icon.Tooltip)
129558
129598
  {
129559
- var rtIcon={ Left:xIcon, Top:yIcon-icon.Size/2, Width:icon.Size, Height:icon.Size };
129599
+ var rtIcon={ Left:xIcon, Bottom:yIcon, Width:icon.Size, Height:icon.Size };
129560
129600
  rtIcon.Right=rtIcon.Left+rtIcon.Width;
129561
- rtIcon.Bottom=rtIcon.Top+rtIcon.Height;
129601
+ rtIcon.Top=rtIcon.Bottom-rtIcon.Height;
129562
129602
 
129563
129603
  var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:index, Data:icon.Tooltip.Data };
129564
129604
  this.TooltipRect.push(tooltipData);
129565
129605
  }
129566
129606
  }
129567
129607
 
129568
- this.DrawSortHeader=function(text, textAlign, x, y, width, sortType,textSize)
129608
+ this.DrawSortHeader=function(text, textAlign, x, yBottom, width, sortType,textSize)
129569
129609
  {
129570
- var sortText=sortType==1?"↓":"↑";
129571
- var sortTextWidth=this.Canvas.measureText(sortText).width;
129572
- var textWidth=this.Canvas.measureText(text).width+2;
129573
- this.Canvas.textBaseline="middle";
129574
- this.Canvas.textAlign="left";
129610
+ var pixelRatio=GetDevicePixelRatio();
129611
+ var sortText=this.SortConfig.Arrow[sortType];
129612
+ this.Canvas.font=this.HeaderFont;
129613
+ var textWidth=this.Canvas.measureText(text).width;
129614
+ var sortTextWidth=this.SortConfig.Size*pixelRatio+this.SortConfig.Margin.Left;
129575
129615
 
129576
129616
  if (textAlign=='center')
129577
129617
  {
@@ -129582,9 +129622,20 @@ function ChartReport()
129582
129622
  x=(x+width)-sortTextWidth-textWidth;
129583
129623
  }
129584
129624
 
129585
- this.Canvas.fillText(text,x,y);
129586
- this.Canvas.fillStyle=this.SortColor;
129587
- this.Canvas.fillText(sortText,x+textWidth,y);
129625
+ this.Canvas.textBaseline="bottom";
129626
+ this.Canvas.textAlign="left";
129627
+
129628
+ var xText=x;
129629
+ this.Canvas.font=this.HeaderFont;
129630
+ this.Canvas.fillStyle=this.HeaderColor;
129631
+ this.Canvas.fillText(text,xText,yBottom-this.HeaderMergin.Bottom);
129632
+
129633
+ xText+=(textWidth+this.SortConfig.Margin.Left);
129634
+ this.Canvas.font=this.SortFont;
129635
+ this.Canvas.fillStyle=this.SortConfig.Color[sortType];
129636
+ this.Canvas.fillText(sortText,xText,yBottom-this.SortConfig.Margin.Bottom);
129637
+
129638
+ this.Canvas.font=this.HeaderFont;
129588
129639
  this.Canvas.fillStyle=this.HeaderColor;
129589
129640
 
129590
129641
  if (textSize)
@@ -129690,6 +129741,9 @@ function ChartReport()
129690
129741
 
129691
129742
  textTop=top+this.FixedRowHeight*this.FixedRowCount;
129692
129743
  this.Canvas.font=this.ItemFont;
129744
+
129745
+ var eventDrawBG=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_REPORT_ROW_BG);
129746
+ var selectedSymbol=this.GetSelectedSymbol();
129693
129747
  for(var i=this.Data.YOffset, j=0; i<this.Data.Data.length && j<this.RowCount ;++i, ++j)
129694
129748
  {
129695
129749
  var symbol=this.Data.Data[i];
@@ -129729,6 +129783,18 @@ function ChartReport()
129729
129783
  bFillRow=false;
129730
129784
  }
129731
129785
 
129786
+ if (eventDrawBG && eventDrawBG.Callback)
129787
+ {
129788
+ //Out:{ BGColor: }
129789
+ var sendData={ RowIndex:i, Symbol:symbol, Out:null, Selected:selectedSymbol };
129790
+ eventDrawBG.Callback(eventDrawBG,sendData,this);
129791
+ if (sendData.Out && sendData.Out.BGColor)
129792
+ {
129793
+ this.Canvas.fillStyle=sendData.Out.BGColor;
129794
+ this.Canvas.fillRect(left,textTop,rowWidth,this.RowHeight);
129795
+ }
129796
+ }
129797
+
129732
129798
  if (bFillRow)
129733
129799
  {
129734
129800
  this.Canvas.fillStyle=this.SelectedColor;
@@ -129743,6 +129809,18 @@ function ChartReport()
129743
129809
  }
129744
129810
  }
129745
129811
 
129812
+ this.GetSelectedSymbol=function()
129813
+ {
129814
+ if (this.SelectedRow<0) return null;
129815
+
129816
+ var index=this.SelectedRow;
129817
+ if (this.SelectedModel==0) //当前屏选中
129818
+ index=this.Data.YOffset+this.SelectedRow;
129819
+
129820
+ var symbol=this.Data.Data[index];
129821
+ return symbol;
129822
+ }
129823
+
129746
129824
 
129747
129825
  this.DrawFixedSymbolRow=function(top, dataIndex)
129748
129826
  {
@@ -137749,6 +137827,7 @@ function JSPopMenu()
137749
137827
 
137750
137828
 
137751
137829
  var rootData={ Root:root, TBody:tbody, Table:table };
137830
+ root.JSMenuData=rootData;
137752
137831
  for(var i=0;i<data.Menu.length;++i)
137753
137832
  {
137754
137833
  var item=data.Menu[i];
@@ -137851,6 +137930,7 @@ function JSPopMenu()
137851
137930
  subTable.appendChild(subTbody);
137852
137931
 
137853
137932
  var subRootData={ Root:subRoot, TBody:subTbody, Table:subTable };
137933
+ subRoot.JSMenuData=subRootData;
137854
137934
  var preTrDom=null;
137855
137935
  for(var i=0;i<item.SubMenu.length;++i)
137856
137936
  {
@@ -137986,6 +138066,17 @@ function JSPopMenu()
137986
138066
  parentItem.PopMenu.style.visibility="hidden";
137987
138067
  if (parentItem.PopRow) parentItem.PopRow.classList.remove(this.SelectedClassName);
137988
138068
 
138069
+ var popMenuData=parentItem.PopMenu.JSMenuData;
138070
+ for(var i=0;i<50;++i) //隐藏子菜单 最多50层
138071
+ {
138072
+ if (!popMenuData) break;
138073
+ if (!popMenuData.PopMenu) break;
138074
+
138075
+ popMenuData.PopMenu.style.visibility="hidden";
138076
+
138077
+ popMenuData=popMenuData.PopMenu;
138078
+ }
138079
+
137989
138080
  parentItem.PopMenu=null;
137990
138081
  parentItem.PopRow=null;
137991
138082
  }
@@ -139189,7 +139280,7 @@ function HQChartScriptWorker()
139189
139280
 
139190
139281
 
139191
139282
 
139192
- var HQCHART_VERSION="1.1.13540";
139283
+ var HQCHART_VERSION="1.1.13549";
139193
139284
 
139194
139285
  function PrintHQChartVersion()
139195
139286
  {