hqchart 1.1.15018 → 1.1.15026

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.
@@ -10512,12 +10512,20 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10512
10512
  canvas.clearRect(0,0,this.UIElement.width,this.UIElement.height);
10513
10513
  }
10514
10514
 
10515
+ this.ClearCorssCursorCanvas=function()
10516
+ {
10517
+ if (!this.CorssCursorCanvas) return;
10518
+
10519
+ this.CorssCursorCanvas.clearRect(0,0,this.CorssCursorElement.width,this.CorssCursorElement.height);
10520
+ }
10521
+
10515
10522
  this.Draw=function()
10516
10523
  {
10517
10524
  if (this.ChartCorssCursor) this.ChartCorssCursor.Status=0;
10518
10525
  if (this.UIElement.width<=0 || this.UIElement.height<=0) return;
10519
10526
 
10520
10527
  this.StopDrawDynamicInfo();
10528
+ this.ClearCorssCursorCanvas();
10521
10529
 
10522
10530
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_BEFORE_DRAW);
10523
10531
  if (event && event.Callback)
@@ -10691,7 +10699,6 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
10691
10699
  if (this.CorssCursorCanvas) //独立的十字光标层
10692
10700
  {
10693
10701
  this.ChartCorssCursor.Canvas=this.CorssCursorCanvas;
10694
- this.ChartCorssCursor.Canvas.clearRect(0,0,this.CorssCursorElement.width,this.CorssCursorElement.height)
10695
10702
  bRestoreCanvas=true;
10696
10703
  }
10697
10704
 
@@ -11495,6 +11502,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
11495
11502
  {
11496
11503
  if (!this.ChartCorssCursor) return null;
11497
11504
  if (this.ChartCorssCursor.Status===0) return null;
11505
+ if (!this.ChartCorssCursor.IsShowCorss) return null;
11498
11506
 
11499
11507
  var kItem=this.ChartCorssCursor.StringFormatX.KItem;
11500
11508
  if (!kItem) return null;
@@ -58933,6 +58941,8 @@ IFrameSplitOperator.FormatDateTimeStringV2=function(datetime, format, languageID
58933
58941
 
58934
58942
  case "HH:MM:SS":
58935
58943
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}`;
58944
+ case "MM:SS":
58945
+ return `${IFrameSplitOperator.NumberToString(datetime.getMinutes())}:${IFrameSplitOperator.NumberToString(datetime.getSeconds())}`;
58936
58946
  case "HH:MM":
58937
58947
  return `${IFrameSplitOperator.NumberToString(datetime.getHours())}:${IFrameSplitOperator.NumberToString(datetime.getMinutes())}`;
58938
58948
  case "HH:MM:SS.fff":
@@ -62022,7 +62032,7 @@ function ChartCorssCursor()
62022
62032
 
62023
62033
  //内部使用
62024
62034
  this.Close=null; //收盘价格
62025
- this.Status=0; //当前状态 0=隐藏 1=显示
62035
+ this.Status=0; //当前状态 0=隐藏 1=显示底部 2=十字线
62026
62036
 
62027
62037
  this.ReloadResource=function(resource)
62028
62038
  {
@@ -81593,6 +81603,15 @@ function JSChartResource()
81593
81603
  ValueColor:"rgb(0,0,0)", //数值
81594
81604
  };
81595
81605
 
81606
+ this.SmallFloatTooltipV2=
81607
+ {
81608
+ BGColor:'rgb(250,250,250)', //背景色
81609
+ BorderColor:'rgb(20,20,20)', //边框颜色
81610
+
81611
+ TextColor:"rgb(0,0,0)", //数值名称
81612
+ ValueColor:"rgb(0,0,0)", //数值
81613
+ };
81614
+
81596
81615
  //区间统计
81597
81616
  this.DialogSelectRect=
81598
81617
  {
@@ -83378,8 +83397,20 @@ function JSChartResource()
83378
83397
 
83379
83398
  if (style.ChartDrawTVLongPosition) this.SetChartDrawTVLongPosition(style.ChartDrawTVLongPosition);
83380
83399
  if (style.KLineCountDownPaint) this.SetKLineCountDownPaint(style.KLineCountDownPaint);
83400
+
83401
+ if (style.SmallFloatTooltipV2) this.SetSmallFloatTooltipV2(style.SmallFloatTooltipV2);
83381
83402
  }
83382
83403
 
83404
+ this.SetSmallFloatTooltipV2=function(style)
83405
+ {
83406
+ var dest=this.SmallFloatTooltipV2;
83407
+
83408
+ if (style.BGColor) dest.BGColor=style.BGColor;
83409
+ if (style.BorderColor) dest.BorderColor=style.BorderColor;
83410
+
83411
+ if (style.TextColor) dest.TextColor=style.TextColor;
83412
+ if (style.ValueColor) dest.ValueColor=style.ValueColor;
83413
+ }
83383
83414
 
83384
83415
  this.SetKLineCountDownPaint=function(style)
83385
83416
  {
@@ -136521,6 +136552,15 @@ function GetBlackStyle()
136521
136552
  ValueColor:"rgb(210,210,210)", //数值
136522
136553
  },
136523
136554
 
136555
+ SmallFloatTooltipV2:
136556
+ {
136557
+ BGColor:'rgb(20,20,20)', //背景色
136558
+ BorderColor:'rgb(170,170,170)', //边框颜色
136559
+
136560
+ TextColor:"rgb(210,210,210)", //数值名称
136561
+ ValueColor:"rgb(210,210,210)", //数值
136562
+ },
136563
+
136524
136564
  DialogSelectRect:
136525
136565
  {
136526
136566
  BGColor:'rgb(20,20,20)', //背景色
@@ -162237,6 +162277,7 @@ function JSSmallFloatTooltip()
162237
162277
  this.DivDialog=null;
162238
162278
  this.DivContent=null;
162239
162279
  this.HQChart=null;
162280
+ this.ClassName="JSSmallFloatTooltip";
162240
162281
 
162241
162282
  this.Destroy=function()
162242
162283
  {
@@ -162324,23 +162365,242 @@ function JSSmallFloatTooltip()
162324
162365
  }
162325
162366
  }
162326
162367
 
162368
+
162369
+ function JSSmallFloatTooltipV2()
162370
+ {
162371
+ this.newMethod=JSSmallFloatTooltip; //派生
162372
+ this.newMethod();
162373
+ delete this.newMethod;
162374
+
162375
+ this.ClassName="JSSmallFloatTooltipV2";
162376
+
162377
+ this.AryData=[]; //输出文字信息
162378
+ this.AryText=[]; //表格tr
162379
+ this.MaxRowCount=25;
162380
+
162381
+ this.BGColor=g_JSChartResource.SmallFloatTooltipV2.BGColor;
162382
+ this.BorderColor=g_JSChartResource.SmallFloatTooltipV2.BorderColor;
162383
+
162384
+ this.TextColor=g_JSChartResource.SmallFloatTooltipV2.TextColor;
162385
+ this.ValueColor=g_JSChartResource.SmallFloatTooltipV2.ValueColor;
162386
+
162387
+ this.ValueAlign=
162388
+ {
162389
+ Left:"UMyChart_Small_Tooltip_V2_Text2_Span", //左对齐
162390
+ MarginLeft:'UMyChart_Small_Tooltip_V2_Text3_Span',
162391
+ Right:"UMyChart_Small_Tooltip_V2_Text_Span",
162392
+ }
162393
+
162394
+ this.TitleAlign=
162395
+ {
162396
+ Default:"UMyChart_Small_Tooltip_V2_Title_Span", //标题默认
162397
+ }
162398
+
162399
+ this.Destroy=function()
162400
+ {
162401
+ this.AryData=[];
162402
+ this.AryText=[];
162403
+ this.HQChart=null;
162404
+
162405
+ if (this.DivDialog)
162406
+ {
162407
+ document.body.removeChild(this.DivDialog);
162408
+ this.DivDialog=null;
162409
+ }
162410
+ }
162411
+
162412
+ this.Create=function()
162413
+ {
162414
+ var divDom=document.createElement("div");
162415
+ divDom.className='UMyChart_Small_Tooltip_V2_Div';
162416
+
162417
+ var table=document.createElement("table");
162418
+ table.className="UMyChart_Small_Tooltip_V2_Table";
162419
+ divDom.appendChild(table);
162420
+
162421
+ var tbody=document.createElement("tbody");
162422
+ tbody.className="UMyChart_Small_Tooltip_V2_Tbody";
162423
+ table.appendChild(tbody);
162424
+
162425
+ this.AryData=[];
162426
+
162427
+ for(var i=0;i<this.MaxRowCount;++i)
162428
+ {
162429
+ var rowItem={ Tr:null, TitleSpan:null, TextSpan:null, TitleTd:null, TextTd:null };
162430
+
162431
+ var trDom=document.createElement("tr");
162432
+ trDom.className='UMyChart_Small_Tooltip_V2_Group_Tr';
162433
+ tbody.appendChild(trDom);
162434
+ rowItem.Tr=trDom;
162435
+
162436
+ var tdDom=document.createElement("td");
162437
+ tdDom.className="UMyChart_Small_Tooltip_V2_Title_Td"; //标题
162438
+ trDom.appendChild(tdDom);
162439
+ rowItem.TitleTd=tdDom;
162440
+
162441
+ var spanDom=document.createElement("span");
162442
+ spanDom.className=this.TitleAlign.Default;
162443
+ spanDom.innerText='标题';
162444
+ tdDom.appendChild(spanDom);
162445
+ rowItem.TitleSpan=spanDom;
162446
+
162447
+ var tdDom=document.createElement("td");
162448
+ tdDom.className="UMyChart_Small_Tooltip_V2_Text_Td"; //数值
162449
+ trDom.appendChild(tdDom);
162450
+ rowItem.TextTd=tdDom;
162451
+
162452
+ var spanDom=document.createElement("span");
162453
+ spanDom.className='UMyChart_Small_Tooltip_V2_Text_Span';
162454
+ spanDom.innerText='数值';
162455
+ tdDom.appendChild(spanDom);
162456
+ rowItem.TextSpan=spanDom;
162457
+
162458
+ this.AryData.push(rowItem);
162459
+ }
162460
+
162461
+ document.body.appendChild(divDom);
162462
+
162463
+ this.DivDialog=divDom;
162464
+
162465
+ this.UpdateStyle();
162466
+ }
162467
+
162468
+ this.UpdateStyle=function()
162469
+ {
162470
+ if (!this.DivDialog) return;
162471
+
162472
+ if (this.BGColor) this.DivDialog.style['background-color']=this.BGColor;
162473
+ if (this.BorderColor) this.DivDialog.style['border-color']=this.BorderColor;
162474
+ }
162475
+
162476
+ this.Update=function(data)
162477
+ {
162478
+ if (!this.DivDialog) return;
162479
+
162480
+ this.AryText=[];
162481
+ for(var i=0;i<data.AryData.length;++i)
162482
+ {
162483
+ var item=data.AryData[i];
162484
+ if (item.Type==1) this.UpdateDefaultTooltip(item);
162485
+ //else if (item.Type==2) this.Updateddd();
162486
+ }
162487
+
162488
+ this.UpdateTableDOM();
162489
+ this.ShowTooltip(data);
162490
+ }
162491
+
162492
+ this.UpdateDefaultTooltip=function(data)
162493
+ {
162494
+ var text=data.Data.Text;
162495
+ var rowItem={ Text:"", HTMLTitle:text, Color:this.ValueColor, IsMergeCell:true };
162496
+ this.AryText.push(rowItem);
162497
+ }
162498
+
162499
+ this.UpdateTableDOM=function()
162500
+ {
162501
+ var index=0;
162502
+ for(index=0;index<this.AryText.length && index<this.MaxRowCount;++index)
162503
+ {
162504
+ var outItem=this.AryText[index];
162505
+ var item=this.AryData[index];
162506
+
162507
+ if (outItem.HTMLTitle) item.TitleSpan.innerHTML=outItem.HTMLTitle
162508
+ else item.TitleSpan.innerText=outItem.Title;
162509
+
162510
+ if (outItem.TitleColor) item.TitleSpan.style.color=outItem.TitleColor;
162511
+ else item.TitleSpan.style.color=this.TextColor;
162512
+
162513
+ if (outItem.HTMLText) item.TextSpan.innerHTML=outItem.HTMLText
162514
+ else item.TextSpan.innerText=outItem.Text;
162515
+
162516
+ item.TextSpan.style.color=outItem.Color;
162517
+ item.TextTd.style.color=outItem.Color;
162518
+
162519
+ if (outItem.ClassName)
162520
+ {
162521
+ item.TextSpan.className=outItem.ClassName;
162522
+ }
162523
+ else
162524
+ {
162525
+ if (item.TextSpan.className!=this.ValueAlign.Right) item.TextSpan.className=this.ValueAlign.Right;
162526
+ }
162527
+
162528
+ if (outItem.TitleClassName)
162529
+ {
162530
+ item.TitleSpan.className=outItem.TitleClassName;
162531
+ }
162532
+ else
162533
+ {
162534
+ if (item.TitleSpan.className!=this.TitleAlign.Default) item.TitleSpan.className=this.TitleAlign.Default;
162535
+ }
162536
+
162537
+ if (outItem.IsMergeCell) //合并单元格
162538
+ {
162539
+ item.TitleTd.colspan=2;
162540
+ item.TextTd.style.display="none";
162541
+ }
162542
+ else
162543
+ {
162544
+ if (item.TitleTd.colspan!=1) item.TitleTd.colspan=1;
162545
+ item.TextTd.style.display="";
162546
+ }
162547
+
162548
+ item.Tr.style.display="";
162549
+ if (item.Tr2) item.Tr2.style.display="none";
162550
+
162551
+ }
162552
+
162553
+ for( ; index<this.MaxRowCount; ++index)
162554
+ {
162555
+ var item=this.AryData[index];
162556
+ item.Tr.style.display="none";
162557
+ if (item.Tr2) item.Tr2.style.display="none";
162558
+ }
162559
+ }
162560
+ }
162561
+
162327
162562
  function JSSmallFloatTooltipGroup()
162328
162563
  {
162329
162564
  this.AryTooltip=[];
162330
162565
  this.HQChart=null;
162331
162566
  this.MaxCount=5;
162567
+ this.MaxRowCount=15;
162568
+ this.Style=0;
162332
162569
 
162333
162570
  this.Inital=function(hqchart, option)
162334
162571
  {
162335
162572
  this.HQChart=hqchart;
162573
+ if (option)
162574
+ {
162575
+ if (IFrameSplitOperator.IsNumber(option.Style)) this.Style=option.Style;
162576
+ if (IFrameSplitOperator.IsNumber(option.MaxRowCount)) this.Style=option.MaxRowCount;
162577
+ if (IFrameSplitOperator.IsNumber(option.MaxCount)) this.Style=option.MaxCount;
162578
+ }
162579
+ }
162580
+
162581
+ this.CreateTooltipDom=function()
162582
+ {
162583
+ var item=null;
162584
+ if (this.Style==1)
162585
+ {
162586
+ item=new JSSmallFloatTooltipV2();
162587
+ item.MaxRowCount=this.MaxRowCount;
162588
+ }
162589
+ else
162590
+ {
162591
+ item=new JSSmallFloatTooltip();
162592
+ }
162593
+
162594
+ item.HQChart=this.HQChart;
162595
+ return item;
162336
162596
  }
162337
162597
 
162338
162598
  this.Create=function()
162339
162599
  {
162340
162600
  for(var i=0;i<this.MaxCount;++i)
162341
162601
  {
162342
- var item=new JSSmallFloatTooltip();
162343
- item.HQChart=this.HQChart;
162602
+ var item=this.CreateTooltipDom();
162603
+
162344
162604
  item.Create();
162345
162605
  this.AryTooltip.push(item);
162346
162606
  }
@@ -162359,6 +162619,12 @@ function JSSmallFloatTooltipGroup()
162359
162619
 
162360
162620
  this.Update=function(data)
162361
162621
  {
162622
+ if (this.Style==1)
162623
+ {
162624
+ this.UpdateV2(data);
162625
+ return;
162626
+ }
162627
+
162362
162628
  var tooltipData=data.Tooltip;
162363
162629
  var pixelTatio = GetDevicePixelRatio();
162364
162630
  if (pixelTatio===0) pixelTatio=1;
@@ -162380,6 +162646,47 @@ function JSSmallFloatTooltipGroup()
162380
162646
  }
162381
162647
  }
162382
162648
 
162649
+ //Style==1 同价格合并输出
162650
+ this.UpdateV2=function(data)
162651
+ {
162652
+ var tooltipData=data.Tooltip;
162653
+ var pixelTatio = GetDevicePixelRatio();
162654
+ if (pixelTatio===0) pixelTatio=1;
162655
+
162656
+ var x=tooltipData.X/pixelTatio;
162657
+ var mapTooltip=new Map(); //根据Y轴 归类
162658
+ for(var i=0; i<tooltipData.AryData.length;++i)
162659
+ {
162660
+ var item=tooltipData.AryData[i];
162661
+ var key=parseInt(item.Y);
162662
+ if (mapTooltip.has(key))
162663
+ {
162664
+ var mapItem=mapTooltip.get(key);
162665
+ mapItem.AryData.push(item);
162666
+ }
162667
+ else
162668
+ {
162669
+ mapTooltip.set(key, { Key:key, Point:{ X:x, Y:item.Y/pixelTatio }, AryData:[ item ] });
162670
+ }
162671
+ }
162672
+
162673
+ var aryData=[];
162674
+ for(var mapItem of mapTooltip) aryData.push(mapItem[1]);
162675
+
162676
+ for(var i=0; i<aryData.length && i<this.AryTooltip.length; ++i)
162677
+ {
162678
+ var item=aryData[i];
162679
+ var tooltipItem=this.AryTooltip[i];
162680
+ tooltipItem.Update(item);
162681
+ }
162682
+
162683
+ for(var i=tooltipData.AryData.length; i<this.AryTooltip.length; ++i)
162684
+ {
162685
+ var item=this.AryTooltip[i];
162686
+ item.Hide();
162687
+ }
162688
+ }
162689
+
162383
162690
  this.Hide=function()
162384
162691
  {
162385
162692
  for(var i=0;i<this.AryTooltip.length;++i)
@@ -164680,7 +164987,7 @@ function HQChartScriptWorker()
164680
164987
 
164681
164988
 
164682
164989
 
164683
- var HQCHART_VERSION="1.1.15017";
164990
+ var HQCHART_VERSION="1.1.15025";
164684
164991
 
164685
164992
  function PrintHQChartVersion()
164686
164993
  {