hqchart 1.1.14269 → 1.1.14276

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.
@@ -74602,9 +74602,9 @@ function JSChartResource()
74602
74602
  SortIcon:
74603
74603
  {
74604
74604
  Size:12, Family:"iconfont",
74605
- Arrow:[null, "\ue6b2", "\ue6b1"], //[0]=默认排序的图标背景色
74606
- Color:[null, "rgb(255,0,0)", "rgb(255,0,0)"],
74607
- Margin:{ Left:0, Bottom:6 }
74605
+ Arrow:["\ue704", "\ue81b", "\uf0c9"], //[0]=默认排序的图标背景色
74606
+ Color:['rgb(169,169,169)', "rgb(51,51,51)", "rgb(51,51,51)"],
74607
+ Margin:{ Left:1*GetDevicePixelRatio(), Bottom:2, Right:0,}
74608
74608
  },
74609
74609
 
74610
74610
  Item:
@@ -75866,6 +75866,23 @@ function JSChartResource()
75866
75866
  }
75867
75867
  }
75868
75868
 
75869
+ if (item.SortIcon)
75870
+ {
75871
+ var sort=item.SortIcon;
75872
+ if (IFrameSplitOperator.IsNonEmptyArray(sort.Color)) this.Report.SortIcon.Color=sort.Color.slice();
75873
+ if (IFrameSplitOperator.IsNumber(sort.Size)) this.Report.SortIcon.Size=sort.Size;
75874
+ if (sort.Family) this.Report.SortIcon.Family=sort.Family;
75875
+ if (IFrameSplitOperator.IsNonEmptyArray(sort.Arrow)) this.Report.SortIcon.Arrow=sort.Arrow.slice();
75876
+ if (sort.Margin)
75877
+ {
75878
+ var margin=sort.Margin;
75879
+ if (IFrameSplitOperator.IsNumber(margin.Left)) this.Report.SortIcon.Margin.Left=margin.Left;
75880
+ if (IFrameSplitOperator.IsNumber(margin.Right)) this.Report.SortIcon.Margin.Right=margin.Right;
75881
+ if (IFrameSplitOperator.IsNumber(margin.Top)) this.Report.SortIcon.Margin.Top=margin.Top;
75882
+ if (IFrameSplitOperator.IsNumber(margin.Bottom)) this.Report.SortIcon.Margin.Bottom=margin.Bottom;
75883
+ }
75884
+ }
75885
+
75869
75886
  if (item.Item)
75870
75887
  {
75871
75888
  var row=item.Item;
@@ -116709,9 +116726,6 @@ function JSExecute(ast,option)
116709
116726
 
116710
116727
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_OTHER_SYMBOL_DATA: //指定股票数据
116711
116728
  return this.SymbolData.GetOtherSymbolData(jobItem);
116712
-
116713
- case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_RELEASE_DATE_DATA:
116714
- return this.SymbolData.GetCompanyReleaseDate(jobItem.ID);
116715
116729
 
116716
116730
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_MARGIN_BALANCE:
116717
116731
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_MARGIN_RATE:
@@ -126298,6 +126312,12 @@ function GetBlackStyle()
126298
126312
  //Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
126299
126313
  Font:{ Size:12, Name:"微软雅黑" }
126300
126314
  },
126315
+
126316
+ //排序图标
126317
+ SortIcon:
126318
+ {
126319
+ Color:['rgb(105,105,105)', "rgb(255,255,255)", "rgb(255,255,255)"],
126320
+ },
126301
126321
 
126302
126322
  Item:
126303
126323
  {
@@ -128187,15 +128207,8 @@ function JSReportChart(divElement)
128187
128207
  if (option.EnableResize==true) this.CreateResizeListener();
128188
128208
 
128189
128209
  if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
128190
- if (option.EnableTooltip)
128191
- {
128192
- this.CreateExtraCanvasElement(JSReportChart.TooltipCursorCanvasKey, { ZIndex:99 });
128193
- }
128194
-
128195
- if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable)
128196
- {
128197
- chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
128198
- }
128210
+ if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
128211
+ if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
128199
128212
 
128200
128213
  if (option.Symbol) chart.Symbol=option.Symbol;
128201
128214
  if (option.Name) chart.Name=option.Name;
@@ -128365,8 +128378,6 @@ function JSReportChart(divElement)
128365
128378
  }
128366
128379
  }
128367
128380
 
128368
- JSReportChart.TooltipCursorCanvasKey="hq_report_tooltip"; //提示信息
128369
-
128370
128381
 
128371
128382
  JSReportChart.Init=function(divElement)
128372
128383
  {
@@ -128445,9 +128456,6 @@ function JSReportChartContainer(uielement)
128445
128456
  this.SplashTitle={ StockList:"下载码表中.....", MemberList:"下载成分中....." } ;
128446
128457
 
128447
128458
  this.Canvas=uielement.getContext("2d"); //画布
128448
-
128449
- this.TooltipCanvas;
128450
- this.ChartTooltip;
128451
128459
 
128452
128460
  this.Tooltip=document.createElement("div");
128453
128461
  this.Tooltip.className='jsreport-tooltip';
@@ -128531,6 +128539,7 @@ function JSReportChartContainer(uielement)
128531
128539
  this.StopAutoUpdate();
128532
128540
 
128533
128541
  this.DestroyMinuteChartTooltip();
128542
+ this.DestroyFloatTooltip();
128534
128543
  }
128535
128544
 
128536
128545
  this.StopAutoDragScrollTimer=function()
@@ -128569,6 +128578,51 @@ function JSReportChartContainer(uielement)
128569
128578
  this.TooltipMinuteChart=null;
128570
128579
  }
128571
128580
 
128581
+ this.InitalFloatTooltip=function(option)
128582
+ {
128583
+ if (this.FloatTooltip) return;
128584
+
128585
+ this.FloatTooltip=new JSFloatTooltip();
128586
+ this.FloatTooltip.Inital(this, option);
128587
+ this.FloatTooltip.Create();
128588
+ }
128589
+
128590
+ this.HideFloatTooltip=function()
128591
+ {
128592
+ if (!this.FloatTooltip) return;
128593
+
128594
+ this.FloatTooltip.Hide();
128595
+ }
128596
+
128597
+ this.DestroyFloatTooltip=function()
128598
+ {
128599
+ if (!this.FloatTooltip) return;
128600
+
128601
+ this.FloatTooltip.Destroy();
128602
+ this.FloatTooltip=null;
128603
+ }
128604
+
128605
+ this.DrawFloatTooltip=function(point,toolTip)
128606
+ {
128607
+ if (!this.FloatTooltip) return;
128608
+
128609
+ this.UpdateFloatTooltip(point, toolTip)
128610
+ }
128611
+
128612
+ this.UpdateFloatTooltip=function(point, toolTip)
128613
+ {
128614
+ if (!this.FloatTooltip) return;
128615
+
128616
+ var sendData=
128617
+ {
128618
+ Tooltip:toolTip,
128619
+ Point:point,
128620
+ DataType:3,
128621
+ };
128622
+
128623
+ this.FloatTooltip.Update(sendData);
128624
+ }
128625
+
128572
128626
  //data={ Symbol }
128573
128627
  this.ShowMinuteChartTooltip=function(x,y, data)
128574
128628
  {
@@ -128719,12 +128773,6 @@ function JSReportChartContainer(uielement)
128719
128773
 
128720
128774
  this.ChartPaint[0]=chart;
128721
128775
 
128722
- //提示信息
128723
- var chartTooltip=new ChartCellTooltip();
128724
- chartTooltip.Frame=this.Frame;
128725
- chartTooltip.ChartBorder=this.Frame.ChartBorder;
128726
- this.ChartTooltip=chartTooltip;
128727
-
128728
128776
  //页脚
128729
128777
  if (option && option.PageInfo===true)
128730
128778
  {
@@ -128746,6 +128794,7 @@ function JSReportChartContainer(uielement)
128746
128794
  if (IFrameSplitOperator.IsNumber(option.FixedRowCount)) chart.FixedRowCount=option.FixedRowCount; //固定行
128747
128795
  if (IFrameSplitOperator.IsBool(option.ItemBorder)) chart.IsDrawBorder=option.ItemBorder; //单元格边框
128748
128796
  if (IFrameSplitOperator.IsNumber(option.SelectedModel)) chart.SelectedModel=option.SelectedModel;
128797
+ if (IFrameSplitOperator.IsNumber(option.HeaderRowCount)) chart.HeaderRowCount=option.HeaderRowCount;
128749
128798
 
128750
128799
  if (IFrameSplitOperator.IsNonEmptyArray(option.FixedSymbol))
128751
128800
  {
@@ -128837,8 +128886,6 @@ function JSReportChartContainer(uielement)
128837
128886
  {
128838
128887
  this.DelayDraw(500);
128839
128888
  }
128840
-
128841
- this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
128842
128889
  }
128843
128890
 
128844
128891
  this.DelayDraw=function(frequency)
@@ -129770,6 +129817,7 @@ function JSReportChartContainer(uielement)
129770
129817
  {
129771
129818
  this.LastMouseStatus.TooltipStatus=null;
129772
129819
  this.HideMinuteChartTooltip();
129820
+ this.HideFloatTooltip();
129773
129821
  if (this.GotoNextItem(1))
129774
129822
  {
129775
129823
  this.Draw();
@@ -129780,6 +129828,7 @@ function JSReportChartContainer(uielement)
129780
129828
  {
129781
129829
  this.LastMouseStatus.TooltipStatus=null;
129782
129830
  this.HideMinuteChartTooltip();
129831
+ this.HideFloatTooltip();
129783
129832
  if (this.GotoNextItem(-1))
129784
129833
  {
129785
129834
  this.Draw();
@@ -129793,6 +129842,7 @@ function JSReportChartContainer(uielement)
129793
129842
  {
129794
129843
  this.LastMouseStatus.TooltipStatus=null;
129795
129844
  this.HideMinuteChartTooltip();
129845
+ this.HideFloatTooltip();
129796
129846
  if (this.GotoNextPage(this.PageUpDownCycle))
129797
129847
  {
129798
129848
  this.Draw();
@@ -129803,6 +129853,7 @@ function JSReportChartContainer(uielement)
129803
129853
  {
129804
129854
  this.LastMouseStatus.TooltipStatus=null;
129805
129855
  this.HideMinuteChartTooltip();
129856
+ this.HideFloatTooltip();
129806
129857
  if (this.GotoPreviousPage(this.PageUpDownCycle))
129807
129858
  {
129808
129859
  this.Draw();
@@ -129825,6 +129876,7 @@ function JSReportChartContainer(uielement)
129825
129876
  if (keyID==116) return; //F15刷新不处理
129826
129877
 
129827
129878
  this.HideMinuteChartTooltip();
129879
+ this.HideFloatTooltip();
129828
129880
  switch(keyID)
129829
129881
  {
129830
129882
  case 33: //page up
@@ -130225,7 +130277,17 @@ function JSReportChartContainer(uielement)
130225
130277
  if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
130226
130278
 
130227
130279
  if (bDraw || bDrawTab) this.Draw();
130228
- else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
130280
+
130281
+ if (this.LastMouseStatus.TooltipStatus)
130282
+ {
130283
+ var xTooltip = e.clientX-this.UIElement.getBoundingClientRect().left;
130284
+ var yTooltip = e.clientY-this.UIElement.getBoundingClientRect().top;
130285
+ this.DrawFloatTooltip({X:xTooltip, Y:yTooltip, YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);
130286
+ }
130287
+ else
130288
+ {
130289
+ this.HideFloatTooltip();
130290
+ }
130229
130291
 
130230
130292
  if (bShowChartTooltip)
130231
130293
  {
@@ -130240,6 +130302,7 @@ function JSReportChartContainer(uielement)
130240
130302
  this.UIOnMounseOut=function(e)
130241
130303
  {
130242
130304
  this.HideMinuteChartTooltip();
130305
+ this.HideFloatTooltip();
130243
130306
 
130244
130307
  var bDraw=false;
130245
130308
  var tabChart=this.GetTabChart();
@@ -130266,6 +130329,7 @@ function JSReportChartContainer(uielement)
130266
130329
  this.UIOnMouseleave=function(e)
130267
130330
  {
130268
130331
  this.HideMinuteChartTooltip();
130332
+ this.HideFloatTooltip();
130269
130333
 
130270
130334
  var tabChart=this.GetTabChart();
130271
130335
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -131822,16 +131886,16 @@ function JSReportChartContainer(uielement)
131822
131886
  case REPORT_COLUMN_ID.VOL_OUT_ID:
131823
131887
  case REPORT_COLUMN_ID.DATE_ID:
131824
131888
 
131825
- case TREPORT_COLUMN_ID.RESERVE_NUMBER1_ID:
131826
- case TREPORT_COLUMN_ID.RESERVE_NUMBER2_ID:
131827
- case TREPORT_COLUMN_ID.RESERVE_NUMBER3_ID:
131828
- case TREPORT_COLUMN_ID.RESERVE_NUMBER4_ID:
131829
- case TREPORT_COLUMN_ID.RESERVE_NUMBER5_ID:
131830
- case TREPORT_COLUMN_ID.RESERVE_NUMBER6_ID:
131831
- case TREPORT_COLUMN_ID.RESERVE_NUMBER7_ID:
131832
- case TREPORT_COLUMN_ID.RESERVE_NUMBER8_ID:
131833
- case TREPORT_COLUMN_ID.RESERVE_NUMBER9_ID:
131834
- case TREPORT_COLUMN_ID.RESERVE_NUMBER10_ID:
131889
+ case REPORT_COLUMN_ID.RESERVE_NUMBER1_ID:
131890
+ case REPORT_COLUMN_ID.RESERVE_NUMBER2_ID:
131891
+ case REPORT_COLUMN_ID.RESERVE_NUMBER3_ID:
131892
+ case REPORT_COLUMN_ID.RESERVE_NUMBER4_ID:
131893
+ case REPORT_COLUMN_ID.RESERVE_NUMBER5_ID:
131894
+ case REPORT_COLUMN_ID.RESERVE_NUMBER6_ID:
131895
+ case REPORT_COLUMN_ID.RESERVE_NUMBER7_ID:
131896
+ case REPORT_COLUMN_ID.RESERVE_NUMBER8_ID:
131897
+ case REPORT_COLUMN_ID.RESERVE_NUMBER9_ID:
131898
+ case REPORT_COLUMN_ID.RESERVE_NUMBER10_ID:
131835
131899
 
131836
131900
  return this.LocalNumberSort(left, right, column, sortType);
131837
131901
  case REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID: //自定义数值字段
@@ -132217,28 +132281,6 @@ function JSReportChartContainer(uielement)
132217
132281
 
132218
132282
  return true;
132219
132283
  }
132220
-
132221
- this.DrawTooltip=function(tooltipStatus)
132222
- {
132223
- if (!this.GetExtraCanvas) return;
132224
- if (!this.TooltipCanvas)
132225
- {
132226
- var finder=this.GetExtraCanvas(JSReportChart.TooltipCursorCanvasKey);
132227
- if (!finder) return;
132228
- this.TooltipCanvas=finder.Canvas;
132229
- }
132230
-
132231
- if (!this.TooltipCanvas) return;
132232
- this.ClearCanvas(this.TooltipCanvas);
132233
- if (!this.ChartTooltip) return;
132234
-
132235
- if (!tooltipStatus || !tooltipStatus.Data) return;
132236
-
132237
- this.ChartTooltip.Canvas=this.TooltipCanvas;
132238
- this.ChartTooltip.Point={ X:tooltipStatus.X, Y:tooltipStatus.Y };
132239
- this.ChartTooltip.Data=tooltipStatus.Data.Data;
132240
- this.ChartTooltip.Draw();
132241
- }
132242
132284
  }
132243
132285
 
132244
132286
 
@@ -132567,6 +132609,7 @@ function ChartReport()
132567
132609
  this.SelectedRow=-1; //选中行ID
132568
132610
  this.SelectedFixedRow=-1; //选中固定行ID
132569
132611
  this.IsDrawBorder=1; //是否绘制单元格边框
132612
+ this.HeaderRowCount=1; //表头行数
132570
132613
 
132571
132614
  //多选模式
132572
132615
  this.MultiSelectModel=0; //0=禁用 1=开启
@@ -132611,6 +132654,7 @@ function ChartReport()
132611
132654
  Margin:
132612
132655
  {
132613
132656
  Left:g_JSChartResource.Report.SortIcon.Margin.Left,
132657
+ Right:g_JSChartResource.Report.SortIcon.Margin.Right,
132614
132658
  Bottom:g_JSChartResource.Report.SortIcon.Margin.Bottom
132615
132659
  }
132616
132660
  }
@@ -132699,6 +132743,7 @@ function ChartReport()
132699
132743
  this.NameSymbolFont={ Symbol:null, Name:null };
132700
132744
  this.RowCount=0; //一屏显示行数
132701
132745
  this.HeaderHeight=0; //表头高度
132746
+ this.HeaderFontHeight=0; //表头字体高度
132702
132747
  this.FixedRowHeight=0; //固定行高度
132703
132748
  this.RowHeight=0; //行高度
132704
132749
  this.ItemTextLines=1; //单元格输出行数
@@ -132832,6 +132877,7 @@ function ChartReport()
132832
132877
  if (!colItem) return null;
132833
132878
 
132834
132879
  if (item.Title) colItem.Title=item.Title;
132880
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryTitle)) colItem.AryTitle=item.AryTitle;
132835
132881
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
132836
132882
  if (item.TextColor) colItem.TextColor=item.TextColor;
132837
132883
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
@@ -133364,7 +133410,17 @@ function ChartReport()
133364
133410
  if (item.Width<itemWidth) item.Width=itemWidth;
133365
133411
  }
133366
133412
 
133367
- this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+ this.HeaderMergin.Top+ this.HeaderMergin.Bottom;
133413
+ this.HeaderFontHeight=this.GetFontHeight(this.HeaderFont,"擎");
133414
+ if (this.HeaderRowCount<=1) //单行
133415
+ {
133416
+ this.HeaderHeight=this.HeaderFontHeight+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);
133417
+ }
133418
+ else
133419
+ {
133420
+ this.HeaderHeight=(this.HeaderFontHeight*this.HeaderRowCount)+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);
133421
+ }
133422
+
133423
+
133368
133424
  if (!this.IsShowHeader) this.HeaderHeight=0;
133369
133425
  if (this.FixedRowCount<=0) this.FixedRowHeight=0;
133370
133426
 
@@ -133381,90 +133437,68 @@ function ChartReport()
133381
133437
  this.IsShowAllColumn=(subWidth<reportWidth);
133382
133438
  }
133383
133439
 
133384
- this.DrawHeader=function()
133440
+ this.DrawHeaderItem=function(column, rtCell, index)
133385
133441
  {
133386
- if (!this.IsShowHeader) return;
133387
-
133388
- var left=this.RectClient.Left;
133389
- var top=this.RectClient.Top;
133390
- var y=top+this.HeaderMergin.Top+(this.HeaderHeight-this.HeaderMergin.Top-this.HeaderMergin.Bottom)/2;
133391
- var yBottom=top+this.HeaderHeight;
133392
- var bDrawSortBG=this.IsDrawSortBGIcon();
133393
-
133394
- this.Canvas.font=this.HeaderFont;
133395
-
133396
- var textLeft=left;
133397
- //固定列
133398
- for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
133442
+ if (column.HeaderBGColor) //背景色
133399
133443
  {
133400
- var item=this.Column[i];
133401
- var itemWidth=item.Width;
133402
- var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133403
- var x=textLeft+this.HeaderMergin.Left;
133444
+ this.DrawItemBG({ Rect:rtCell, BGColor:column.HeaderBGColor });
133445
+ }
133404
133446
 
133405
- if (item.HeaderBGColor)
133406
- {
133407
- var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
133408
- rtBG.Right=rtBG.Left+rtBG.Width;
133409
- rtBG.Bottom=rtBG.Top+rtBG.Height;
133410
- this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
133411
- }
133447
+ var textWidth=rtCell.Width-this.HeaderMergin.Left-this.HeaderMergin.Right;
133448
+ //AryText=[ { Text:标题, Sort:{Type:排序}, Icon:图标 }]
133449
+ var drawInfo={ Rect:rtCell, AryText:[ { Text:null} ], YText:rtCell.Bottom-this.HeaderMergin.Bottom, Index:index, TextWidth:textWidth };
133412
133450
 
133413
- var iconWidth=0;
133414
- if (item.Icon && item.Icon.Symbol) //图标
133451
+ if (this.HeaderRowCount>1) //多行
133452
+ {
133453
+ if (IFrameSplitOperator.IsNonEmptyArray(column.AryTitle))
133415
133454
  {
133416
- var iconWidth=item.Icon.Size;
133417
- if (item.Icon.Margin)
133455
+ drawInfo.AryText=[];
133456
+ for(var i=0;i<column.AryTitle.length && i<this.HeaderRowCount;++i)
133418
133457
  {
133419
- var margin=item.Icon.Margin;
133420
- if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
133421
- if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
133458
+ var text=column.AryTitle[i];
133459
+ drawInfo.AryText.push({ Text:text } );
133422
133460
  }
133423
- }
133424
- textWidth-=iconWidth;
133425
-
133426
- if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
133427
- else this.Canvas.fillStyle=this.HeaderColor;
133428
-
133429
- var textSize={ }
133430
- if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
133431
- {
133432
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort, textSize);
133433
- }
133434
- else if (item.Sort>0 && bDrawSortBG)
133435
- {
133436
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,0,textSize);
133461
+ drawInfo.YText-=((this.HeaderRowCount-1)*this.HeaderFontHeight);
133437
133462
  }
133438
133463
  else
133439
133464
  {
133440
- this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
133465
+ if (column.Title) drawInfo.AryText[0].Text=column.Title;
133466
+ drawInfo.YText=rtCell.Bottom-this.HeaderMergin.Bottom-(this.HeaderRowCount*this.HeaderFontHeight)/2+this.HeaderFontHeight/2;
133441
133467
  }
133468
+ }
133469
+ else //单行
133470
+ {
133471
+ if (column.Title) drawInfo.AryText[0].Text=column.Title;
133472
+ }
133442
133473
 
133443
- if (iconWidth>0)
133444
- {
133445
- this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
133446
- this.Canvas.font=this.HeaderFont;
133447
- }
133474
+ var lastItem=drawInfo.AryText[drawInfo.AryText.length-1];
133448
133475
 
133449
- this.Canvas.fillStyle=this.HeaderColor;
133476
+ //排序
133477
+ var bDrawSortBG=this.IsDrawSortBGIcon();
133478
+ if (this.SortInfo && this.SortInfo.Field==index && this.SortInfo.Sort>0) lastItem.Sort={ Type:this.SortInfo.Sort };
133479
+ else if (column.Sort>0 && bDrawSortBG && IFrameSplitOperator.IsNonEmptyArray(column.SortType) && column.SortType.length>=2) lastItem.Sort={ Type:0 };
133450
133480
 
133451
- textLeft+=item.Width;
133452
- }
133481
+ //图标
133482
+ if (column.Icon) lastItem.Icon=column.Icon;
133453
133483
 
133454
- for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
133455
- {
133456
- var item=this.Column[i];
133457
- var itemWidth=item.Width;
133458
- var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133459
- var x=textLeft+this.HeaderMergin.Left;
133484
+ this.DrawHeaderText(column, drawInfo);
133485
+ }
133460
133486
 
133461
- if (item.HeaderBGColor)
133462
- {
133463
- var rtBG={Left:textLeft, Top:top, Width:itemWidth, Height:this.HeaderHeight };
133464
- rtBG.Right=rtBG.Left+rtBG.Width;
133465
- rtBG.Bottom=rtBG.Top+rtBG.Height;
133466
- this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
133467
- }
133487
+ this.DrawHeaderText=function(column, drawInfo)
133488
+ {
133489
+ if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
133490
+ else this.Canvas.fillStyle=this.HeaderColor;
133491
+
133492
+ var pixelRatio=GetDevicePixelRatio();
133493
+ var cellWidth=drawInfo.Rect.Width;
133494
+ var bDrawSortBG=this.IsDrawSortBGIcon();
133495
+
133496
+ var y=drawInfo.YText;
133497
+ for(var i=0;i<drawInfo.AryText.length;++i)
133498
+ {
133499
+ var x=drawInfo.Rect.Left+this.HeaderMergin.Left;
133500
+ var item=drawInfo.AryText[i];
133501
+ var textSize={ TextMaxWidth:drawInfo.TextWidth };
133468
133502
 
133469
133503
  var iconWidth=0;
133470
133504
  if (item.Icon && item.Icon.Symbol) //图标
@@ -133477,81 +133511,123 @@ function ChartReport()
133477
133511
  if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
133478
133512
  }
133479
133513
  }
133514
+ if (iconWidth>0) textSize.TextMaxWidth-=iconWidth;
133480
133515
 
133481
- textWidth-=iconWidth;
133482
-
133483
- if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
133484
- else this.Canvas.fillStyle=this.HeaderColor;
133516
+ var sortWidth=0; //排序图标
133517
+ if (item.Sort && this.SortConfig && IFrameSplitOperator.IsPlusNumber(this.SortConfig.Size))
133518
+ {
133519
+ sortWidth=this.SortConfig.Size*pixelRatio;
133520
+ if (this.SortConfig.Margin)
133521
+ {
133522
+ var margin=this.SortConfig.Margin;
133523
+ if (IFrameSplitOperator.IsNumber(margin.Left)) sortWidth+=margin.Left;
133524
+ if (IFrameSplitOperator.IsNumber(margin.Right)) sortWidth+=margin.Right;
133525
+ }
133526
+ }
133527
+ if (sortWidth>0) textSize.TextMaxWidth-=sortWidth;
133528
+
133485
133529
 
133486
- var textSize={ }
133487
- if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
133530
+ var textWidth=0;
133531
+ if (item.Text)
133488
133532
  {
133489
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort,textSize);
133533
+ this.Canvas.font=this.HeaderFont;
133534
+ textWidth=this.Canvas.measureText(item.Text).width;
133490
133535
  }
133491
- else if (item.Sort>0)
133536
+
133537
+ if (column.TextAlign=='center') x=x+(cellWidth-textWidth)/2;
133538
+ else if (column.TextAlign=='right') x=x+textSize.TextMaxWidth-textWidth;
133539
+
133540
+ if (item.Text) //文字
133492
133541
  {
133493
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,0, textSize);
133542
+ this.Canvas.fillText(item.Text,x,y);
133543
+ x+=textWidth;
133494
133544
  }
133495
- else
133545
+
133546
+ if (sortWidth>1) //排序
133496
133547
  {
133497
- this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
133548
+ this.Canvas.font=this.SortFont;
133549
+ var xSort=x;
133550
+ if (this.SortConfig.Margin && IFrameSplitOperator.IsNumber(this.SortConfig.Margin.Left)) xSort+=this.SortConfig.Margin.Left;
133551
+ if (item.Sort.Type!=0 && bDrawSortBG) //背景
133552
+ {
133553
+ var sortText=this.SortConfig.Arrow[0];
133554
+ var sortColor=this.SortConfig.Color[0];
133555
+ this.Canvas.fillStyle=sortColor;
133556
+ this.Canvas.fillText(sortText,xSort,y-this.SortConfig.Margin.Bottom);
133557
+ }
133558
+
133559
+ var sortText=this.SortConfig.Arrow[item.Sort.Type];
133560
+ var sortColor=this.SortConfig.Color[item.Sort.Type];
133561
+ this.Canvas.fillStyle=sortColor;
133562
+ this.Canvas.fillText(sortText,xSort,y-this.SortConfig.Margin.Bottom);
133563
+ x+=sortWidth;
133498
133564
  }
133499
133565
 
133500
- if (iconWidth>0)
133566
+ if (iconWidth>1) //图标
133501
133567
  {
133502
- this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
133503
- this.Canvas.font=this.HeaderFont;
133568
+ var icon=item.Icon;
133569
+ var iconFont=`${icon.Size}px ${icon.Family}`;
133570
+ this.Canvas.font=iconFont;
133571
+ if (icon.Color) this.Canvas.fillStyle=icon.Color;
133572
+ var yOffset=0, xOffset=0;
133573
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xOffset=icon.Margin.Left;
133574
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yOffset=-icon.Margin.Bottom;
133575
+ this.Canvas.fillText(icon.Symbol, x+xOffset, y+yOffset);
133576
+
133577
+ if (icon.Tooltip)
133578
+ {
133579
+ var rtIcon={ Left:x+xOffset, Bottom:y+yOffset, Width:icon.Size, Height:icon.Size };
133580
+ rtIcon.Right=rtIcon.Left+rtIcon.Width;
133581
+ rtIcon.Top=rtIcon.Bottom-rtIcon.Height;
133582
+
133583
+ var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:drawInfo.Index, Data:icon.Tooltip.Data };
133584
+ this.TooltipRect.push(tooltipData);
133585
+ }
133504
133586
  }
133505
133587
 
133506
- textLeft+=item.Width;
133507
- }
133588
+ y+=this.HeaderFontHeight;
133589
+ }
133508
133590
  }
133509
133591
 
133510
- this.DrawText=function(text, textAlign, x, yBottom, cellWidth, textSize)
133592
+ this.DrawHeader=function()
133511
133593
  {
133512
- var textWidth=this.Canvas.measureText(text).width;
133513
- if (textAlign=='center')
133514
- {
133515
- x=x+(cellWidth-textWidth)/2;
133516
- }
133517
- else if (textAlign=='right')
133518
- {
133519
- x=x+cellWidth-textWidth;
133520
- }
133594
+ if (!this.IsShowHeader) return;
133521
133595
 
133596
+ var left=this.RectClient.Left;
133597
+ var top=this.RectClient.Top;
133598
+ this.Canvas.font=this.HeaderFont;
133599
+
133600
+ var textLeft=left;
133522
133601
  this.Canvas.textAlign="left";
133523
133602
  this.Canvas.textBaseline="bottom";
133524
- this.Canvas.fillText(text,x,yBottom-this.HeaderMergin.Bottom);
133525
-
133526
- if (textSize)
133603
+ //固定列
133604
+ for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
133527
133605
  {
133528
- textSize.Right=x+textWidth;
133529
- textSize.Width=textWidth;
133530
- }
133531
- }
133606
+ var item=this.Column[i];
133607
+ var itemWidth=item.Width;
133608
+ //var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133532
133609
 
133533
- this.DrawHeaderIcon=function(icon, x, yBottom, index, column)
133534
- {
133535
- var iconFont=`${icon.Size}px ${icon.Family}`;
133536
- this.Canvas.font=iconFont;
133537
- this.Canvas.textAlign="left";
133538
- if (icon.Color) this.Canvas.fillStyle=icon.Color;
133610
+ var rtCell={ Left:textLeft, Width:itemWidth, Top:top, Height:this.HeaderHeight };
133611
+ rtCell.Right=rtCell.Left+rtCell.Width;
133612
+ rtCell.Bottom=rtCell.Top+rtCell.Height;
133539
133613
 
133540
- var xIcon=x;
133541
- var yIcon=yBottom;
133542
- if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xIcon+=icon.Margin.Left;
133543
- if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yIcon-=icon.Margin.Bottom;
133544
- this.Canvas.fillText(icon.Symbol, xIcon, yIcon);
133614
+ this.DrawHeaderItem(item, rtCell, i);
133615
+ textLeft+=item.Width;
133616
+ }
133545
133617
 
133546
- if (icon.Tooltip)
133618
+ for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
133547
133619
  {
133548
- var rtIcon={ Left:xIcon, Bottom:yIcon, Width:icon.Size, Height:icon.Size };
133549
- rtIcon.Right=rtIcon.Left+rtIcon.Width;
133550
- rtIcon.Top=rtIcon.Bottom-rtIcon.Height;
133620
+ var item=this.Column[i];
133621
+ var itemWidth=item.Width;
133622
+ //var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133551
133623
 
133552
- var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:index, Data:icon.Tooltip.Data };
133553
- this.TooltipRect.push(tooltipData);
133554
- }
133624
+ var rtCell={ Left:textLeft, Width:itemWidth, Top:top, Height:this.HeaderHeight };
133625
+ rtCell.Right=rtCell.Left+rtCell.Width;
133626
+ rtCell.Bottom=rtCell.Top+rtCell.Height;
133627
+
133628
+ this.DrawHeaderItem(item, rtCell, i);
133629
+ textLeft+=item.Width;
133630
+ }
133555
133631
  }
133556
133632
 
133557
133633
  //是否绘制排序背景图标
@@ -133566,57 +133642,6 @@ function ChartReport()
133566
133642
  return true;
133567
133643
  }
133568
133644
 
133569
- this.DrawSortHeader=function(text, textAlign, x, yBottom, width, sortType,textSize)
133570
- {
133571
- var pixelRatio=GetDevicePixelRatio();
133572
- var sortText=this.SortConfig.Arrow[sortType];
133573
- var sortBGText=this.SortConfig.Arrow[0];
133574
- var sortBGColor=this.SortConfig.Color[0];
133575
- this.Canvas.font=this.HeaderFont;
133576
- var textWidth=this.Canvas.measureText(text).width;
133577
- var sortTextWidth=this.SortConfig.Size*pixelRatio+this.SortConfig.Margin.Left;
133578
-
133579
- if (textAlign=='center')
133580
- {
133581
- x=x+width/2-(sortTextWidth+textWidth)/2;
133582
- }
133583
- else if (textAlign=='right')
133584
- {
133585
- x=(x+width)-sortTextWidth-textWidth;
133586
- }
133587
-
133588
- this.Canvas.textBaseline="bottom";
133589
- this.Canvas.textAlign="left";
133590
-
133591
- var xText=x;
133592
- this.Canvas.font=this.HeaderFont;
133593
- this.Canvas.fillStyle=this.HeaderColor;
133594
- this.Canvas.fillText(text,xText,yBottom-this.HeaderMergin.Bottom);
133595
-
133596
- xText+=(textWidth+this.SortConfig.Margin.Left);
133597
- this.Canvas.font=this.SortFont;
133598
- if (sortBGText && sortBGColor)
133599
- {
133600
- this.Canvas.fillStyle=sortBGColor;
133601
- this.Canvas.fillText(sortBGText,xText,yBottom-this.SortConfig.Margin.Bottom);
133602
- }
133603
-
133604
- if (sortType>0)
133605
- {
133606
- this.Canvas.fillStyle=this.SortConfig.Color[sortType];
133607
- this.Canvas.fillText(sortText,xText,yBottom-this.SortConfig.Margin.Bottom);
133608
- }
133609
-
133610
- this.Canvas.font=this.HeaderFont;
133611
- this.Canvas.fillStyle=this.HeaderColor;
133612
-
133613
- if (textSize)
133614
- {
133615
- textSize.Right=x+textWidth+sortTextWidth;
133616
- textSize.Width=textWidth+sortTextWidth;
133617
- }
133618
- }
133619
-
133620
133645
  this.DrawBorder=function()
133621
133646
  {
133622
133647
  if (!this.IsDrawBorder) return;
@@ -134240,9 +134265,7 @@ function ChartReport()
134240
134265
  {
134241
134266
  this.FormatReserveNumber(column, stock, drawInfo);
134242
134267
  }
134243
- else if ([REPORT_COLUMN_ID.RESERVE_STRING1_ID,REPORT_COLUMN_ID.RESERVE_STRING2_ID,REPORT_COLUMN_ID.RESERVE_STRING3_ID,REPORT_COLUMN_ID.RESERVE_STRING4_ID,
134244
- REPORT_COLUMN_ID.RESERVE_STRING5_ID,REPORT_COLUMN_ID.RESERVE_STRING6_ID,REPORT_COLUMN_ID.RESERVE_STRING7_ID,REPORT_COLUMN_ID.RESERVE_STRING8_ID,
134245
- REPORT_COLUMN_ID.RESERVE_STRING9_ID,REPORT_COLUMN_ID.RESERVE_STRING10_ID].includes(column.Type))
134268
+ else if (this.IsReserveString(column.Type))
134246
134269
  {
134247
134270
  this.FormatReserveString(column, stock, drawInfo);
134248
134271
  }
@@ -134301,7 +134324,7 @@ function ChartReport()
134301
134324
 
134302
134325
  this.DrawItemBG(drawInfo);
134303
134326
 
134304
- if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
134327
+ if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID || this.IsReserveString(column.Type))
134305
134328
  this.DrawCustomText(drawInfo,column, x, top, textWidth);
134306
134329
  else
134307
134330
  this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
@@ -134353,6 +134376,20 @@ function ChartReport()
134353
134376
  return ARARY_TYPE.includes(value);
134354
134377
  }
134355
134378
 
134379
+ this.IsReserveString=function(value)
134380
+ {
134381
+ var ARARY_TYPE=
134382
+ [
134383
+ REPORT_COLUMN_ID.RESERVE_STRING1_ID,REPORT_COLUMN_ID.RESERVE_STRING2_ID,REPORT_COLUMN_ID.RESERVE_STRING3_ID,REPORT_COLUMN_ID.RESERVE_STRING4_ID,
134384
+ REPORT_COLUMN_ID.RESERVE_STRING5_ID,REPORT_COLUMN_ID.RESERVE_STRING6_ID,REPORT_COLUMN_ID.RESERVE_STRING7_ID,REPORT_COLUMN_ID.RESERVE_STRING8_ID,
134385
+ REPORT_COLUMN_ID.RESERVE_STRING9_ID,REPORT_COLUMN_ID.RESERVE_STRING10_ID
134386
+ ];
134387
+
134388
+ return ARARY_TYPE.includes(value);
134389
+ }
134390
+
134391
+
134392
+
134356
134393
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
134357
134394
  {
134358
134395
  if (!drawInfo.Text) return;
@@ -137082,7 +137119,7 @@ function ChartVScrollbar()
137082
137119
  }
137083
137120
  }
137084
137121
 
137085
-
137122
+ /* 使用div替换掉了
137086
137123
  function ChartCellTooltip()
137087
137124
  {
137088
137125
  this.Canvas; //画布
@@ -137244,6 +137281,7 @@ function ChartCellTooltip()
137244
137281
  }
137245
137282
  }
137246
137283
  }
137284
+ */
137247
137285
  /*
137248
137286
  Copyright (c) 2018 jones
137249
137287
 
@@ -147206,11 +147244,26 @@ function JSFloatTooltip()
147206
147244
  {
147207
147245
  this.UpdateChartDrawSVGV2Tooltip(data);
147208
147246
  }
147247
+
147209
147248
  }
147210
147249
  else if (data.DataType==2) //更新实时行情数据
147211
147250
  {
147212
147251
  this.UpdateRealtimeHQTooltip(data);
147213
147252
  }
147253
+ else if (data.DataType==3) //报价列表
147254
+ {
147255
+ var tooltipData=data.Tooltip;
147256
+ if (!tooltipData) return;
147257
+
147258
+ if (tooltipData.Type==2) //报价列表表头图标提示信息
147259
+ {
147260
+ this.ReportHeaderIconTooltip(data);
147261
+ }
147262
+ else if (tooltipData.Type==1) //单元格截断内容
147263
+ {
147264
+ this.ReportCellTruncateTooltip(data);
147265
+ }
147266
+ }
147214
147267
  }
147215
147268
 
147216
147269
  this.UpdateRealtimeHQTooltip=function(data)
@@ -147450,6 +147503,34 @@ function JSFloatTooltip()
147450
147503
 
147451
147504
  this.ShowTooltip(data);
147452
147505
  }
147506
+
147507
+ //表头图标
147508
+ this.ReportHeaderIconTooltip=function(data)
147509
+ {
147510
+ var tooltipData=data.Tooltip;
147511
+ if (!tooltipData.Data || !IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText)) return;
147512
+
147513
+ this.AryText=tooltipData.Data.AryText;
147514
+ this.UpdateTableDOM();
147515
+
147516
+ this.ShowTooltip(data);
147517
+ }
147518
+
147519
+ //表格单元格截断内容
147520
+ this.ReportCellTruncateTooltip=function(data)
147521
+ {
147522
+ var tooltipData=data.Tooltip;
147523
+ if (!tooltipData.Data || !IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText)) return;
147524
+
147525
+ var item=tooltipData.Data.AryText[0];
147526
+ if (!item.Text) return;
147527
+
147528
+ this.AryText=[ { Title:item.Text, IsMergeCell:true } ];
147529
+
147530
+ this.UpdateTableDOM();
147531
+
147532
+ this.ShowTooltip(data);
147533
+ }
147453
147534
 
147454
147535
  this.UpdateTableDOM=function()
147455
147536
  {
@@ -150146,7 +150227,7 @@ function HQChartScriptWorker()
150146
150227
 
150147
150228
 
150148
150229
 
150149
- var HQCHART_VERSION="1.1.14268";
150230
+ var HQCHART_VERSION="1.1.14275";
150150
150231
 
150151
150232
  function PrintHQChartVersion()
150152
150233
  {