hqchart 1.1.14827 → 1.1.14831

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hqchart",
3
- "version": "1.1.14827",
3
+ "version": "1.1.14831",
4
4
  "description": "HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据对接",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -1293,6 +1293,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
1293
1293
  chart.CreateOverlayWindowsIndex(obj);
1294
1294
  }
1295
1295
  }
1296
+
1297
+ if (option.LatestPointFlash)
1298
+ {
1299
+ var item=option.LatestPointFlash;
1300
+ if (item.Enable)
1301
+ {
1302
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
1303
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
1304
+ chart.StartLatestPointFlash();
1305
+ }
1306
+ }
1296
1307
 
1297
1308
  return chart;
1298
1309
  }
@@ -2353,6 +2364,7 @@ JSChart.EnableCanvasWillReadFrequently=false; //https://html.spec.whatwg.org/m
2353
2364
  JSChart.CorssCursorCanvasKey="hqchart_corsscursor";
2354
2365
  JSChart.TooltipCursorCanvasKey="hqchart_tooltip";
2355
2366
  JSChart.RectDragCanvasKey="hqchart_drag_rect";
2367
+ JSChart.LatestPointFlashKey="hqchart_point_flash"; //最新数据点闪烁
2356
2368
 
2357
2369
  //初始化
2358
2370
  JSChart.Init=function(divElement,bScreen,bCacheCanvas)
@@ -3233,6 +3245,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3233
3245
  MapIndexChartCache:new Map(), //key 指标GUID
3234
3246
 
3235
3247
  TradeStatus:null, //当前交易状态 { Date, Time:数据最后更新的时间, Status: }
3248
+
3249
+ LatestPoint:null, //最新的点位置 { X:, Y: }
3236
3250
  };
3237
3251
 
3238
3252
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -3246,6 +3260,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3246
3260
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
3247
3261
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
3248
3262
 
3263
+ this.LatestPointFlashOption={ Timer:null, DelayTime:100 };
3264
+
3249
3265
  this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
3250
3266
 
3251
3267
  this.StockCache={ Data:null }; //扩展数据缓存数据
@@ -3315,13 +3331,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3315
3331
 
3316
3332
  if (bRegisterKeydown)
3317
3333
  {
3318
- this.AddEventListener(this.UIElement,"keydown", this.OnKeyDown, true);
3319
- this.AddEventListener(this.UIElement,"keyup", this.OnKeyUp, true);
3334
+ this.AddEventListener(this.UIElement,"keydown", (e)=>{ this.OnKeyDown(e); }, true);
3335
+ this.AddEventListener(this.UIElement,"keyup", (e)=>{ this.OnKeyUp(e); }, true);
3320
3336
  }
3321
3337
 
3322
3338
  if (bRegisterWheel)
3323
3339
  {
3324
- this.AddEventListener(this.UIElement,"wheel", this.OnWheel, true);
3340
+ this.AddEventListener(this.UIElement,"wheel", (e)=>{ this.OnWheel(e); }, true);
3325
3341
  }
3326
3342
 
3327
3343
  JSConsole.Chart.Log(`[JSChartContainer::AddDefaultEventListener] [keydown,keyup]=${bRegisterKeydown}, [wheel]=${bRegisterWheel}`);
@@ -3340,6 +3356,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3340
3356
  this.MapEventListenerCache.clear();
3341
3357
  }
3342
3358
 
3359
+ this.ClearGlobalOption=function()
3360
+ {
3361
+ if (!this.GlobalOption) return;
3362
+
3363
+ this.GlobalOption.LatestPoint=null;
3364
+ this.GlobalOption.TradeStatus=null;
3365
+ }
3366
+
3343
3367
  this.RestoreFocus=function(delay)
3344
3368
  {
3345
3369
  var value=1000;
@@ -3711,6 +3735,40 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3711
3735
  }
3712
3736
  }
3713
3737
 
