hqchart 1.1.13732 → 1.1.13740

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.
@@ -6582,6 +6582,7 @@ var JSCHART_EVENT_ID=
6582
6582
  ON_CUSTOM_CORSSCURSOR_POSITION:155, //自定义十字光标X轴的输出的位置
6583
6583
 
6584
6584
  ON_CUSTOM_MINUTE_NIGHT_DAY_X_INDEX:156, //日盘夜盘的分界线
6585
+ ON_CUSTOM_MINUTE_BG:157, //自定义分时图背景颜色
6585
6586
  }
6586
6587
 
6587
6588
  var JSCHART_OPERATOR_ID=
@@ -7607,7 +7608,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7607
7608
  this.SelectChartDrawPicture=null;
7608
7609
  this.ClearChartDrawPicture(drawPictrueData.ChartDrawPicture);
7609
7610
  }
7610
- else if (drawPictrueData.ChartDrawPicture.EnableMove==true)
7611
+ else
7611
7612
  {
7612
7613
  this.UpDownDrag=null; //画图优先
7613
7614
  this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
@@ -7627,12 +7628,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7627
7628
  //this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
7628
7629
  this.SelectChartDrawPicture.DragInfo={Click:{X:e.clientX,Y:e.clientY}};
7629
7630
  }
7630
- else
7631
- {
7632
- this.CurrentChartDrawPicture=null;
7633
- this.SelectChartDrawPicture=null;
7634
- }
7635
-
7631
+
7636
7632
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
7637
7633
  if (event && event.Callback)
7638
7634
  {
@@ -7821,7 +7817,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7821
7817
  var sendData={X:x, Y:y, e:e, ChartDrag:this.CustomChartDrag, Drag:drag };
7822
7818
  this.TryDragMove_CustomChartDrag(sendData);
7823
7819
  }
7824
- else if (this.CurrentChartDrawPicture)
7820
+ else if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
7825
7821
  {
7826
7822
  var drawPicture=this.CurrentChartDrawPicture;
7827
7823
  if (drawPicture.Status==1 || drawPicture.Status==2)
@@ -8628,21 +8624,12 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8628
8624
  var pixelTatio = GetDevicePixelRatio(); //鼠标移动坐标是原始坐标 需要乘以放大倍速
8629
8625
  if (this.GetChartDrawPictureByPoint(drawPictrueData))
8630
8626
  {
8631
- if (drawPictrueData.ChartDrawPicture.EnableMove==true) //是否可以移动
8632
- {
8633
- drawPictrueData.ChartDrawPicture.Status=20;
8634
- drawPictrueData.ChartDrawPicture.ValueToPoint();
8635
- drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
8636
- drawPictrueData.ChartDrawPicture.IsSelected=true;
8637
- this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
8638
- this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
8639
-
8640
- }
8641
- else
8642
- {
8643
- this.CurrentChartDrawPicture=null;
8644
- this.SelectChartDrawPicture=null;
8645
- }
8627
+ drawPictrueData.ChartDrawPicture.Status=20;
8628
+ drawPictrueData.ChartDrawPicture.ValueToPoint();
8629
+ drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
8630
+ drawPictrueData.ChartDrawPicture.IsSelected=true;
8631
+ this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
8632
+ this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
8646
8633
 
8647
8634
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
8648
8635
  if (event && event.Callback)
@@ -8777,7 +8764,7 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
8777
8764
 
8778
8765
  //JSConsole.Chart.Log(`[JSChartContainer::OnTouchMove] moveAngle=${moveAngle} , moveUpDown=${moveUpDown}, moveSetp=${moveSetp}`);
8779
8766
 
8780
- if (this.CurrentChartDrawPicture)
8767
+ if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
8781
8768
  {
8782
8769
  var drawPicture=this.CurrentChartDrawPicture;
8783
8770
  if (drawPicture.Status==1 || drawPicture.Status==2)
@@ -16990,6 +16977,7 @@ function MinuteFrame()
16990
16977
  if (this.BeforeDrawXYCallback) this.BeforeDrawXYCallback(this);
16991
16978
 
16992
16979
  this.DrawNightDayBG(); //绘制夜盘 日盘背景
16980
+ this.DrawCustomBG(); //绘制自定义背景色
16993
16981
 
16994
16982
  this.DrawTitleBG();
16995
16983
  this.DrawHorizontal();
@@ -17434,6 +17422,60 @@ function MinuteFrame()
17434
17422
  }
17435
17423
  }
17436
17424
 
17425
+ this.DrawCustomBG=function()
17426
+ {
17427
+ if (!this.HQChart) return;
17428
+ if (this.IsHScreen) return;
17429
+
17430
+ var symbol=this.HQChart.Symbol;
17431
+ if (!symbol) return;
17432
+
17433
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CUSTOM_MINUTE_BG)
17434
+ if (!event || !event.Callback) return;
17435
+
17436
+ var aryDay=null;
17437
+ if (this.DayCount>1)
17438
+ {
17439
+ if (!IFrameSplitOperator.IsNonEmptyArray(this.HQChart.DayData)) return;
17440
+ aryDay=[];
17441
+ for(var i=this.HQChart.DayData.length-1;i>=0;--i)
17442
+ {
17443
+ aryDay.push({ Date:this.HQChart.DayData[i].Date, BGColor:null } );
17444
+ }
17445
+ }
17446
+ else if (this.DayCount==1)
17447
+ {
17448
+ if (!IFrameSplitOperator.IsPlusNumber(this.HQChart.DataStatus.LatestDate)) return;
17449
+ aryDay=[{ Date:this.HQChart.DataStatus.LatestDate, BGColor:null }];
17450
+ }
17451
+
17452
+ if (!IFrameSplitOperator.IsNonEmptyArray(aryDay)) return;
17453
+
17454
+ var sendData={ XPointCount:this.XPointCount, DayCount:this.DayCount, MinuteCount:this.MinuteCount , AryDay:aryDay, PreventDefault:false };
17455
+ event.Callback(event, sendData, this);
17456
+ if (sendData.PreventDefault) return;
17457
+
17458
+ var border=this.ChartBorder.GetBorder();
17459
+ for(var i=0;i<aryDay.length;++i)
17460
+ {
17461
+ var item=aryDay[i];
17462
+ if (!item.BGColor) continue;
17463
+
17464
+ var start=i*this.MinuteCount;
17465
+ var end=start+this.MinuteCount-1;
17466
+
17467
+ var xStart=this.GetXFromIndex(start);
17468
+ var xEnd=this.GetXFromIndex(end);
17469
+
17470
+ var rtDay={Left:xStart, Top:border.Top, Right:xEnd, Bottom:border.Bottom };
17471
+ rtDay.Width=rtDay.Right-rtDay.Left;
17472
+ rtDay.Height=rtDay.Bottom-rtDay.Top;
17473
+
17474
+ this.Canvas.fillStyle =item.BGColor;
17475
+ this.Canvas.fillRect(rtDay.Left, rtDay.Top, rtDay.Width, rtDay.Height);
17476
+ }
17477
+ }
17478
+
17437
17479
  this.DrawNightDayBG=function()
17438
17480
  {
17439
17481
  if (this.DayCount!=1) return;
@@ -83517,20 +83559,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83517
83559
  drawPictrueData.Y=(touches[0].clientY-uielement.getBoundingClientRect().top);
83518
83560
  if (this.GetChartDrawPictureByPoint(drawPictrueData))
83519
83561
  {
83520
- if (drawPictrueData.ChartDrawPicture.EnableMove==true)
83521
- {
83522
- drawPictrueData.ChartDrawPicture.Status=20;
83523
- drawPictrueData.ChartDrawPicture.ValueToPoint();
83524
- drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
83525
- drawPictrueData.ChartDrawPicture.IsSelected=true;
83526
- this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
83527
- this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
83528
- }
83529
- else
83530
- {
83531
- this.CurrentChartDrawPicture=null;
83532
- this.SelectChartDrawPicture=null;
83533
- }
83562
+
83563
+ drawPictrueData.ChartDrawPicture.Status=20;
83564
+ drawPictrueData.ChartDrawPicture.ValueToPoint();
83565
+ drawPictrueData.ChartDrawPicture.MovePointIndex=drawPictrueData.PointIndex;
83566
+ drawPictrueData.ChartDrawPicture.IsSelected=true;
83567
+ this.CurrentChartDrawPicture=drawPictrueData.ChartDrawPicture;
83568
+ this.SelectChartDrawPicture=drawPictrueData.ChartDrawPicture;
83534
83569
 
83535
83570
  let event=this.GetEventCallback(JSCHART_EVENT_ID.ON_CLICK_DRAWPICTURE); //选中画图工具事件
83536
83571
  if (event && event.Callback)
@@ -83619,7 +83654,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
83619
83654
  var moveUpDown=Math.abs(drag.LastMove.Y-touches[0].clientY);
83620
83655
  moveSetp=parseInt(moveSetp);
83621
83656
 
83622
- if (this.CurrentChartDrawPicture)
83657
+ if (this.CurrentChartDrawPicture && this.CurrentChartDrawPicture.EnableMove===true)
83623
83658
  {
83624
83659
  var drawPicture=this.CurrentChartDrawPicture;
83625
83660
  if (drawPicture.Status==1 || drawPicture.Status==2)
@@ -141205,6 +141240,8 @@ var JS_DRAWTOOL_MENU_ID=
141205
141240
  CMD_CHANGE_FONT_COLOR_ID:7, //切换字体颜色
141206
141241
  CMD_CHANGE_BG_COLOR_ID:8, //切换背景色
141207
141242
  CMD_CHANGE_BORDER_COLOR_ID:9, //边框颜色
141243
+
141244
+ CMD_LOCK_DRAW_CHART_ID:10, //上锁
141208
141245
  };
141209
141246
 
141210
141247
  function JSDialogDrawTool()
@@ -141801,6 +141838,7 @@ function JSDialogModifyDraw()
141801
141838
  this.BGColorButton=null;
141802
141839
  this.FontColorButton=null;
141803
141840
  this.BorderColorButton=null;
141841
+ this.LockButton=null;
141804
141842
 
141805
141843
  this.RandomLineColor=["rgb(255,69,0)", "rgb(173,255,47)", "rgb(238,154,73)", "rgb(255,105,180)"]; //线段颜色
141806
141844
  this.RandomBGColor=["rgba(210,251,209,0.8)", "rgb(217,217,253)", "rgb(255,208,204)", "rgb(252,249,206)"]; //背景颜色
@@ -141813,7 +141851,9 @@ function JSDialogModifyDraw()
141813
141851
  { Title:"修改字体颜色", ClassName: 'hqchart_drawtool icon-zitiyanse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_FONT_COLOR_ID }},
141814
141852
  { Title:"修改背景颜色", ClassName: 'hqchart_drawtool icon-zitibeijingse', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BG_COLOR_ID }},
141815
141853
  { Title:"修改边框颜色", ClassName: 'hqchart_drawtool icon-biankuang', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID }},
141816
- { Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }}
141854
+ { Title:"上锁", ClassName: 'hqchart_drawtool icon-lock', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID }},
141855
+ { Title:"删除图形", ClassName: 'hqchart_drawtool icon-recycle_bin', Type:2, Data:{ ID:JS_DRAWTOOL_MENU_ID.CMD_DELETE_DRAW_CHART_ID }},
141856
+
141817
141857
  ];
141818
141858
 
141819
141859
  this.Inital=function(hqchart)
@@ -141897,6 +141937,10 @@ function JSDialogModifyDraw()
141897
141937
  this.BorderColorButton=data;
141898
141938
  divItem.style.display="none";
141899
141939
  break;
141940
+ case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
141941
+ this.LockButton=data;
141942
+ this.LockButton.Span.style['color']="rgb(220,220,220)";
141943
+ break;
141900
141944
 
141901
141945
  }
141902
141946
 
@@ -141926,6 +141970,9 @@ function JSDialogModifyDraw()
141926
141970
  case JS_DRAWTOOL_MENU_ID.CMD_CHANGE_BORDER_COLOR_ID:
141927
141971
  this.ModifyBorderColor();
141928
141972
  break;
141973
+ case JS_DRAWTOOL_MENU_ID.CMD_LOCK_DRAW_CHART_ID:
141974
+ this.ModifyLockChart();
141975
+ break;
141929
141976
  }
141930
141977
  }
141931
141978
 
@@ -142050,6 +142097,14 @@ function JSDialogModifyDraw()
142050
142097
  this.HQChart.Draw();
142051
142098
  }
142052
142099
 
142100
+ this.ModifyLockChart=function()
142101
+ {
142102
+ if (!this.ChartPicture || !this.HQChart) return;
142103
+ this.ChartPicture.EnableMove=!this.ChartPicture.EnableMove;
142104
+
142105
+ if (this.LockButton) this.LockButton.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
142106
+ }
142107
+
142053
142108
  this.ModifyBorderColor=function()
142054
142109
  {
142055
142110
  if (!this.ChartPicture || !this.HQChart) return;
@@ -142146,7 +142201,12 @@ function JSDialogModifyDraw()
142146
142201
  item.Span.style['color']=borderColor;
142147
142202
  }
142148
142203
  }
142149
-
142204
+
142205
+ if (this.LockButton)
142206
+ {
142207
+ var item=this.LockButton;
142208
+ item.Span.style['color']=this.ChartPicture.EnableMove?"rgb(220,220,220)":"rgb(0,0,0)";
142209
+ }
142150
142210
  }
142151
142211
 
142152
142212
  this.OnMouseDownTitle=function(e)
@@ -142888,7 +142948,7 @@ function HQChartScriptWorker()
142888
142948
 
142889
142949
 
142890
142950
 
142891
- var HQCHART_VERSION="1.1.13731";
142951
+ var HQCHART_VERSION="1.1.13739";
142892
142952
 
142893
142953
  function PrintHQChartVersion()
142894
142954
  {