hqchart 1.1.14978 → 1.1.14986

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.
@@ -11505,6 +11505,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11505
11505
  var mouseStatus=null; //鼠标状态
11506
11506
  var button=null; //当前鼠标所在按钮
11507
11507
  var frameID=this.Frame.PtInFrame(x,y);
11508
+ this.LastPoint.FrameID=frameID;
11508
11509
  if (IFrameSplitOperator.IsNumber(frameID) && frameID>=0) //在K线内部移动,调整K线索引
11509
11510
  this.CursorIndex=this.Frame.GetXData(x);
11510
11511
 
@@ -12400,40 +12401,45 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
12400
12401
 
12401
12402
  this.UpdatePointByCursorIndex=function(type) //type 1=根据十字光标更新 2=强制取消十字光标
12402
12403
  {
12403
- var pt={X:null, Y:null};
12404
- pt.X=this.Frame.GetXFromIndex(this.CursorIndex);
12405
- var index=Math.abs(this.CursorIndex-0.5);
12406
- if (this.IsKLineContainer()) index=this.CursorIndex;
12404
+ if (type==1) //根据十字光标更新
12405
+ {
12406
+ if (this.LastPoint.FrameID<0) return;
12407
12407
 
12408
- var data=this.Frame.Data;
12409
- if (data.DataOffset+index<data.Data.length)
12410
- {
12411
- var close=data.Data[data.DataOffset+index].Close;
12412
- pt.Y=this.Frame.GetYFromData(close);
12413
- }
12414
-
12415
- if (type==1 && this.ChartCorssCursor)
12416
- {
12417
- if (this.ChartCorssCursor.Status==1) //十字光标显示中, 不调整位置
12408
+ var pt={ X:null, Y:this.LastPoint.Y };
12409
+ pt.X=this.Frame.GetXFromIndex(this.CursorIndex); //X轴动态变的
12410
+ if (this.ChartCorssCursor)
12418
12411
  {
12412
+ if (this.ChartCorssCursor.Status==1)
12413
+ {
12419
12414
 
12415
+ }
12416
+ else
12417
+ {
12418
+ pt.Y=null;
12419
+ pt.X=null;
12420
+ }
12420
12421
  }
12421
- else
12422
- {
12423
- this.LastPoint.X=this.Frame.GetXFromIndex(this.CursorIndex);
12424
- var index=Math.abs(this.CursorIndex-0.5);
12425
- index=parseInt(index.toFixed(0));
12426
- if (this.IsKLineContainer()) index=this.CursorIndex;
12427
- this.LastPoint.Y=null;
12428
- }
12422
+ this.LastPoint.X=pt.X;
12423
+ this.LastPoint.Y=pt.Y;
12429
12424
  }
12430
- else if (type==2 && this.ChartCorssCursor) //取消鼠标位置,十字光标就不显示了
12425
+ else if (type==2)
12431
12426
  {
12432
12427
  this.LastPoint.Y=null;
12433
12428
  this.LastPoint.X=null;
12429
+ this.LastPoint.FrameID=-1;
12434
12430
  }
12435
12431
  else
12436
12432
  {
12433
+ var pt={ X:null, Y:null };
12434
+ pt.X=this.Frame.GetXFromIndex(this.CursorIndex);
12435
+ var index=this.CursorIndex;
12436
+ var data=this.GetKData();
12437
+ if (IFrameSplitOperator.IsGTEZero(index) && data.DataOffset+index<data.Data.length)
12438
+ {
12439
+ var close=data.Data[data.DataOffset+index].Close;
12440
+ pt.Y=this.Frame.GetYFromData(close);
12441
+ this.LastPoint.FrameID=0;
12442
+ }
12437
12443
  this.LastPoint.X=pt.X;
12438
12444
  this.LastPoint.Y=pt.Y;
12439
12445
  }
@@ -58429,6 +58435,12 @@ IFrameSplitOperator.FormatDateTimeStringV2=function(datetime, format, languageID
58429
58435
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
58430
58436
  case "HH:MM:SS.fff":
58431
58437
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}.${IFrameSplitOperator.MillisecondToString(datetime.getMilliseconds())}`;
58438
+
58439
+ case "YYYY-MM-DD HH:MM":
58440
+ return `${datetime.getFullYear()}-${IFrameSplitOperator.NumberToString(datetime.getMonth()+1)}-${IFrameSplitOperator.NumberToString(datetime.getDate())} ${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
58441
+ case "MM-DD HH:MM":
58442
+ return `${IFrameSplitOperator.NumberToString(datetime.getMonth()+1)}-${IFrameSplitOperator.NumberToString(datetime.getDate())} ${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
58443
+
58432
58444
  default:
58433
58445
  return null;
58434
58446
  }
@@ -58484,6 +58496,15 @@ IFrameSplitOperator.IsPlusNumber=function(value)
58484
58496
  return value>0;
58485
58497
  }
58486
58498
 
58499
+ //>=0
58500
+ IFrameSplitOperator.IsGTEZero=function(value)
58501
+ {
58502
+ if (value==null) return false;
58503
+ if (isNaN(value)) return false;
58504
+
58505
+ return value>=0;
58506
+ }
58507
+
58487
58508
  //是否是整形
58488
58509
  IFrameSplitOperator.IsInteger=function(x)
58489
58510
  {
@@ -95668,7 +95689,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
95668
95689
 
95669
95690
  var index=this.CursorIndex;
95670
95691
  index=parseInt(index.toFixed(0));
95671
- var data=this.Frame.SourceData;
95692
+ var data=this.GetKData();
95672
95693
  if (data.DataOffset+index>=data.Data.length)
95673
95694
  {
95674
95695
  return;
@@ -95679,6 +95700,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
95679
95700
  else close=item.Close
95680
95701
 
95681
95702
  this.LastPoint.Y=this.Frame.GetYFromData(close);
95703
+ this.LastPoint.FrameID=0;
95682
95704
  }
95683
95705
 
95684
95706
 
@@ -140497,6 +140519,16 @@ function JSReportChartContainer(uielement)
140497
140519
  if (IFrameSplitOperator.IsNumber(item[108])) stock.ReserveNumber8=item[108];
140498
140520
  if (IFrameSplitOperator.IsNumber(item[109])) stock.ReserveNumber9=item[109];
140499
140521
  if (IFrameSplitOperator.IsNumber(item[110])) stock.ReserveNumber10=item[110];
140522
+ if (IFrameSplitOperator.IsNumber(item[111])) stock.ReserveNumber11=item[111];
140523
+ if (IFrameSplitOperator.IsNumber(item[112])) stock.ReserveNumber12=item[112];
140524
+ if (IFrameSplitOperator.IsNumber(item[113])) stock.ReserveNumber13=item[113];
140525
+ if (IFrameSplitOperator.IsNumber(item[114])) stock.ReserveNumber14=item[114];
140526
+ if (IFrameSplitOperator.IsNumber(item[115])) stock.ReserveNumber15=item[115];
140527
+ if (IFrameSplitOperator.IsNumber(item[116])) stock.ReserveNumber16=item[116];
140528
+ if (IFrameSplitOperator.IsNumber(item[117])) stock.ReserveNumber17=item[117];
140529
+ if (IFrameSplitOperator.IsNumber(item[118])) stock.ReserveNumber18=item[118];
140530
+ if (IFrameSplitOperator.IsNumber(item[119])) stock.ReserveNumber19=item[119];
140531
+ if (IFrameSplitOperator.IsNumber(item[120])) stock.ReserveNumber20=item[120];
140500
140532
 
140501
140533
  //10个字符型 201-299
140502
140534
  if (IFrameSplitOperator.IsString(item[201]) || IFrameSplitOperator.IsObject(item[201])) stock.ReserveString1=item[201];
@@ -142891,6 +142923,16 @@ function JSReportChartContainer(uielement)
142891
142923
  case REPORT_COLUMN_ID.RESERVE_NUMBER8_ID:
142892
142924
  case REPORT_COLUMN_ID.RESERVE_NUMBER9_ID:
142893
142925
  case REPORT_COLUMN_ID.RESERVE_NUMBER10_ID:
142926
+ case REPORT_COLUMN_ID.RESERVE_NUMBER11_ID:
142927
+ case REPORT_COLUMN_ID.RESERVE_NUMBER12_ID:
142928
+ case REPORT_COLUMN_ID.RESERVE_NUMBER13_ID:
142929
+ case REPORT_COLUMN_ID.RESERVE_NUMBER14_ID:
142930
+ case REPORT_COLUMN_ID.RESERVE_NUMBER15_ID:
142931
+ case REPORT_COLUMN_ID.RESERVE_NUMBER16_ID:
142932
+ case REPORT_COLUMN_ID.RESERVE_NUMBER17_ID:
142933
+ case REPORT_COLUMN_ID.RESERVE_NUMBER18_ID:
142934
+ case REPORT_COLUMN_ID.RESERVE_NUMBER19_ID:
142935
+ case REPORT_COLUMN_ID.RESERVE_NUMBER20_ID:
142894
142936
 
142895
142937
  return this.LocalNumberSort(left, right, column, sortType);
142896
142938
 
@@ -143553,7 +143595,7 @@ var REPORT_COLUMN_ID=
143553
143595
  MULTI_LINE_CONTAINER:108, //多行组合输出
143554
143596
 
143555
143597
 
143556
- //预留数值类型 10
143598
+ //预留数值类型 20
143557
143599
  RESERVE_NUMBER1_ID:201, //ReserveNumber1:
143558
143600
  RESERVE_NUMBER2_ID:202,
143559
143601
  RESERVE_NUMBER3_ID:203,
@@ -143564,6 +143606,16 @@ var REPORT_COLUMN_ID=
143564
143606
  RESERVE_NUMBER8_ID:208,
143565
143607
  RESERVE_NUMBER9_ID:209,
143566
143608
  RESERVE_NUMBER10_ID:210,
143609
+ RESERVE_NUMBER11_ID:211,
143610
+ RESERVE_NUMBER12_ID:212,
143611
+ RESERVE_NUMBER13_ID:213,
143612
+ RESERVE_NUMBER14_ID:214,
143613
+ RESERVE_NUMBER15_ID:215,
143614
+ RESERVE_NUMBER16_ID:216,
143615
+ RESERVE_NUMBER17_ID:217,
143616
+ RESERVE_NUMBER18_ID:218,
143617
+ RESERVE_NUMBER19_ID:219,
143618
+ RESERVE_NUMBER20_ID:220,
143567
143619
 
143568
143620
 
143569
143621
  //预留字符串类型 10个 301-399
@@ -143676,6 +143728,16 @@ var MAP_COLUMN_FIELD=new Map([
143676
143728
  [REPORT_COLUMN_ID.RESERVE_NUMBER8_ID,"ReserveNumber8"],
143677
143729
  [REPORT_COLUMN_ID.RESERVE_NUMBER9_ID,"ReserveNumber9"],
143678
143730
  [REPORT_COLUMN_ID.RESERVE_NUMBER10_ID,"ReserveNumber10"],
143731
+ [REPORT_COLUMN_ID.RESERVE_NUMBER11_ID,"ReserveNumber11"],
143732
+ [REPORT_COLUMN_ID.RESERVE_NUMBER12_ID,"ReserveNumber12"],
143733
+ [REPORT_COLUMN_ID.RESERVE_NUMBER13_ID,"ReserveNumber13"],
143734
+ [REPORT_COLUMN_ID.RESERVE_NUMBER14_ID,"ReserveNumber14"],
143735
+ [REPORT_COLUMN_ID.RESERVE_NUMBER15_ID,"ReserveNumber15"],
143736
+ [REPORT_COLUMN_ID.RESERVE_NUMBER16_ID,"ReserveNumber16"],
143737
+ [REPORT_COLUMN_ID.RESERVE_NUMBER17_ID,"ReserveNumber17"],
143738
+ [REPORT_COLUMN_ID.RESERVE_NUMBER18_ID,"ReserveNumber18"],
143739
+ [REPORT_COLUMN_ID.RESERVE_NUMBER19_ID,"ReserveNumber19"],
143740
+ [REPORT_COLUMN_ID.RESERVE_NUMBER20_ID,"ReserveNumber20"],
143679
143741
 
143680
143742
  [REPORT_COLUMN_ID.RESERVE_STRING1_ID,"ReserveString1"],
143681
143743
  [REPORT_COLUMN_ID.RESERVE_STRING2_ID,"ReserveString2"],
@@ -143920,6 +143982,9 @@ function ChartReport()
143920
143982
 
143921
143983
  this.LastMouseStatus;
143922
143984
 
143985
+ //绘图过程中的缓存数据 绘制完清空的
143986
+ this.TempCache=null; //
143987
+
143923
143988
  this.ReloadResource=function(resource)
143924
143989
  {
143925
143990
  this.DevicePixelRatio=GetDevicePixelRatio()
@@ -144121,6 +144186,7 @@ function ChartReport()
144121
144186
  else if (this.IsReserveDateTime(item.Type))
144122
144187
  {
144123
144188
  if (item.DateTimeFormat) colItem.DateTimeFormat=item.DateTimeFormat; //日期格式化
144189
+ if (item.SubDateTimeFormat) colItem.SubDateTimeFormat=item.SubDateTimeFormat;
144124
144190
  }
144125
144191
  else if (item.Type==REPORT_COLUMN_ID.CUSTOM_PROGRESS_ID)
144126
144192
  {
@@ -144331,6 +144397,16 @@ function ChartReport()
144331
144397
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER8_ID, Title:"数值8", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144332
144398
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER9_ID, Title:"数值9", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144333
144399
  { Type:REPORT_COLUMN_ID.RESERVE_NUMBER10_ID, Title:"数值10", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144400
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER11_ID, Title:"数值11", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144401
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER12_ID, Title:"数值12", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144402
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER13_ID, Title:"数值13", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144403
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER14_ID, Title:"数值14", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144404
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER15_ID, Title:"数值15", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144405
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER16_ID, Title:"数值16", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144406
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER17_ID, Title:"数值17", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144407
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER18_ID, Title:"数值18", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144408
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER19_ID, Title:"数值19", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144409
+ { Type:REPORT_COLUMN_ID.RESERVE_NUMBER20_ID, Title:"数值20", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"9999.99", FloatPrecision:2 },
144334
144410
 
144335
144411
  { Type:REPORT_COLUMN_ID.RESERVE_STRING1_ID, Title:"文字1", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
144336
144412
  { Type:REPORT_COLUMN_ID.RESERVE_STRING2_ID, Title:"文字2", TextAlign:"right", TextColor:g_JSChartResource.Report.FieldColor.Text, MaxText:"擎擎擎擎擎擎" },
@@ -144398,6 +144474,11 @@ function ChartReport()
144398
144474
  this.Canvas.clip();
144399
144475
  }
144400
144476
 
144477
+ this.CreateTempCache=function()
144478
+ {
144479
+ this.TempCache={ MapReserveDateTime:new Map() }; //MapReserveDateTime:key=colindex, Value:{ PreDate }
144480
+ }
144481
+
144401
144482
  this.Draw=function(lastMouseStatus)
144402
144483
  {
144403
144484
  this.ShowSymbol=[];
@@ -144406,6 +144487,7 @@ function ChartReport()
144406
144487
  this.AryFullSelectedRow=[];
144407
144488
  this.DevicePixelRatio=GetDevicePixelRatio()
144408
144489
  this.LastMouseStatus=lastMouseStatus;
144490
+ this.CreateTempCache();
144409
144491
 
144410
144492
  if (this.GlobalOption) this.GlobalOption.FlashBGCount=0;
144411
144493
 
@@ -144444,6 +144526,7 @@ function ChartReport()
144444
144526
  this.LastMouseStatus=null;
144445
144527
  this.SizeChange=false;
144446
144528
  this.AryFullSelectedRow=[];
144529
+ this.TempCache=null;
144447
144530
  }
144448
144531
 
144449
144532
  this.DrawDragHeaderBG=function()
@@ -145858,7 +145941,11 @@ function ChartReport()
145858
145941
  [
145859
145942
  REPORT_COLUMN_ID.RESERVE_NUMBER1_ID,REPORT_COLUMN_ID.RESERVE_NUMBER2_ID,REPORT_COLUMN_ID.RESERVE_NUMBER3_ID,
145860
145943
  REPORT_COLUMN_ID.RESERVE_NUMBER4_ID,REPORT_COLUMN_ID.RESERVE_NUMBER5_ID,REPORT_COLUMN_ID.RESERVE_NUMBER6_ID,REPORT_COLUMN_ID.RESERVE_NUMBER7_ID,
145861
- REPORT_COLUMN_ID.RESERVE_NUMBER8_ID,REPORT_COLUMN_ID.RESERVE_NUMBER9_ID,REPORT_COLUMN_ID.RESERVE_NUMBER10_ID
145944
+ REPORT_COLUMN_ID.RESERVE_NUMBER8_ID,REPORT_COLUMN_ID.RESERVE_NUMBER9_ID,REPORT_COLUMN_ID.RESERVE_NUMBER10_ID,
145945
+
145946
+ REPORT_COLUMN_ID.RESERVE_NUMBER11_ID,REPORT_COLUMN_ID.RESERVE_NUMBER12_ID,REPORT_COLUMN_ID.RESERVE_NUMBER13_ID,
145947
+ REPORT_COLUMN_ID.RESERVE_NUMBER14_ID,REPORT_COLUMN_ID.RESERVE_NUMBER15_ID,REPORT_COLUMN_ID.RESERVE_NUMBER16_ID,REPORT_COLUMN_ID.RESERVE_NUMBER17_ID,
145948
+ REPORT_COLUMN_ID.RESERVE_NUMBER18_ID,REPORT_COLUMN_ID.RESERVE_NUMBER19_ID,REPORT_COLUMN_ID.RESERVE_NUMBER20_ID
145862
145949
  ];
145863
145950
 
145864
145951
  return ARARY_TYPE.includes(value);
@@ -146332,6 +146419,36 @@ function ChartReport()
146332
146419
  }
146333
146420
  }
146334
146421
 
146422
+ this.GetReserveDateTimePreItem=function(colIndex)
146423
+ {
146424
+ if (!this.CreateTempCache) return null;
146425
+ if (!this.TempCache.MapReserveDateTime) return null;
146426
+
146427
+ var mapData=this.TempCache.MapReserveDateTime;
146428
+ if (!mapData.has(colIndex)) return null;
146429
+
146430
+ return mapData.get(colIndex);
146431
+ }
146432
+
146433
+ this.SetReserveDateTimePreItem=function(colIndex,data)
146434
+ {
146435
+ if (!this.CreateTempCache) return false;
146436
+ if (!this.TempCache.MapReserveDateTime) return false;
146437
+
146438
+ var mapData=this.TempCache.MapReserveDateTime;
146439
+ if (mapData.has(colIndex))
146440
+ {
146441
+ var item=mapData.get(colIndex);
146442
+ item.PreItem.Date=data.Date;
146443
+ }
146444
+ else
146445
+ {
146446
+ mapData.set(colIndex, { PreItem:{ Date:data.Date } })
146447
+ }
146448
+
146449
+ return true;
146450
+ }
146451
+
146335
146452
  this.FormatReserveDateTime=function(column, data, drawInfo)
146336
146453
  {
146337
146454
  if (column.DefaultText) drawInfo.Text=column.DefaultText;
@@ -146342,7 +146459,24 @@ function ChartReport()
146342
146459
  var item=data[fieldName];
146343
146460
  if (!IFrameSplitOperator.IsObject(item)) return;
146344
146461
 
146345
- if (item.DateTime) drawInfo.Text=IFrameSplitOperator.FormatDateTimeStringV2(item.DateTime,column.DateTimeFormat);
146462
+ var cacheItem=this.GetReserveDateTimePreItem(drawInfo.ColumnIndex);
146463
+ if (item.DateTime)
146464
+ {
146465
+ var date=item.DateTime.getFullYear()*10000+(item.DateTime.getMonth()+1)*100+item.DateTime.getDate();
146466
+ var format=column.DateTimeFormat;
146467
+ if (cacheItem && cacheItem.PreItem && date==cacheItem.PreItem.Date)
146468
+ {
146469
+ if (column.SubDateTimeFormat) format=column.SubDateTimeFormat
146470
+ }
146471
+ else
146472
+ {
146473
+
146474
+ this.SetReserveDateTimePreItem(drawInfo.ColumnIndex, {Date:date});
146475
+ }
146476
+
146477
+ drawInfo.Text=IFrameSplitOperator.FormatDateTimeStringV2(item.DateTime, format);
146478
+ }
146479
+
146346
146480
  if (item.TextColor) drawInfo.TextColor=item.TextColor;
146347
146481
  if (item.BGColor) drawInfo.BGColor=item.BGColor;
146348
146482
  }
@@ -163545,7 +163679,7 @@ function HQChartScriptWorker()
163545
163679
 
163546
163680
 
163547
163681
 
163548
- var HQCHART_VERSION="1.1.14977";
163682
+ var HQCHART_VERSION="1.1.14985";
163549
163683
 
163550
163684
  function PrintHQChartVersion()
163551
163685
  {