3738
+ this.StartLatestPointFlash=function()
3739
+ {
3740
+ this.LatestPointFlashOption.Timer=setInterval(()=>
3741
+ {
3742
+ this.DrawLatestPoint();
3743
+ }, this.LatestPointFlashOption.DelayTime);
3744
+ }
3745
+
3746
+ this.StopLatestPointFlash=function()
3747
+ {
3748
+ if (this.LatestPointFlashOption.Timer)
3749
+ {
3750
+ clearInterval(this.LatestPointFlashOption.Timer);
3751
+ this.LatestPointFlashOption.Timer=null;
3752
+ }
3753
+ }
3754
+
3755
+ this.DrawLatestPoint=function()
3756
+ {
3757
+ var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");
3758
+ if (finder && finder.Chart)
3759
+ finder.Chart.Draw();
3760
+ }
3761
+
3762
+ this.SetLatestPointFlash=function(flashCount, option)
3763
+ {
3764
+ if (!IFrameSplitOperator.IsNumber(flashCount)) return;
3765
+ var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");
3766
+ if (!finder || !finder.Chart) return false;
3767
+
3768
+ var chart=finder.Chart;
3769
+ chart.FlashCount=flashCount;
3770
+ }
3771
+
3714
3772
  this.ChartDestroy=function() //销毁
3715
3773
  {
3716
3774
  this.IsDestroy=true;
@@ -3729,6 +3787,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
3729
3787
 
3730
3788
  this.DestroyPopMenu();
3731
3789
 
3790
+ this.StopLatestPointFlash();
3791
+
3732
3792
  document.oncontextmenu=null;
3733
3793
  this.RemoveAllEventListener();
3734
3794
  }
@@ -39822,6 +39882,12 @@ function ChartMinutePriceLine()
39822
39882
  this.DrawAfterClose(); //收盘集合竞价
39823
39883
  this.DrawMultiDayAfterClose();
39824
39884
 
39885
+ if (this.Identify=="Minute-Line" && this.ChartFrame.GlobalOption)
39886
+ {
39887
+ var globalOption=this.ChartFrame.GlobalOption;
39888
+ globalOption.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
39889
+ }
39890
+
39825
39891
  if (this.GetEventCallback)
39826
39892
  {
39827
39893
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_MINUTE_LAST_POINT);
@@ -47153,7 +47219,8 @@ function ExtendChartPaintFactory()
47153
47219
  ["RectDragPaint", { Create:function() { return new RectDragPaint(); } }],
47154
47220
  ["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
47155
47221
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
47156
- ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}]
47222
+ ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
47223
+ ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}]
47157
47224
  ]
47158
47225
  );
47159
47226
 
@@ -51779,6 +51846,101 @@ function MinuteBackgroundPaint()
51779
51846
  }
51780
51847
  }
51781
51848
 
