hqchart 1.1.13531 → 1.1.13541

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.
@@ -4049,15 +4049,14 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4049
4049
  this.OnSize=function(option)
4050
4050
  {
4051
4051
  //画布大小通过div获取 如果有style里的大小 使用style里的
4052
+ var height=this.DivElement.offsetHeight;
4053
+ var width=this.DivElement.offsetWidth;
4052
4054
  if (this.DivElement.style.height && this.DivElement.style.width)
4053
4055
  {
4054
- var height=parseInt(this.DivElement.style.height.replace("px",""));
4055
- var width=parseInt(this.DivElement.style.width.replace("px",""));
4056
- }
4057
- else
4058
- {
4059
- var height=this.DivElement.offsetHeight;
4060
- var width=this.DivElement.offsetWidth;
4056
+ if (this.DivElement.style.height.includes("px"))
4057
+ height=parseInt(this.DivElement.style.height.replace("px",""));
4058
+ if (this.DivElement.style.width.includes("px"))
4059
+ width=parseInt(this.DivElement.style.width.replace("px",""));
4061
4060
  }
4062
4061
 
4063
4062
  if (this.ToolElement)
@@ -71123,9 +71122,9 @@ function JSChartResource()
71123
71122
  Mergin:{ Left:5, Right:5, Top:4, Bottom:2 },
71124
71123
 
71125
71124
  TabTitleColor:'rgb(60,60,60)',
71126
- TabSelectedTitleColor:'rgb(0,0,0)',
71127
- TabSelectedBGColor:"rgb(252,252,252)",
71128
- TabMoveOnTitleColor:"rgb(0,0,0)",
71125
+ TabSelectedTitleColor:'rgb(255,255,255)',
71126
+ TabSelectedBGColor:"rgb(234,85,4)",
71127
+ TabMoveOnTitleColor:"rgb(234,85,4)",
71129
71128
  TabBGColor:"rgb(220,220,220)"
71130
71129
  },
71131
71130
 
@@ -123543,7 +123542,7 @@ function GetBlackStyle()
123543
123542
 
123544
123543
  TabTitleColor:'rgb(153,153,153)',
123545
123544
  TabSelectedTitleColor:'rgb(255,255,255)',
123546
- TabSelectedBGColor:"rgb(13,12,15)",
123545
+ TabSelectedBGColor:"rgb(234,85,4)",
123547
123546
  TabMoveOnTitleColor:"rgb(255,255,255)",
123548
123547
  TabBGColor:"rgb(28,28,31)"
123549
123548
  },
@@ -125239,9 +125238,18 @@ function JSReportChart(divElement)
125239
125238
  this.OnSize=function()
125240
125239
  {
125241
125240
  //画布大小通过div获取
125242
- var height=parseInt(this.DivElement.style.height.replace("px",""));
125241
+ var height=this.DivElement.offsetHeight;
125242
+ var width=this.DivElement.offsetWidth;
125243
+ if (this.DivElement.style.height && this.DivElement.style.width)
125244
+ {
125245
+ if (this.DivElement.style.height.includes("px"))
125246
+ height=parseInt(this.DivElement.style.height.replace("px",""));
125247
+ if (this.DivElement.style.width.includes("px"))
125248
+ width=parseInt(this.DivElement.style.width.replace("px",""));
125249
+ }
125250
+
125243
125251
  this.CanvasElement.height=height;
125244
- this.CanvasElement.width=parseInt(this.DivElement.style.width.replace("px",""));
125252
+ this.CanvasElement.width=width;
125245
125253
  this.CanvasElement.style.width=this.CanvasElement.width+'px';
125246
125254
  this.CanvasElement.style.height=this.CanvasElement.height+'px';
125247
125255
 
@@ -125281,6 +125289,8 @@ function JSReportChart(divElement)
125281
125289
  this.JSChartContainer=chart;
125282
125290
  this.DivElement.JSChart=this; //div中保存一份
125283
125291
 
125292
+ if (option.EnableResize==true) this.CreateResizeListener();
125293
+
125284
125294
  if (option.EnablePopMenuV2===true) chart.InitalPopMenu();
125285
125295
  if (option.EnableTooltip)
125286
125296
  {
@@ -125372,6 +125382,19 @@ function JSReportChart(divElement)
125372
125382
  chart.Frame.ChartBorder.Bottom*=pixelTatio;
125373
125383
  }
125374
125384
 
125385
+ this.CreateResizeListener=function()
125386
+ {
125387
+ this.ResizeListener = new ResizeObserver((entries)=>{ this.OnDivResize(entries); });
125388
+ this.ResizeListener.observe(this.DivElement);
125389
+ }
125390
+
125391
+ this.OnDivResize=function(entries)
125392
+ {
125393
+ JSConsole.Chart.Log("[JSReportChart::OnDivResize] entries=", entries);
125394
+
125395
+ this.OnSize();
125396
+ }
125397
+
125375
125398
  /////////////////////////////////////////////////////////////////////////////
125376
125399
  //对外接口
125377
125400
 
@@ -126916,7 +126939,7 @@ function JSReportChartContainer(uielement)
126916
126939
  var tooltipData=report.GetTooltipData(x,y); //单元格提示信息
126917
126940
  if (tooltipData)
126918
126941
  {
126919
- this.LastMouseStatus.TooltipStatus={ X:x, Y:y, Data:tooltipData };
126942
+ this.LastMouseStatus.TooltipStatus={ X:e.clientX, Y:e.clientY, Data:tooltipData };
126920
126943
  bDrawTooltip=true;
126921
126944
  }
126922
126945
  }
@@ -128128,6 +128151,7 @@ function JSReportChartContainer(uielement)
128128
128151
  {
128129
128152
  this.ExecuteMenuCommand(tabData.Tab.CommandID, [tabData.Tab.ID]);
128130
128153
  this.SetSelectedTab(tabData.Index);
128154
+ redraw=true;
128131
128155
  }
128132
128156
  }
128133
128157
 
@@ -128226,6 +128250,7 @@ function JSReportChartContainer(uielement)
128226
128250
 
128227
128251
  case REPORT_COLUMN_ID.VOL_IN_ID:
128228
128252
  case REPORT_COLUMN_ID.VOL_OUT_ID:
128253
+ case REPORT_COLUMN_ID.DATE_ID:
128229
128254
 
128230
128255
  return this.LocalNumberSort(left, right, column, sortType);
128231
128256
  case REPORT_COLUMN_ID.CUSTOM_NUMBER_TEXT_ID: //自定义数值字段
@@ -128400,6 +128425,31 @@ function JSReportChartContainer(uielement)
128400
128425
  }
128401
128426
  }
128402
128427
 
128428
+ this.LoacCustomStringSort=function(left, right, column, sortType)
128429
+ {
128430
+ var leftValue="", rightValue="";
128431
+ if (sortType==2) rightValue=leftValue="啊啊啊啊啊";
128432
+
128433
+ var value=this.GetStockExtendData(left, column);
128434
+ if (IFrameSplitOperator.IsString(value)) leftValue=value;
128435
+
128436
+ var value=this.GetStockExtendData(right, column);
128437
+ if (IFrameSplitOperator.IsString(value)) rightValue=value;
128438
+
128439
+ if (sortType==1)
128440
+ {
128441
+ if (rightValue<leftValue) return -1;
128442
+ else if (rightValue<leftValue) return 1;
128443
+ else return 0;
128444
+ }
128445
+ else
128446
+ {
128447
+ if (leftValue<rightValue) return -1;
128448
+ else if (leftValue>rightValue) return 1;
128449
+ else return 0;
128450
+ }
128451
+ }
128452
+
128403
128453
  this.RequestStockSortData=function(column, filedid, sortType)
128404
128454
  {
128405
128455
  var chart=this.ChartPaint[0];
@@ -128706,6 +128756,8 @@ var MAP_COLUMN_FIELD=new Map([
128706
128756
  [REPORT_COLUMN_ID.VOL_OUT_ID,"VolOut"],
128707
128757
 
128708
128758
  [REPORT_COLUMN_ID.NAME_EX_ID, "NameEx"],
128759
+
128760
+ [REPORT_COLUMN_ID.DATE_ID, "Date"],
128709
128761
  ]);
128710
128762
 
128711
128763
  function ChartReport()
@@ -128838,7 +128890,11 @@ function ChartReport()
128838
128890
  this.BottomToolbarHeight=0; //底部工具条高度
128839
128891
  this.IsShowAllColumn=false; //是否已显示所有列
128840
128892
 
128841
- this.Column= //{ Type:列id, Title:标题, TextAlign:文字对齐方式, MaxText:文字最大宽度 , TextColor:文字颜色, Sort:0=不支持排序 1=本地排序 0=远程排序 }
128893
+ //{
128894
+ // Type:列id, Title:标题, TextAlign:文字对齐方式, MaxText:文字最大宽度 , TextColor:文字颜色, Sort:0=不支持排序 1=本地排序 0=远程排序,
128895
+ // Icon:{ Family:"iconfont", Size:12, Symbol:"", Margin: { Left:, Bottom }}
128896
+ //}
128897
+ this.Column=
128842
128898
  [
128843
128899
  { Type:REPORT_COLUMN_ID.INDEX_ID, Title:"序号", TextAlign:"center", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Index, MaxText:"8888"},
128844
128900
  { Type:REPORT_COLUMN_ID.SYMBOL_ID, Title:"代码", TextAlign:"left", Width:null, TextColor:g_JSChartResource.Report.FieldColor.Symbol, MaxText:"888888"},
@@ -128953,6 +129009,7 @@ function ChartReport()
128953
129009
  if (IFrameSplitOperator.IsBool(item.EnableDragWidth)) colItem.EnableDragWidth=item.EnableDragWidth;
128954
129010
  if (IFrameSplitOperator.IsBool(item.IsDrawCallback)) colItem.IsDrawCallback=item.IsDrawCallback;
128955
129011
  else colItem.IsDrawCallback=false;
129012
+ if (item.Icon) colItem.Icon=item.Icon;
128956
129013
 
128957
129014
  if (item.Sort==1 || item.Sort==2) //1本地排序 2=远程排序
128958
129015
  {
@@ -129258,6 +129315,17 @@ function ChartReport()
129258
129315
 
129259
129316
  item.Width=itemWidth+4+this.ItemMergin.Left+this.ItemMergin.Right;
129260
129317
  }
129318
+
129319
+ if (item.Icon && item.Icon.Symbol)
129320
+ {
129321
+ item.Width+=item.Icon.Size;
129322
+ if (item.Icon.Margin)
129323
+ {
129324
+ var margin=item.Icon.Margin;
129325
+ if (IFrameSplitOperator.IsNumber(margin.Left)) item.Width+=margin.Left;
129326
+ if (IFrameSplitOperator.IsNumber(margin.Right)) item.Width+=margin.Right;
129327
+ }
129328
+ }
129261
129329
  }
129262
129330
 
129263
129331
  this.Canvas.font=this.HeaderFont;
@@ -129317,16 +129385,36 @@ function ChartReport()
129317
129385
  this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
129318
129386
  }
129319
129387
 
129388
+ var iconWidth=0;
129389
+ if (item.Icon && item.Icon.Symbol) //图标
129390
+ {
129391
+ var iconWidth=item.Icon.Size;
129392
+ if (item.Icon.Margin)
129393
+ {
129394
+ var margin=item.Icon.Margin;
129395
+ if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
129396
+ if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
129397
+ }
129398
+ }
129399
+ textWidth-=iconWidth;
129400
+
129320
129401
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
129321
129402
  else this.Canvas.fillStyle=this.HeaderColor;
129322
129403
 
129404
+ var textSize={ }
129323
129405
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
129324
129406
  {
129325
- this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
129407
+ this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort, textSize);
129326
129408
  }
129327
129409
  else
129328
129410
  {
129329
- this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
129411
+ this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
129412
+ }
129413
+
129414
+ if (iconWidth>0)
129415
+ {
129416
+ this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
129417
+ this.Canvas.font=this.HeaderFont;
129330
129418
  }
129331
129419
 
129332
129420
  this.Canvas.fillStyle=this.HeaderColor;
@@ -129349,44 +129437,91 @@ function ChartReport()
129349
129437
  this.DrawItemBG({ Rect:rtBG, BGColor:item.HeaderBGColor });
129350
129438
  }
129351
129439
 
129440
+ var iconWidth=0;
129441
+ if (item.Icon && item.Icon.Symbol) //图标
129442
+ {
129443
+ var iconWidth=item.Icon.Size;
129444
+ if (item.Icon.Margin)
129445
+ {
129446
+ var margin=item.Icon.Margin;
129447
+ if (IFrameSplitOperator.IsNumber(margin.Left)) iconWidth+=margin.Left;
129448
+ if (IFrameSplitOperator.IsNumber(margin.Right)) iconWidth+=margin.Right;
129449
+ }
129450
+ }
129451
+
129452
+ textWidth-=iconWidth;
129453
+
129352
129454
  if (item.HeaderColor) this.Canvas.fillStyle=item.HeaderColor;
129353
129455
  else this.Canvas.fillStyle=this.HeaderColor;
129354
129456
 
129457
+ var textSize={ }
129355
129458
  if (this.SortInfo && this.SortInfo.Field==i && this.SortInfo.Sort>0)
129356
129459
  {
129357
- this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort);
129460
+ this.DrawSortHeader(item.Title,item.TextAlign,x,y,textWidth,this.SortInfo.Sort,textSize);
129358
129461
  }
129359
129462
  else
129360
129463
  {
129361
- this.DrawText(item.Title,item.TextAlign,x,y,textWidth);
129464
+ this.DrawText(item.Title,item.TextAlign,x,y,textWidth,textSize);
129465
+ }
129466
+
129467
+ if (iconWidth>0)
129468
+ {
129469
+ this.DrawHeaderIcon(item.Icon, textSize.Right, y, i, item);
129470
+ this.Canvas.font=this.HeaderFont;
129362
129471
  }
129363
129472
 
129364
129473
  textLeft+=item.Width;
129365
129474
  }
129366
129475
  }
129367
129476
 
129368
- this.DrawText=function(text, textAlign, x, y, textWidth)
129477
+ this.DrawText=function(text, textAlign, x, y, cellWidth, textSize)
129369
129478
  {
129479
+ var textWidth=this.Canvas.measureText(text).width;
129370
129480
  if (textAlign=='center')
129371
129481
  {
129372
- x=x+textWidth/2;
129373
- this.Canvas.textAlign="center";
129482
+ x=x+(cellWidth-textWidth)/2;
129374
129483
  }
129375
129484
  else if (textAlign=='right')
129376
129485
  {
129377
- x=x+textWidth;
129378
- this.Canvas.textAlign="right";
129379
- }
129380
- else
129381
- {
129382
- this.Canvas.textAlign="left";
129486
+ x=x+cellWidth-textWidth;
129383
129487
  }
129384
129488
 
129489
+ this.Canvas.textAlign="left";
129385
129490
  this.Canvas.textBaseline="middle";
129386
129491
  this.Canvas.fillText(text,x,y);
129492
+
129493
+ if (textSize)
129494
+ {
129495
+ textSize.Right=x+textWidth;
129496
+ textSize.Width=textWidth;
129497
+ }
129498
+ }
129499
+
129500
+ this.DrawHeaderIcon=function(icon, x, y, index, column)
129501
+ {
129502
+ var iconFont=`${icon.Size}px ${icon.Family}`;
129503
+ this.Canvas.font=iconFont;
129504
+ this.Canvas.textAlign="left";
129505
+ if (icon.Color) this.Canvas.fillStyle=icon.Color;
129506
+
129507
+ var xIcon=x;
129508
+ var yIcon=y;
129509
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Left)) xIcon+=icon.Margin.Left;
129510
+ if (icon.Margin && IFrameSplitOperator.IsNumber(icon.Margin.Bottom)) yIcon-=icon.Margin.Bottom;
129511
+ this.Canvas.fillText(icon.Symbol, xIcon, yIcon);
129512
+
129513
+ if (icon.Tooltip)
129514
+ {
129515
+ var rtIcon={ Left:xIcon, Top:yIcon-icon.Size/2, Width:icon.Size, Height:icon.Size };
129516
+ rtIcon.Right=rtIcon.Left+rtIcon.Width;
129517
+ rtIcon.Bottom=rtIcon.Top+rtIcon.Height;
129518
+
129519
+ var tooltipData={ Rect:rtIcon, Type:2, Column:column, Index:index, Data:icon.Tooltip.Data };
129520
+ this.TooltipRect.push(tooltipData);
129521
+ }
129387
129522
  }
129388
129523
 
129389
- this.DrawSortHeader=function(text, textAlign, x, y, width, sortType)
129524
+ this.DrawSortHeader=function(text, textAlign, x, y, width, sortType,textSize)
129390
129525
  {
129391
129526
  var sortText=sortType==1?"↓":"↑";
129392
129527
  var sortTextWidth=this.Canvas.measureText(sortText).width;
@@ -129402,15 +129537,17 @@ function ChartReport()
129402
129537
  {
129403
129538
  x=(x+width)-sortTextWidth-textWidth;
129404
129539
  }
129405
- else
129406
- {
129407
-
129408
- }
129409
129540
 
129410
129541
  this.Canvas.fillText(text,x,y);
129411
129542
  this.Canvas.fillStyle=this.SortColor;
129412
129543
  this.Canvas.fillText(sortText,x+textWidth,y);
129413
129544
  this.Canvas.fillStyle=this.HeaderColor;
129545
+
129546
+ if (textSize)
129547
+ {
129548
+ textSize.Right=x+textWidth+sortTextWidth;
129549
+ textSize.Width=textWidth+sortTextWidth;
129550
+ }
129414
129551
  }
129415
129552
 
129416
129553
 
@@ -132019,7 +132156,7 @@ function ChartCellTooltip()
132019
132156
  if (item.TitleColor) this.Canvas.fillStyle=item.TitleColor;
132020
132157
  else this.Canvas.fillStyle=this.TextColor;
132021
132158
  this.Canvas.fillText(item.Title,xText,yText,itemSize.TitleWidth);
132022
- xText+=itemSize.titleWidth;
132159
+ xText+=itemSize.TitleWidth;
132023
132160
  if (IFrameSplitOperator.IsNumber(item.Space)) xText+=item.Space;
132024
132161
  }
132025
132162
 
@@ -135111,7 +135248,7 @@ function ScrollBarBGChart()
135111
135248
 
135112
135249
 
135113
135250
 
135114
- var HQCHART_VERSION="1.1.13530";
135251
+ var HQCHART_VERSION="1.1.13540";
135115
135252
 
135116
135253
  function PrintHQChartVersion()
135117
135254
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.13530";
8
+ var HQCHART_VERSION="1.1.13540";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {