hqchart 1.1.14269 → 1.1.14274

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.
@@ -74604,7 +74604,7 @@ function JSChartResource()
74604
74604
  Size:12, Family:"iconfont",
74605
74605
  Arrow:[null, "\ue6b2", "\ue6b1"], //[0]=默认排序的图标背景色
74606
74606
  Color:[null, "rgb(255,0,0)", "rgb(255,0,0)"],
74607
- Margin:{ Left:0, Bottom:6 }
74607
+ Margin:{ Left:0, Bottom:2, Right:0,}
74608
74608
  },
74609
74609
 
74610
74610
  Item:
@@ -116709,9 +116709,6 @@ function JSExecute(ast,option)
116709
116709
 
116710
116710
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_OTHER_SYMBOL_DATA: //指定股票数据
116711
116711
  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
116712
 
116716
116713
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_MARGIN_BALANCE:
116717
116714
  case JS_EXECUTE_JOB_ID.JOB_DOWNLOAD_MARGIN_RATE:
@@ -128187,15 +128184,8 @@ function JSReportChart(divElement)
128187
128184
  if (option.EnableResize==true) this.CreateResizeListener();
128188
128185
 
128189
128186
  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
- }
128187
+ if (option.FloatTooltip && option.FloatTooltip.Enable) chart.InitalFloatTooltip(option.FloatTooltip); //提示信息
128188
+ if (option.MinuteChartTooltip && option.MinuteChartTooltip.Enable) chart.InitalMinuteChartTooltip(option.MinuteChartTooltip);
128199
128189
 
128200
128190
  if (option.Symbol) chart.Symbol=option.Symbol;
128201
128191
  if (option.Name) chart.Name=option.Name;
@@ -128365,8 +128355,6 @@ function JSReportChart(divElement)
128365
128355
  }
128366
128356
  }
128367
128357
 
128368
- JSReportChart.TooltipCursorCanvasKey="hq_report_tooltip"; //提示信息
128369
-
128370
128358
 
128371
128359
  JSReportChart.Init=function(divElement)
128372
128360
  {
@@ -128445,9 +128433,6 @@ function JSReportChartContainer(uielement)
128445
128433
  this.SplashTitle={ StockList:"下载码表中.....", MemberList:"下载成分中....." } ;
128446
128434
 
128447
128435
  this.Canvas=uielement.getContext("2d"); //画布
128448
-
128449
- this.TooltipCanvas;
128450
- this.ChartTooltip;
128451
128436
 
128452
128437
  this.Tooltip=document.createElement("div");
128453
128438
  this.Tooltip.className='jsreport-tooltip';
@@ -128531,6 +128516,7 @@ function JSReportChartContainer(uielement)
128531
128516
  this.StopAutoUpdate();
128532
128517
 
128533
128518
  this.DestroyMinuteChartTooltip();
128519
+ this.DestroyFloatTooltip();
128534
128520
  }
128535
128521
 
128536
128522
  this.StopAutoDragScrollTimer=function()
@@ -128569,6 +128555,51 @@ function JSReportChartContainer(uielement)
128569
128555
  this.TooltipMinuteChart=null;
128570
128556
  }
128571
128557
 
128558
+ this.InitalFloatTooltip=function(option)
128559
+ {
128560
+ if (this.FloatTooltip) return;
128561
+
128562
+ this.FloatTooltip=new JSFloatTooltip();
128563
+ this.FloatTooltip.Inital(this, option);
128564
+ this.FloatTooltip.Create();
128565
+ }
128566
+
128567
+ this.HideFloatTooltip=function()
128568
+ {
128569
+ if (!this.FloatTooltip) return;
128570
+
128571
+ this.FloatTooltip.Hide();
128572
+ }
128573
+
128574
+ this.DestroyFloatTooltip=function()
128575
+ {
128576
+ if (!this.FloatTooltip) return;
128577
+
128578
+ this.FloatTooltip.Destroy();
128579
+ this.FloatTooltip=null;
128580
+ }
128581
+
128582
+ this.DrawFloatTooltip=function(point,toolTip)
128583
+ {
128584
+ if (!this.FloatTooltip) return;
128585
+
128586
+ this.UpdateFloatTooltip(point, toolTip)
128587
+ }
128588
+
128589
+ this.UpdateFloatTooltip=function(point, toolTip)
128590
+ {
128591
+ if (!this.FloatTooltip) return;
128592
+
128593
+ var sendData=
128594
+ {
128595
+ Tooltip:toolTip,
128596
+ Point:point,
128597
+ DataType:3,
128598
+ };
128599
+
128600
+ this.FloatTooltip.Update(sendData);
128601
+ }
128602
+
128572
128603
  //data={ Symbol }
128573
128604
  this.ShowMinuteChartTooltip=function(x,y, data)
128574
128605
  {
@@ -128719,12 +128750,6 @@ function JSReportChartContainer(uielement)
128719
128750
 
128720
128751
  this.ChartPaint[0]=chart;
128721
128752
 
128722
- //提示信息
128723
- var chartTooltip=new ChartCellTooltip();
128724
- chartTooltip.Frame=this.Frame;
128725
- chartTooltip.ChartBorder=this.Frame.ChartBorder;
128726
- this.ChartTooltip=chartTooltip;
128727
-
128728
128753
  //页脚
128729
128754
  if (option && option.PageInfo===true)
128730
128755
  {
@@ -128746,6 +128771,7 @@ function JSReportChartContainer(uielement)
128746
128771
  if (IFrameSplitOperator.IsNumber(option.FixedRowCount)) chart.FixedRowCount=option.FixedRowCount; //固定行
128747
128772
  if (IFrameSplitOperator.IsBool(option.ItemBorder)) chart.IsDrawBorder=option.ItemBorder; //单元格边框
128748
128773
  if (IFrameSplitOperator.IsNumber(option.SelectedModel)) chart.SelectedModel=option.SelectedModel;
128774
+ if (IFrameSplitOperator.IsNumber(option.HeaderRowCount)) chart.HeaderRowCount=option.HeaderRowCount;
128749
128775
 
128750
128776
  if (IFrameSplitOperator.IsNonEmptyArray(option.FixedSymbol))
128751
128777
  {
@@ -128837,8 +128863,6 @@ function JSReportChartContainer(uielement)
128837
128863
  {
128838
128864
  this.DelayDraw(500);
128839
128865
  }
128840
-
128841
- this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
128842
128866
  }
128843
128867
 
128844
128868
  this.DelayDraw=function(frequency)
@@ -129770,6 +129794,7 @@ function JSReportChartContainer(uielement)
129770
129794
  {
129771
129795
  this.LastMouseStatus.TooltipStatus=null;
129772
129796
  this.HideMinuteChartTooltip();
129797
+ this.HideFloatTooltip();
129773
129798
  if (this.GotoNextItem(1))
129774
129799
  {
129775
129800
  this.Draw();
@@ -129780,6 +129805,7 @@ function JSReportChartContainer(uielement)
129780
129805
  {
129781
129806
  this.LastMouseStatus.TooltipStatus=null;
129782
129807
  this.HideMinuteChartTooltip();
129808
+ this.HideFloatTooltip();
129783
129809
  if (this.GotoNextItem(-1))
129784
129810
  {
129785
129811
  this.Draw();
@@ -129793,6 +129819,7 @@ function JSReportChartContainer(uielement)
129793
129819
  {
129794
129820
  this.LastMouseStatus.TooltipStatus=null;
129795
129821
  this.HideMinuteChartTooltip();
129822
+ this.HideFloatTooltip();
129796
129823
  if (this.GotoNextPage(this.PageUpDownCycle))
129797
129824
  {
129798
129825
  this.Draw();
@@ -129803,6 +129830,7 @@ function JSReportChartContainer(uielement)
129803
129830
  {
129804
129831
  this.LastMouseStatus.TooltipStatus=null;
129805
129832
  this.HideMinuteChartTooltip();
129833
+ this.HideFloatTooltip();
129806
129834
  if (this.GotoPreviousPage(this.PageUpDownCycle))
129807
129835
  {
129808
129836
  this.Draw();
@@ -129825,6 +129853,7 @@ function JSReportChartContainer(uielement)
129825
129853
  if (keyID==116) return; //F15刷新不处理
129826
129854
 
129827
129855
  this.HideMinuteChartTooltip();
129856
+ this.HideFloatTooltip();
129828
129857
  switch(keyID)
129829
129858
  {
129830
129859
  case 33: //page up
@@ -130225,7 +130254,17 @@ function JSReportChartContainer(uielement)
130225
130254
  if (mouseStatus) this.UIElement.style.cursor=mouseStatus.Cursor;
130226
130255
 
130227
130256
  if (bDraw || bDrawTab) this.Draw();
130228
- else if (bDrawTooltip) this.DrawTooltip(this.LastMouseStatus.TooltipStatus);
130257
+
130258
+ if (this.LastMouseStatus.TooltipStatus)
130259
+ {
130260
+ var xTooltip = e.clientX-this.UIElement.getBoundingClientRect().left;
130261
+ var yTooltip = e.clientY-this.UIElement.getBoundingClientRect().top;
130262
+ this.DrawFloatTooltip({X:xTooltip, Y:yTooltip, YMove:20/pixelTatio},this.LastMouseStatus.TooltipStatus.Data);
130263
+ }
130264
+ else
130265
+ {
130266
+ this.HideFloatTooltip();
130267
+ }
130229
130268
 
130230
130269
  if (bShowChartTooltip)
130231
130270
  {
@@ -130240,6 +130279,7 @@ function JSReportChartContainer(uielement)
130240
130279
  this.UIOnMounseOut=function(e)
130241
130280
  {
130242
130281
  this.HideMinuteChartTooltip();
130282
+ this.HideFloatTooltip();
130243
130283
 
130244
130284
  var bDraw=false;
130245
130285
  var tabChart=this.GetTabChart();
@@ -130266,6 +130306,7 @@ function JSReportChartContainer(uielement)
130266
130306
  this.UIOnMouseleave=function(e)
130267
130307
  {
130268
130308
  this.HideMinuteChartTooltip();
130309
+ this.HideFloatTooltip();
130269
130310
 
130270
130311
  var tabChart=this.GetTabChart();
130271
130312
  if (tabChart && tabChart.MoveOnTabIndex>=0)
@@ -131822,16 +131863,16 @@ function JSReportChartContainer(uielement)
131822
131863
  case REPORT_COLUMN_ID.VOL_OUT_ID:
131823
131864
  case REPORT_COLUMN_ID.DATE_ID:
131824
131865
 
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:
131866
+ case REPORT_COLUMN_ID.RESERVE_NUMBER1_ID:
131867
+ case REPORT_COLUMN_ID.RESERVE_NUMBER2_ID:
131868
+ case REPORT_COLUMN_ID.RESERVE_NUMBER3_ID:
131869
+ case REPORT_COLUMN_ID.RESERVE_NUMBER4_ID:
131870
+ case REPORT_COLUMN_ID.RESERVE_NUMBER5_ID:
131871
+ case REPORT_COLUMN_ID.RESERVE_NUMBER6_ID:
131872
+ case REPORT_COLUMN_ID.RESERVE_NUMBER7_ID:
131873
+ case REPORT_COLUMN_ID.RESERVE_NUMBER8_ID:
131874
+ case REPORT_COLUMN_ID.RESERVE_NUMBER9_ID:
131875
+ case REPORT_COLUMN_ID.RESERVE_NUMBER10_ID:
131835
131876
 
131836
131877
  return this.LocalNumberSort(left, right, column, sortType);
131837
131878
  case REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID: //自定义数值字段
@@ -132217,28 +132258,6 @@ function JSReportChartContainer(uielement)
132217
132258
 
132218
132259
  return true;
132219
132260
  }
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
132261
  }
132243
132262
 
132244
132263
 
@@ -132567,6 +132586,7 @@ function ChartReport()
132567
132586
  this.SelectedRow=-1; //选中行ID
132568
132587
  this.SelectedFixedRow=-1; //选中固定行ID
132569
132588
  this.IsDrawBorder=1; //是否绘制单元格边框
132589
+ this.HeaderRowCount=1; //表头行数
132570
132590
 
132571
132591
  //多选模式
132572
132592
  this.MultiSelectModel=0; //0=禁用 1=开启
@@ -132611,6 +132631,7 @@ function ChartReport()
132611
132631
  Margin:
132612
132632
  {
132613
132633
  Left:g_JSChartResource.Report.SortIcon.Margin.Left,
132634
+ Right:g_JSChartResource.Report.SortIcon.Margin.Right,
132614
132635
  Bottom:g_JSChartResource.Report.SortIcon.Margin.Bottom
132615
132636
  }
132616
132637
  }
@@ -132699,6 +132720,7 @@ function ChartReport()
132699
132720
  this.NameSymbolFont={ Symbol:null, Name:null };
132700
132721
  this.RowCount=0; //一屏显示行数
132701
132722
  this.HeaderHeight=0; //表头高度
132723
+ this.HeaderFontHeight=0; //表头字体高度
132702
132724
  this.FixedRowHeight=0; //固定行高度
132703
132725
  this.RowHeight=0; //行高度
132704
132726
  this.ItemTextLines=1; //单元格输出行数
@@ -132832,6 +132854,7 @@ function ChartReport()
132832
132854
  if (!colItem) return null;
132833
132855
 
132834
132856
  if (item.Title) colItem.Title=item.Title;
132857
+ if (IFrameSplitOperator.IsNonEmptyArray(item.AryTitle)) colItem.AryTitle=item.AryTitle;
132835
132858
  if (item.TextAlign) colItem.TextAlign=item.TextAlign;
132836
132859
  if (item.TextColor) colItem.TextColor=item.TextColor;
132837
132860
  if (item.HeaderColor) colItem.HeaderColor=item.HeaderColor;
@@ -133364,7 +133387,17 @@ function ChartReport()
133364
133387
  if (item.Width<itemWidth) item.Width=itemWidth;
133365
133388
  }
133366
133389
 
133367
- this.HeaderHeight=this.GetFontHeight(this.HeaderFont,"擎")+ this.HeaderMergin.Top+ this.HeaderMergin.Bottom;
133390
+ this.HeaderFontHeight=this.GetFontHeight(this.HeaderFont,"擎");
133391
+ if (this.HeaderRowCount<=1) //单行
133392
+ {
133393
+ this.HeaderHeight=this.HeaderFontHeight+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);
133394
+ }
133395
+ else
133396
+ {
133397
+ this.HeaderHeight=(this.HeaderFontHeight*this.HeaderRowCount)+(this.HeaderMergin.Top+this.HeaderMergin.Bottom);
133398
+ }
133399
+
133400
+
133368
133401
  if (!this.IsShowHeader) this.HeaderHeight=0;
133369
133402
  if (this.FixedRowCount<=0) this.FixedRowHeight=0;
133370
133403
 
@@ -133381,90 +133414,70 @@ function ChartReport()
133381
133414
  this.IsShowAllColumn=(subWidth<reportWidth);
133382
133415
  }
133383
133416
 
133384
- this.DrawHeader=function()
133417
+ this.DrawHeaderItem=function(column, rtCell, index)
133385
133418
  {
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)
133419
+ if (column.HeaderBGColor) //背景色
133399
133420
  {
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;
133421
+ this.DrawItemBG({ Rect:rtCell, BGColor:column.HeaderBGColor });
133422
+ }
133404
133423
 
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
- }
133424
+ var textWidth=rtCell.Width-this.HeaderMergin.Left-this.HeaderMergin.Right;
133425
+ //AryText=[ { Text:标题, Sort:{Type:排序}, Icon:图标 }]
133426
+ var drawInfo={ Rect:rtCell, AryText:[ { Text:null} ], YText:rtCell.Bottom-this.HeaderMergin.Bottom, Index:index, TextWidth:textWidth };
133412
133427
 
133413
- var iconWidth=0;
133414
- if (item.Icon && item.Icon.Symbol) //图标
133428
+ if (this.HeaderRowCount>1) //多行
133429
+ {
133430
+ if (IFrameSplitOperator.IsNonEmptyArray(column.AryTitle))
133415
133431
  {
133416
- var iconWidth=item.Icon.Size;
133417
- if (item.Icon.Margin)
133432
+ drawInfo.AryText=[];
133433
+ for(var i=0;i<column.AryTitle.length && i<this.HeaderRowCount;++i)
133418
133434
  {
133419
- var margin=item.Icon.Margin;
133420
- if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
133421
- if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
133435
+ var text=column.AryTitle[i];
133436
+ drawInfo.AryText.push({ Text:text } );
133422
133437
  }
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);
133438
+ drawInfo.YText-=((this.HeaderRowCount-1)*this.HeaderFontHeight);
133437
133439
  }
133438
133440
  else
133439
133441
  {
133440
- this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
133442
+ if (column.Title) drawInfo.AryText[0].Text=column.Title;
133443
+ drawInfo.YText=rtCell.Bottom-this.HeaderMergin.Bottom-(this.HeaderRowCount*this.HeaderFontHeight)/2+this.HeaderFontHeight/2;
133441
133444
  }
133445
+ }
133446
+ else //单行
133447
+ {
133448
+ if (column.Title) drawInfo.AryText[0].Text=column.Title;
133449
+ }
133442
133450
 
133443
- if (iconWidth>0)
133444
- {
133445
- this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
133446
- this.Canvas.font=this.HeaderFont;
133447
- }
133451
+ var lastItem=drawInfo.AryText[drawInfo.AryText.length-1];
133448
133452
 
133449
- this.Canvas.fillStyle=this.HeaderColor;
133453
+ //排序
133454
+ var bDrawSortBG=this.IsDrawSortBGIcon();
133455
+ if (this.SortInfo && this.SortInfo.Field==index && this.SortInfo.Sort>0) lastItem.Sort={ Type:this.SortInfo.Sort };
133456
+ else if (column.Sort>0 && bDrawSortBG) lastItem.Sort={ Type:0 };
133450
133457
 
133451
- textLeft+=item.Width;
133452
- }
133458
+ //图标
133459
+ if (column.Icon) lastItem.Icon=column.Icon;
133453
133460
 
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;
133461
+ this.DrawHeaderText(column, drawInfo);
133462
+ }
133460
133463
 
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
- }
133464
+ this.DrawHeaderText=function(column, drawInfo)
133465
+ {
133466
+ if (column.HeaderColor) this.Canvas.fillStyle=column.HeaderColor;
133467
+ else this.Canvas.fillStyle=this.HeaderColor;
133468
+
133469
+ var pixelRatio=GetDevicePixelRatio();
133470
+ var cellWidth=drawInfo.Rect.Width;
133471
+
133472
+ if (drawInfo.AryText.length>1)
133473
+ var nnnn=10;
133474
+
133475
+ var y=drawInfo.YText;
133476
+ for(var i=0;i<drawInfo.AryText.length;++i)
133477
+ {
133478
+ var x=drawInfo.Rect.Left+this.HeaderMergin.Left;
133479
+ var item=drawInfo.AryText[i];
133480
+ var textSize={ TextMaxWidth:drawInfo.TextWidth };
133468
133481
 
133469
133482
  var iconWidth=0;
133470
133483
  if (item.Icon && item.Icon.Symbol) //图标
@@ -133477,81 +133490,113 @@ function ChartReport()
133477
133490
  if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
133478
133491
  }
133479
133492
  }
133493
+ if (iconWidth>0) textSize.TextMaxWidth-=iconWidth;
133480
133494
 
133481
- textWidth-=iconWidth;
133482
-
133483
- if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
133484
- else this.Canvas.fillStyle=this.HeaderColor;
133495
+ var sortWidth=0; //排序图标
133496
+ if (item.Sort && this.SortConfig && IFrameSplitOperator.IsPlusNumber(this.SortConfig.Size))
133497
+ {
133498
+ sortWidth=this.SortConfig.Size*pixelRatio;
133499
+ if (this.SortConfig.Margin)
133500
+ {
133501
+ var margin=this.SortConfig.Margin;
133502
+ if (IFrameSplitOperator.IsNumber(margin.Left)) sortWidth+=margin.Left;
133503
+ if (IFrameSplitOperator.IsNumber(margin.Right)) sortWidth+=margin.Right;
133504
+ }
133505
+ }
133506
+ if (sortWidth>0) textSize.TextMaxWidth-=sortWidth;
133507
+
133485
133508
 
133486
- var textSize={ }
133487
- if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
133509
+ var textWidth=0;
133510
+ if (item.Text)
133488
133511
  {
133489
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,this.SortInfo.Sort,textSize);
133512
+ this.Canvas.font=this.HeaderFont;
133513
+ textWidth=this.Canvas.measureText(item.Text).width;
133490
133514
  }
133491
- else if (item.Sort>0)
133515
+
133516
+ if (column.TextAlign=='center') x=x+(cellWidth-textWidth)/2;
133517
+ else if (column.TextAlign=='right') x=x+textSize.TextMaxWidth-textWidth;
133518
+
133519
+ if (item.Text) //文字
133492
133520
  {
133493
- this.DrawSortHeader(item.Title,item.TextAlign,x,yBottom,textWidth,0, textSize);
133521
+ this.Canvas.fillText(item.Text,x,y);
133522
+ x+=textWidth;
133494
133523
  }
133495
- else
133524
+
133525
+ if (sortWidth>1) //排序
133496
133526
  {
133497
- this.DrawText(item.Title,item.TextAlign,x,yBottom,textWidth,textSize);
133527
+ var sortText=this.SortConfig.Arrow[item.Sort.Type];
133528
+ var sortColor=this.SortConfig.Color[item.Sort.Type];
133529
+ this.Canvas.font=this.SortFont;
133530
+ this.Canvas.fillStyle=sortColor;
133531
+ this.Canvas.fillText(sortText,x,y-this.SortConfig.Margin.Bottom);
133532
+ x+=sortWidth;
133498
133533
  }
133499
133534
 
133500
- if (iconWidth>0)
133535
+ if (iconWidth>1) //图标
133501
133536
  {
133502
- this.DrawHeaderIcon(item.Icon, textSize.Right, yBottom, i, item);
133503
- this.Canvas.font=this.HeaderFont;
133537
+ var icon=item.Icon;
133538
+ var iconFont=`${icon.Size}px ${icon.Family}`;
133539
+ this.Canvas.font=iconFont;
133540
+ if (icon.Color) this.Canvas.fillStyle=icon.Color;
133541
+ var yOffset=0, xOffset=0;
133542
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xOffset=icon.Margin.Left;
133543
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yOffset=-icon.Margin.Bottom;
133544
+ this.Canvas.fillText(icon.Symbol, x+xOffset, y+yOffset);
133545
+
133546
+ if (icon.Tooltip)
133547
+ {
133548
+ var rtIcon={ Left:x+xOffset, Bottom:y+yOffset, Width:icon.Size, Height:icon.Size };
133549
+ rtIcon.Right=rtIcon.Left+rtIcon.Width;
133550
+ rtIcon.Top=rtIcon.Bottom-rtIcon.Height;
133551
+
133552
+ var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:drawInfo.Index, Data:icon.Tooltip.Data };
133553
+ this.TooltipRect.push(tooltipData);
133554
+ }
133504
133555
  }
133505
133556
 
133506
- textLeft+=item.Width;
133507
- }
133557
+ y+=this.HeaderFontHeight;
133558
+ }
133508
133559
  }
133509
133560
 
133510
- this.DrawText=function(text, textAlign, x, yBottom, cellWidth, textSize)
133561
+ this.DrawHeader=function()
133511
133562
  {
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
- }
133563
+ if (!this.IsShowHeader) return;
133521
133564
 
133565
+ var left=this.RectClient.Left;
133566
+ var top=this.RectClient.Top;
133567
+ this.Canvas.font=this.HeaderFont;
133568
+
133569
+ var textLeft=left;
133522
133570
  this.Canvas.textAlign="left";
133523
133571
  this.Canvas.textBaseline="bottom";
133524
- this.Canvas.fillText(text,x,yBottom-this.HeaderMergin.Bottom);
133525
-
133526
- if (textSize)
133572
+ //固定列
133573
+ for(var i=0;i<this.FixedColumn && i<this.Column.length;++i)
133527
133574
  {
133528
- textSize.Right=x+textWidth;
133529
- textSize.Width=textWidth;
133530
- }
133531
- }
133575
+ var item=this.Column[i];
133576
+ var itemWidth=item.Width;
133577
+ //var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133532
133578
 
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;
133579
+ var rtCell={ Left:textLeft, Width:itemWidth, Top:top, Height:this.HeaderHeight };
133580
+ rtCell.Right=rtCell.Left+rtCell.Width;
133581
+ rtCell.Bottom=rtCell.Top+rtCell.Height;
133539
133582
 
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);
133583
+ this.DrawHeaderItem(item, rtCell, i);
133584
+ textLeft+=item.Width;
133585
+ }
133545
133586
 
133546
- if (icon.Tooltip)
133587
+ for(var i=this.FixedColumn+this.Data.XOffset;i<this.Column.length;++i)
133547
133588
  {
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;
133589
+ var item=this.Column[i];
133590
+ var itemWidth=item.Width;
133591
+ //var textWidth=itemWidth-this.HeaderMergin.Left-this.HeaderMergin.Right;
133551
133592
 
133552
- var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:index, Data:icon.Tooltip.Data };
133553
- this.TooltipRect.push(tooltipData);
133554
- }
133593
+ var rtCell={ Left:textLeft, Width:itemWidth, Top:top, Height:this.HeaderHeight };
133594
+ rtCell.Right=rtCell.Left+rtCell.Width;
133595
+ rtCell.Bottom=rtCell.Top+rtCell.Height;
133596
+
133597
+ this.DrawHeaderItem(item, rtCell, i);
133598
+ textLeft+=item.Width;
133599
+ }
133555
133600
  }
133556
133601
 
133557
133602
  //是否绘制排序背景图标
@@ -133566,57 +133611,6 @@ function ChartReport()
133566
133611
  return true;
133567
133612
  }
133568
133613
 
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
133614
  this.DrawBorder=function()
133621
133615
  {
133622
133616
  if (!this.IsDrawBorder) return;
@@ -134240,9 +134234,7 @@ function ChartReport()
134240
134234
  {
134241
134235
  this.FormatReserveNumber(column, stock, drawInfo);
134242
134236
  }
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))
134237
+ else if (this.IsReserveString(column.Type))
134246
134238
  {
134247
134239
  this.FormatReserveString(column, stock, drawInfo);
134248
134240
  }
@@ -134301,7 +134293,7 @@ function ChartReport()
134301
134293
 
134302
134294
  this.DrawItemBG(drawInfo);
134303
134295
 
134304
- if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID)
134296
+ if (column.Type==REPORT_COLUMN_ID.CUSTOM_STRING_TEXT_ID || this.IsReserveString(column.Type))
134305
134297
  this.DrawCustomText(drawInfo,column, x, top, textWidth);
134306
134298
  else
134307
134299
  this.DrawItemText(drawInfo.Text, drawInfo.TextColor, drawInfo.TextAlign, x, top, textWidth, drawInfo.BGColor);
@@ -134353,6 +134345,20 @@ function ChartReport()
134353
134345
  return ARARY_TYPE.includes(value);
134354
134346
  }
134355
134347
 
134348
+ this.IsReserveString=function(value)
134349
+ {
134350
+ var ARARY_TYPE=
134351
+ [
134352
+ REPORT_COLUMN_ID.RESERVE_STRING1_ID,REPORT_COLUMN_ID.RESERVE_STRING2_ID,REPORT_COLUMN_ID.RESERVE_STRING3_ID,REPORT_COLUMN_ID.RESERVE_STRING4_ID,
134353
+ REPORT_COLUMN_ID.RESERVE_STRING5_ID,REPORT_COLUMN_ID.RESERVE_STRING6_ID,REPORT_COLUMN_ID.RESERVE_STRING7_ID,REPORT_COLUMN_ID.RESERVE_STRING8_ID,
134354
+ REPORT_COLUMN_ID.RESERVE_STRING9_ID,REPORT_COLUMN_ID.RESERVE_STRING10_ID
134355
+ ];
134356
+
134357
+ return ARARY_TYPE.includes(value);
134358
+ }
134359
+
134360
+
134361
+
134356
134362
  this.DrawCustomText=function(drawInfo, column, left, top, cellWidth)
134357
134363
  {
134358
134364
  if (!drawInfo.Text) return;
@@ -137082,7 +137088,7 @@ function ChartVScrollbar()
137082
137088
  }
137083
137089
  }
137084
137090
 
137085
-
137091
+ /* 使用div替换掉了
137086
137092
  function ChartCellTooltip()
137087
137093
  {
137088
137094
  this.Canvas; //画布
@@ -137244,6 +137250,7 @@ function ChartCellTooltip()
137244
137250
  }
137245
137251
  }
137246
137252
  }
137253
+ */
137247
137254
  /*
137248
137255
  Copyright (c) 2018 jones
137249
137256
 
@@ -147206,11 +147213,26 @@ function JSFloatTooltip()
147206
147213
  {
147207
147214
  this.UpdateChartDrawSVGV2Tooltip(data);
147208
147215
  }
147216
+
147209
147217
  }
147210
147218
  else if (data.DataType==2) //更新实时行情数据
147211
147219
  {
147212
147220
  this.UpdateRealtimeHQTooltip(data);
147213
147221
  }
147222
+ else if (data.DataType==3) //报价列表
147223
+ {
147224
+ var tooltipData=data.Tooltip;
147225
+ if (!tooltipData) return;
147226
+
147227
+ if (tooltipData.Type==2) //报价列表表头图标提示信息
147228
+ {
147229
+ this.ReportHeaderIconTooltip(data);
147230
+ }
147231
+ else if (tooltipData.Type==1) //单元格截断内容
147232
+ {
147233
+ this.ReportCellTruncateTooltip(data);
147234
+ }
147235
+ }
147214
147236
  }
147215
147237
 
147216
147238
  this.UpdateRealtimeHQTooltip=function(data)
@@ -147450,6 +147472,34 @@ function JSFloatTooltip()
147450
147472
 
147451
147473
  this.ShowTooltip(data);
147452
147474
  }
147475
+
147476
+ //表头图标
147477
+ this.ReportHeaderIconTooltip=function(data)
147478
+ {
147479
+ var tooltipData=data.Tooltip;
147480
+ if (!tooltipData.Data || !IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText)) return;
147481
+
147482
+ this.AryText=tooltipData.Data.AryText;
147483
+ this.UpdateTableDOM();
147484
+
147485
+ this.ShowTooltip(data);
147486
+ }
147487
+
147488
+ //表格单元格截断内容
147489
+ this.ReportCellTruncateTooltip=function(data)
147490
+ {
147491
+ var tooltipData=data.Tooltip;
147492
+ if (!tooltipData.Data || !IFrameSplitOperator.IsNonEmptyArray(tooltipData.Data.AryText)) return;
147493
+
147494
+ var item=tooltipData.Data.AryText[0];
147495
+ if (!item.Text) return;
147496
+
147497
+ this.AryText=[ { Title:item.Text, IsMergeCell:true } ];
147498
+
147499
+ this.UpdateTableDOM();
147500
+
147501
+ this.ShowTooltip(data);
147502
+ }
147453
147503
 
147454
147504
  this.UpdateTableDOM=function()
147455
147505
  {
@@ -150146,7 +150196,7 @@ function HQChartScriptWorker()
150146
150196
 
150147
150197
 
150148
150198
 
150149
- var HQCHART_VERSION="1.1.14268";
150199
+ var HQCHART_VERSION="1.1.14273";
150150
150200
 
150151
150201
  function PrintHQChartVersion()
150152
150202
  {