51849
+ //最新数据点闪动
51850
+ function LatestPointFlashPaint()
51851
+ {
51852
+ this.newMethod=IExtendChartPainting; //派生
51853
+ this.newMethod();
51854
+ delete this.newMethod;
51855
+
51856
+ this.ClassName='LatestPointFlashPaint';
51857
+ this.HQChart;
51858
+
51859
+ this.Status=0;
51860
+ this.UpdateTime=new Date();
51861
+ this.FlashCount=0; //闪烁次数
51862
+ this.Frequency=500; //闪烁频率ms
51863
+
51864
+ this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;
51865
+ this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;
51866
+ this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
51867
+ this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
51868
+ this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
51869
+ this.FlashCanvas;
51870
+
51871
+ this.SetOption=function(option)
51872
+ {
51873
+ if (this.HQChart)
51874
+ {
51875
+ var extraElement=this.HQChart.GetExtraCanvas(JSChart.LatestPointFlashKey);
51876
+ if (extraElement && extraElement.Canvas) this.FlashCanvas=extraElement.Canvas; //绑定独立的画布
51877
+ }
51878
+
51879
+ if (option)
51880
+ {
51881
+ if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
51882
+ }
51883
+ }
51884
+
51885
+ this.ReloadResource=function(resource)
51886
+ {
51887
+ this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;
51888
+ this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;
51889
+ this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
51890
+ this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
51891
+ }
51892
+
51893
+ this.Draw=function()
51894
+ {
51895
+ if (!this.FlashCanvas) return;
51896
+ if (!this.HQChart) return;
51897
+ this.HQChart.ClearCanvas(this.FlashCanvas);
51898
+
51899
+ if (this.FlashCount<=0) return;
51900
+ if (this.IsStatusChange())
51901
+ {
51902
+ this.Status=(this.Status+1)%2;
51903
+ --this.FlashCount;
51904
+ }
51905
+
51906
+ if (this.Status==0) return;
51907
+ if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
51908
+ var point=this.HQChart.GlobalOption.LatestPoint;
51909
+ if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
51910
+
51911
+ this.FlashCanvas.fillStyle=this.BGColor;
51912
+ this.FlashCanvas.beginPath();
51913
+ this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
51914
+ this.FlashCanvas.fill();
51915
+ this.FlashCanvas.closePath();
51916
+
51917
+ //画实心圆
51918
+ this.FlashCanvas.fillStyle=this.PointColor;
51919
+ this.FlashCanvas.beginPath();
51920
+ this.FlashCanvas.arc(point.X,point.Y,this.PointRadius,0,360,false);
51921
+ this.FlashCanvas.fill();
51922
+ this.FlashCanvas.closePath();
51923
+ }
51924
+
51925
+ this.IsStatusChange=function()
51926
+ {
51927
+ if (!this.UpdateTime)
51928
+ {
51929
+ this.UpdateTime=new Date();
51930
+ return true;
51931
+ }
51932
+
51933
+
51934
+ var now=new Date();
51935
+ var diffValue=now.getTime()-this.UpdateTime.getTime();
51936
+ if (diffValue<=this.Frequency)
51937
+ return false;
51938
+
51939
+ this.UpdateTime=now;
51940
+ return true;
51941
+ }
51942
+ }
51943
+
51782
51944
  //拖拽效果图
51783
51945
  var JSCHART_DRAGCHART_TYPE_ID=
51784
51946
  {
@@ -74953,6 +75115,15 @@ function JSChartResource()
74953
75115
 
74954
75116
  CorssPoint:{ Center:{ Radius:5*GetDevicePixelRatio(), Color:"rgb(50,171,205)"}, Border:{ Color:'rgb(255,255,255)', Width:1*GetDevicePixelRatio() } }
74955
75117
  };
75118
+
75119
+ this.LatestPointFlash=
75120
+ {
75121
+ PointColor:"rgb(50,171,205)",
75122
+ PointRadius:3*GetDevicePixelRatio(),
75123
+
75124
+ BGColor:"rgba(50,171,205,0.7)",
75125
+ BGRadius:6*GetDevicePixelRatio(),
75126
+ }
74956
75127
 
74957
75128
  //指标锁
74958
75129
  this.IndexLock=
@@ -76497,6 +76668,17 @@ function JSChartResource()
76497
76668
  if (subItem.Color) subDest.Color=subItem.Color;
76498
76669
  }
76499
76670
  }
76671
+
76672
+ if (style.LatestPointFlash)
76673
+ {
76674
+ var item=style.LatestPointFlash;
76675
+ var dest=this.LatestPointFlash;
76676
+ if (item.PointColor) dest.PointColor=item.PointColor;
76677
+ if (IFrameSplitOperator.IsNumber(item.PointRadius)) dest.PointRadius=item.PointRadius;
76678
+
76679
+ if (item.BGColor) dest.BGColor=item.BGColor;
76680
+ if (IFrameSplitOperator.IsNumber(item.BGRadius)) dest.BGRadius=item.BGRadius;
76681
+ }
76500
76682
 
76501
76683
  if (style.KLine) this.KLine = style.KLine;
76502
76684
  if (style.VirtualKLine)
@@ -90665,6 +90847,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
90665
90847
  this.ChangeSymbol=function(symbol,option)
90666
90848
  {
90667
90849
  this.StopDisplayLatest();
90850
+ this.ClearGlobalOption();
90668
90851
  this.CancelAutoUpdate();
90669
90852
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeSymbol");
90670
90853
  this.Symbol=symbol;
@@ -90807,6 +90990,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
90807
90990
  if (count<0) return;
90808
90991
 
90809
90992
  this.StopDisplayLatest();
90993
+ this.ClearGlobalOption();
90810
90994
  this.CancelAutoUpdate();
90811
90995
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
90812
90996
  this.DayCount=count;
@@ -91754,6 +91938,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
91754
91938
  this.DataStatus.LatestDate=data.stock[0].date; //保存下最后一天的日期
91755
91939
  this.RecvBuySellData(data.stock[0].BuySellData);
91756
91940
  }
91941
+
91942
+ if (data.LatestPointFlash) //最新数据闪烁
91943
+ {
91944
+ var item=data.LatestPointFlash;
91945
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
91946
+ this.SetLatestPointFlash(item.FlashCount)
91947
+ }
91757
91948
 
91758
91949
  this.DataStatus.LatestDay=true;
91759
91950
 
@@ -5389,6 +5389,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
5389
5389
  chart.CreateOverlayWindowsIndex(obj);
5390
5390
  }
5391
5391
  }
5392
+
5393
+ if (option.LatestPointFlash)
5394
+ {
5395
+ var item=option.LatestPointFlash;
5396
+ if (item.Enable)
5397
+ {
5398
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
5399
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
5400
+ chart.StartLatestPointFlash();
5401
+ }
5402
+ }
5392
5403
 
5393
5404
  return chart;
5394
5405
  }
@@ -6449,6 +6460,7 @@ JSChart.EnableCanvasWillReadFrequently=false; //https://html.spec.whatwg.org/m
6449
6460
  JSChart.CorssCursorCanvasKey="hqchart_corsscursor";
6450
6461
  JSChart.TooltipCursorCanvasKey="hqchart_tooltip";
6451
6462
  JSChart.RectDragCanvasKey="hqchart_drag_rect";
6463
+ JSChart.LatestPointFlashKey="hqchart_point_flash"; //最新数据点闪烁
6452
6464
 
6453
6465
  //初始化
6454
6466
  JSChart.Init=function(divElement,bScreen,bCacheCanvas)
@@ -7329,6 +7341,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7329
7341
  MapIndexChartCache:new Map(), //key 指标GUID
7330
7342
 
7331
7343
  TradeStatus:null, //当前交易状态 { Date, Time:数据最后更新的时间, Status: }
7344
+
7345
+ LatestPoint:null, //最新的点位置 { X:, Y: }
7332
7346
  };
7333
7347
 
7334
7348
  this.VerticalDrag; //通过X轴左右拖动数据(手势才有)
@@ -7342,6 +7356,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7342
7356
  this.DisplayLatestOption={ Timer:null, Enable: false, DelayTime:60*1000*3, LastPoint:null };
7343
7357
  this.DrawDynamicInfoOption={ Timer:null, Enable:false , DelayTime:10 };
7344
7358
 
7359
+ this.LatestPointFlashOption={ Timer:null, DelayTime:100 };
7360
+
7345
7361
  this.CustomChartDrag; //自定义图形的拖拽操作 { Type:, Data: }
7346
7362
 
7347
7363
  this.StockCache={ Data:null }; //扩展数据缓存数据
@@ -7411,13 +7427,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7411
7427
 
7412
7428
  if (bRegisterKeydown)
7413
7429
  {
7414
- this.AddEventListener(this.UIElement,"keydown", this.OnKeyDown, true);
7415
- this.AddEventListener(this.UIElement,"keyup", this.OnKeyUp, true);
7430
+ this.AddEventListener(this.UIElement,"keydown", (e)=>{ this.OnKeyDown(e); }, true);
7431
+ this.AddEventListener(this.UIElement,"keyup", (e)=>{ this.OnKeyUp(e); }, true);
7416
7432
  }
7417
7433
 
7418
7434
  if (bRegisterWheel)
7419
7435
  {
7420
- this.AddEventListener(this.UIElement,"wheel", this.OnWheel, true);
7436
+ this.AddEventListener(this.UIElement,"wheel", (e)=>{ this.OnWheel(e); }, true);
7421
7437
  }
7422
7438
 
7423
7439
  JSConsole.Chart.Log(`[JSChartContainer::AddDefaultEventListener] [keydown,keyup]=${bRegisterKeydown}, [wheel]=${bRegisterWheel}`);
@@ -7436,6 +7452,14 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7436
7452
  this.MapEventListenerCache.clear();
7437
7453
  }
7438
7454
 
7455
+ this.ClearGlobalOption=function()
7456
+ {
7457
+ if (!this.GlobalOption) return;
7458
+
7459
+ this.GlobalOption.LatestPoint=null;
7460
+ this.GlobalOption.TradeStatus=null;
7461
+ }
7462
+
7439
7463
  this.RestoreFocus=function(delay)
7440
7464
  {
7441
7465
  var value=1000;
@@ -7807,6 +7831,40 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7807
7831
  }
7808
7832
  }
7809
7833
 
7834
+ this.StartLatestPointFlash=function()
7835
+ {
7836
+ this.LatestPointFlashOption.Timer=setInterval(()=>
7837
+ {
7838
+ this.DrawLatestPoint();
7839
+ }, this.LatestPointFlashOption.DelayTime);
7840
+ }
7841
+
7842
+ this.StopLatestPointFlash=function()
7843
+ {
7844
+ if (this.LatestPointFlashOption.Timer)
7845
+ {
7846
+ clearInterval(this.LatestPointFlashOption.Timer);
7847
+ this.LatestPointFlashOption.Timer=null;
7848
+ }
7849
+ }
7850
+
7851
+ this.DrawLatestPoint=function()
7852
+ {
7853
+ var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");
7854
+ if (finder && finder.Chart)
7855
+ finder.Chart.Draw();
7856
+ }
7857
+
7858
+ this.SetLatestPointFlash=function(flashCount, option)
7859
+ {
7860
+ if (!IFrameSplitOperator.IsNumber(flashCount)) return;
7861
+ var finder=this.GetExtendChartByClassName("LatestPointFlashPaint");
7862
+ if (!finder || !finder.Chart) return false;
7863
+
7864
+ var chart=finder.Chart;
7865
+ chart.FlashCount=flashCount;
7866
+ }
7867
+
7810
7868
  this.ChartDestroy=function() //销毁
7811
7869
  {
7812
7870
  this.IsDestroy=true;
@@ -7825,6 +7883,8 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
7825
7883
 
7826
7884
  this.DestroyPopMenu();
7827
7885
 
7886
+ this.StopLatestPointFlash();
7887
+
7828
7888
  document.oncontextmenu=null;
7829
7889
  this.RemoveAllEventListener();
7830
7890
  }
@@ -43918,6 +43978,12 @@ function ChartMinutePriceLine()
43918
43978
  this.DrawAfterClose(); //收盘集合竞价
43919
43979
  this.DrawMultiDayAfterClose();
43920
43980
 
43981
+ if (this.Identify=="Minute-Line" && this.ChartFrame.GlobalOption)
43982
+ {
43983
+ var globalOption=this.ChartFrame.GlobalOption;
43984
+ globalOption.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
43985
+ }
43986
+
43921
43987
  if (this.GetEventCallback)
43922
43988
  {
43923
43989
  var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_DRAW_MINUTE_LAST_POINT);
@@ -51249,7 +51315,8 @@ function ExtendChartPaintFactory()
51249
51315
  ["RectDragPaint", { Create:function() { return new RectDragPaint(); } }],
51250
51316
  ["DragMovePaint", { Create:function() { return new DragMovePaint(); } }],
51251
51317
  ["SessionBreaksPaint", { Create:function() { return new SessionBreaksPaint(); }}],
51252
- ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}]
51318
+ ["FrameButtomToolbarPaint", {Create:function() { return new FrameButtomToolbarPaint(); }}],
51319
+ ["LatestPointFlashPaint", {Create:function() { return new LatestPointFlashPaint(); }}]
51253
51320
  ]
51254
51321
  );
51255
51322
 
@@ -55875,6 +55942,101 @@ function MinuteBackgroundPaint()
55875
55942
  }
55876
55943
  }
55877
55944
 
55945
+ //最新数据点闪动
55946
+ function LatestPointFlashPaint()
55947
+ {
55948
+ this.newMethod=IExtendChartPainting; //派生
55949
+ this.newMethod();
55950
+ delete this.newMethod;
55951
+
55952
+ this.ClassName='LatestPointFlashPaint';
55953
+ this.HQChart;
55954
+
55955
+ this.Status=0;
55956
+ this.UpdateTime=new Date();
55957
+ this.FlashCount=0; //闪烁次数
55958
+ this.Frequency=500; //闪烁频率ms
55959
+
55960
+ this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;
55961
+ this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;
55962
+ this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
55963
+ this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
55964
+ this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
55965
+ this.FlashCanvas;
55966
+
55967
+ this.SetOption=function(option)
55968
+ {
55969
+ if (this.HQChart)
55970
+ {
55971
+ var extraElement=this.HQChart.GetExtraCanvas(JSChart.LatestPointFlashKey);
55972
+ if (extraElement && extraElement.Canvas) this.FlashCanvas=extraElement.Canvas; //绑定独立的画布
55973
+ }
55974
+
55975
+ if (option)
55976
+ {
55977
+ if (IFrameSplitOperator.IsNumber(option.Frequency)) this.Frequency=option.Frequency;
55978
+ }
55979
+ }
55980
+
55981
+ this.ReloadResource=function(resource)
55982
+ {
55983
+ this.PointColor=g_JSChartResource.LatestPointFlash.PointColor;
55984
+ this.PointRadius=g_JSChartResource.LatestPointFlash.PointRadius;
55985
+ this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
55986
+ this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
55987
+ }
55988
+
55989
+ this.Draw=function()
55990
+ {
55991
+ if (!this.FlashCanvas) return;
55992
+ if (!this.HQChart) return;
55993
+ this.HQChart.ClearCanvas(this.FlashCanvas);
55994
+
55995
+ if (this.FlashCount<=0) return;
55996
+ if (this.IsStatusChange())
55997
+ {
55998
+ this.Status=(this.Status+1)%2;
55999
+ --this.FlashCount;
56000
+ }
56001
+
56002
+ if (this.Status==0) return;
56003
+ if (!this.HQChart.GlobalOption || !this.HQChart.GlobalOption.LatestPoint) return;
56004
+ var point=this.HQChart.GlobalOption.LatestPoint;
56005
+ if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
56006
+
56007
+ this.FlashCanvas.fillStyle=this.BGColor;
56008
+ this.FlashCanvas.beginPath();
56009
+ this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
56010
+ this.FlashCanvas.fill();
56011
+ this.FlashCanvas.closePath();
56012
+
56013
+ //画实心圆
56014
+ this.FlashCanvas.fillStyle=this.PointColor;
56015
+ this.FlashCanvas.beginPath();
56016
+ this.FlashCanvas.arc(point.X,point.Y,this.PointRadius,0,360,false);
56017
+ this.FlashCanvas.fill();
56018
+ this.FlashCanvas.closePath();
56019
+ }
56020
+
56021
+ this.IsStatusChange=function()
56022
+ {
56023
+ if (!this.UpdateTime)
56024
+ {
56025
+ this.UpdateTime=new Date();
56026
+ return true;
56027
+ }
56028
+
56029
+
56030
+ var now=new Date();
56031
+ var diffValue=now.getTime()-this.UpdateTime.getTime();
56032
+ if (diffValue<=this.Frequency)
56033
+ return false;
56034
+
56035
+ this.UpdateTime=now;
56036
+ return true;
56037
+ }
56038
+ }
56039
+
55878
56040
  //拖拽效果图
55879
56041
  var JSCHART_DRAGCHART_TYPE_ID=
55880
56042
  {
@@ -79049,6 +79211,15 @@ function JSChartResource()
79049
79211
 
79050
79212
  CorssPoint:{ Center:{ Radius:5*GetDevicePixelRatio(), Color:"rgb(50,171,205)"}, Border:{ Color:'rgb(255,255,255)', Width:1*GetDevicePixelRatio() } }
79051
79213
  };
79214
+
79215
+ this.LatestPointFlash=
79216
+ {
79217
+ PointColor:"rgb(50,171,205)",
79218
+ PointRadius:3*GetDevicePixelRatio(),
79219
+
79220
+ BGColor:"rgba(50,171,205,0.7)",
79221
+ BGRadius:6*GetDevicePixelRatio(),
79222
+ }
79052
79223
 
79053
79224
  //指标锁
79054
79225
  this.IndexLock=
@@ -80593,6 +80764,17 @@ function JSChartResource()
80593
80764
  if (subItem.Color) subDest.Color=subItem.Color;
80594
80765
  }
80595
80766
  }
80767
+
80768
+ if (style.LatestPointFlash)
80769
+ {
80770
+ var item=style.LatestPointFlash;
80771
+ var dest=this.LatestPointFlash;
80772
+ if (item.PointColor) dest.PointColor=item.PointColor;
80773
+ if (IFrameSplitOperator.IsNumber(item.PointRadius)) dest.PointRadius=item.PointRadius;
80774
+
80775
+ if (item.BGColor) dest.BGColor=item.BGColor;
80776
+ if (IFrameSplitOperator.IsNumber(item.BGRadius)) dest.BGRadius=item.BGRadius;
80777
+ }
80596
80778
 
80597
80779
  if (style.KLine) this.KLine = style.KLine;
80598
80780
  if (style.VirtualKLine)
@@ -94761,6 +94943,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
94761
94943
  this.ChangeSymbol=function(symbol,option)
94762
94944
  {
94763
94945
  this.StopDisplayLatest();
94946
+ this.ClearGlobalOption();
94764
94947
  this.CancelAutoUpdate();
94765
94948
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeSymbol");
94766
94949
  this.Symbol=symbol;
@@ -94903,6 +95086,7 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
94903
95086
  if (count<0) return;
94904
95087
 
94905
95088
  this.StopDisplayLatest();
95089
+ this.ClearGlobalOption();
94906
95090
  this.CancelAutoUpdate();
94907
95091
  this.AutoUpdateEvent(false, "MinuteChartContainer::ChangeDayCount");
94908
95092
  this.DayCount=count;
@@ -95850,6 +96034,13 @@ function MinuteChartContainer(uielement,offscreenElement,cacheElement)
95850
96034
  this.DataStatus.LatestDate=data.stock[0].date; //保存下最后一天的日期
95851
96035
  this.RecvBuySellData(data.stock[0].BuySellData);
95852
96036
  }
96037
+
96038
+ if (data.LatestPointFlash) //最新数据闪烁
96039
+ {
96040
+ var item=data.LatestPointFlash;
96041
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
96042
+ this.SetLatestPointFlash(item.FlashCount)
96043
+ }
95853
96044
 
95854
96045
  this.DataStatus.LatestDay=true;
95855
96046
 
@@ -149583,7 +149774,7 @@ function ScrollBarBGChart()
149583
149774
 
149584
149775
 
149585
149776
 
149586
- var HQCHART_VERSION="1.1.14826";
149777
+ var HQCHART_VERSION="1.1.14830";
149587
149778
 
149588
149779
  function PrintHQChartVersion()
149589
149780
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14826";
8
+ var HQCHART_VERSION="1.1.14830";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {