hqchart 1.1.14855 → 1.1.14860

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.
@@ -56264,6 +56264,10 @@ HQData.RequestRealtimeData=function(data, callback)
56264
56264
 
56265
56265
  var hqchartData={ code:0, stock:aryStock };
56266
56266
 
56267
+ var time=new Date();
56268
+ //if (time.getSeconds()%3==1)
56269
+ hqchartData.LatestPointFlash={ FlashCount:2 };
56270
+
56267
56271
 
56268
56272
  callback(hqchartData);
56269
56273
 
@@ -57811,6 +57815,8 @@ HQData.Report_APIIndex=function(data, callback)
57811
57815
  HQData.APIIndex_DRAWSVG(data, callback);
57812
57816
  else if (request.Data.indexname=="API_BASELINE_BAR")
57813
57817
  HQData.APIIndex_BASELINE_BAR(data, callback);
57818
+ else if (request.Data.indexname=="API_VERTLINE")
57819
+ HQData.APIIndex_VERTLINE(data, callback);
57814
57820
  }
57815
57821
 
57816
57822
 
@@ -59181,7 +59187,7 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
59181
59187
  {
59182
59188
  var kItem=kData.Data[i];
59183
59189
 
59184
- var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35)*-1 };
59190
+ var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35) };
59185
59191
  pointData.Draw.DrawData.push(item);
59186
59192
  }
59187
59193
 
@@ -59197,6 +59203,44 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
59197
59203
  }
59198
59204
 
59199
59205
 
59206
+ HQData.APIIndex_VERTLINE=function(data, callback)
59207
+ {
59208
+ data.PreventDefault=true;
59209
+ var hqchart=data.HQChart;
59210
+ var kData=hqchart.GetKData();
59211
+
59212
+ var lineData=
59213
+ {
59214
+ name:"VERTLINE", type:1,
59215
+ Draw:
59216
+ {
59217
+ Name:"VERTLINE",
59218
+ DrawType:"VERTLINE",
59219
+ DrawData:{ Data:[] },
59220
+ },
59221
+ };
59222
+
59223
+ for(var i=0;i<kData.Data.length;++i)
59224
+ {
59225
+ var kItem=kData.Data[i];
59226
+
59227
+ var value=0;
59228
+ if (i%5==1) value=1;
59229
+ lineData.Draw.DrawData.Data[i]=value;
59230
+ }
59231
+
59232
+ var apiData=
59233
+ {
59234
+ code:0,
59235
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
59236
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ lineData] },
59237
+ };
59238
+
59239
+ console.log('[HQData.APIIndex_VERTLINE] apiData ', apiData);
59240
+ callback(apiData);
59241
+ }
59242
+
59243
+
59200
59244
 
59201
59245
 
59202
59246
  /*暴露外部用的方法*/
@@ -6955,6 +6955,8 @@ var JSCHART_EVENT_ID=
6955
6955
  ON_CLICK_CHART_CELL:171, //点击图形单元
6956
6956
 
6957
6957
  GET_DEFAULT_INDEX_PARAM:172, //获取指标默认参数
6958
+
6959
+ ON_RELOAD_RESOURCE:173,
6958
6960
  }
6959
6961
 
6960
6962
  var JSCHART_OPERATOR_ID=
@@ -13647,6 +13649,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13647
13649
  this.ReloadChartCorssCursor(option,option.Resource);
13648
13650
  this.ReloadChartDrawPictureResource(option.Resource);
13649
13651
 
13652
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_RELOAD_RESOURCE); //配色重新加载
13653
+ if (event && event.Callback)
13654
+ {
13655
+ var sendData={ Option:option };
13656
+ event.Callback(event, sendData, this);
13657
+ }
13658
+
13650
13659
  if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
13651
13660
  else if (option.Draw==true || option.Redraw==true) this.Draw(); //是否立即重绘
13652
13661
 
@@ -79271,6 +79280,21 @@ function JSChartResource()
79271
79280
  {
79272
79281
  LineColor:"rgba(255,165,0,0.6)",
79273
79282
  LineWidth:2,
79283
+ },
79284
+
79285
+ Title:
79286
+ {
79287
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
79288
+ },
79289
+
79290
+ CorssCursor:
79291
+ {
79292
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`
79293
+ },
79294
+
79295
+ Frame:
79296
+ {
79297
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, //刻度坐标
79274
79298
  }
79275
79299
  }
79276
79300
 
@@ -80953,6 +80977,18 @@ function JSChartResource()
80953
80977
  if (item.Mark.LineColor) dest.Mark.LineColor=item.Mark.LineColor;
80954
80978
  if (IFrameSplitOperator.IsNumber(item.Mark.LineWidth)) dest.Mark.LineWidth=item.Mark.LineWidth;
80955
80979
  }
80980
+ if (item.Title)
80981
+ {
80982
+ if (item.Title.Font) dest.Title.Font=item.Title.Font;
80983
+ }
80984
+ if (item.CorssCursor)
80985
+ {
80986
+ if (item.CorssCursor.Font) dest.CorssCursor.Font=item.CorssCursor.Font;
80987
+ }
80988
+ if (item.Frame)
80989
+ {
80990
+ if (item.Frame.Font) dest.Frame.Font=item.Frame.Font;
80991
+ }
80956
80992
  }
80957
80993
 
80958
80994
  if (style.PopKLineChart)
@@ -127378,7 +127414,7 @@ var SCRIPT_CHART_NAME=
127378
127414
  CLIP_COLOR_STICK:"CLIP_COLOR_STICK", //上下柱子 裁剪
127379
127415
 
127380
127416
  DRAW_KLINE:"DRAWKLINE",
127381
- BASELINE_BAR:"BASELINE_BAR"
127417
+ BASELINE_BAR:"BASELINE_BAR",
127382
127418
  }
127383
127419
 
127384
127420
 
@@ -132337,6 +132373,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
132337
132373
 
132338
132374
  result.push(outVarItem);
132339
132375
  }
132376
+ else if (draw.DrawType=="VERTLINE") //竖线
132377
+ {
132378
+ drawItem.Text=draw.Text;
132379
+ drawItem.Name=draw.Name;
132380
+ drawItem.DrawType=draw.DrawType;
132381
+ drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
132382
+ outVarItem.Draw=drawItem;
132383
+
132384
+ result.push(outVarItem);
132385
+ }
132340
132386
  else if (draw.DrawType=='STICKLINE') //柱子
132341
132387
  {
132342
132388
  drawItem.Name=draw.Name;
@@ -133938,7 +133984,7 @@ function GetBlackStyle()
133938
133984
  MultiDayBorderPen:"rgba(236,236,236,0.5)",
133939
133985
  FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
133940
133986
  FrameSplitTextColor: "rgb(220,220,220)", //刻度文字颜色
133941
- FrameSplitTextFont: 12*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
133987
+ FrameSplitTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
133942
133988
  FrameTitleBGColor: "rgb(0,0,0)", //标题栏背景色
133943
133989
  OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
133944
133990
 
@@ -133974,7 +134020,7 @@ function GetBlackStyle()
133974
134020
 
133975
134021
  CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
133976
134022
  CorssCursorTextColor: "rgb(255,255,255)",
133977
- CorssCursorTextFont: 12*GetDevicePixelRatio() +"px 微软雅黑",
134023
+ CorssCursorTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑",
133978
134024
  CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
133979
134025
  CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
133980
134026
 
@@ -155198,6 +155244,10 @@ function JSPopMinuteChart()
155198
155244
  this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
155199
155245
  this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
155200
155246
 
155247
+ this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
155248
+ this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
155249
+ this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
155250
+
155201
155251
  this.Minute=
155202
155252
  {
155203
155253
  Option:JSPopMinuteChart.GetMinuteOption(),
@@ -155279,13 +155329,31 @@ function JSPopMinuteChart()
155279
155329
  callback:(event, data, obj)=>{ this.OnKeyDown(event, data, obj); }
155280
155330
  };
155281
155331
 
155332
+ var reloadResourceEvent=
155333
+ {
155334
+ event:JSCHART_EVENT_ID.ON_RELOAD_RESOURCE,
155335
+ callback:(event, data, obj)=>{ this.LoadChartResource(obj); }
155336
+ }
155337
+
155338
+ var splitXEvent=
155339
+ {
155340
+ event:JSCHART_EVENT_ID.ON_SPLIT_XCOORDINATE,
155341
+ callback:(event, data, obj)=>{ this.OnSplitXCoordinate(event, data, obj); }
155342
+ };
155343
+
155344
+ var splitYEvent=
155345
+ {
155346
+ event:JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE,
155347
+ callback:(event, data, obj)=>{ this.OnSplitYCoordinate(event, data, obj); }
155348
+ }
155349
+
155282
155350
  if (Array.isArray(this.Minute.Option.EventCallback))
155283
155351
  {
155284
- this.Minute.Option.EventCallback.push(keyDownEvent);
155352
+ this.Minute.Option.EventCallback.unshift(keyDownEvent,reloadResourceEvent,splitYEvent,splitYEvent);
155285
155353
  }
155286
155354
  else
155287
155355
  {
155288
- this.Minute.Option.EventCallback=[keyDownEvent];
155356
+ this.Minute.Option.EventCallback=[keyDownEvent,reloadResourceEvent,splitXEvent,splitYEvent];
155289
155357
  }
155290
155358
 
155291
155359
  chart.SetOption(this.Minute.Option); //设置K线配置
@@ -155324,7 +155392,7 @@ function JSPopMinuteChart()
155324
155392
 
155325
155393
  this.OnCreateHQChart=function(chart)
155326
155394
  {
155327
-
155395
+ this.LoadChartResource(chart);
155328
155396
  }
155329
155397
 
155330
155398
  this.Destroy=function()
@@ -155445,6 +155513,10 @@ function JSPopMinuteChart()
155445
155513
  this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
155446
155514
  this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
155447
155515
 
155516
+ this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font;
155517
+ this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
155518
+ this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font
155519
+
155448
155520
  if (!this.DivDialog) return;
155449
155521
 
155450
155522
  this.UpdateStyle();
@@ -155452,6 +155524,35 @@ function JSPopMinuteChart()
155452
155524
  if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
155453
155525
  }
155454
155526
 
155527
+ this.LoadChartResource=function(chart)
155528
+ {
155529
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.TitlePaint))
155530
+ {
155531
+ for(var i=0;i<chart.TitlePaint.length;++i)
155532
+ {
155533
+ var item=chart.TitlePaint[i];
155534
+ if (!item) continue;
155535
+
155536
+ item.Font=this.TitleFont;
155537
+ }
155538
+ }
155539
+
155540
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.WindowIndex))
155541
+ {
155542
+ for(var i=0;i<chart.WindowIndex.length;++i) //去掉指标里面的字体
155543
+ {
155544
+ var item=chart.WindowIndex[i];
155545
+ if (!item) continue;
155546
+ item.TitleFont=null;
155547
+ }
155548
+ }
155549
+
155550
+ if (chart.ChartCorssCursor)
155551
+ {
155552
+ chart.ChartCorssCursor.Font=this.CorssCursorFont;
155553
+ }
155554
+ }
155555
+
155455
155556
  this.SetLanguage=function(language)
155456
155557
  {
155457
155558
  if (!this.DivDialog) return;
@@ -155578,6 +155679,34 @@ function JSPopMinuteChart()
155578
155679
  finder.Chart.ClearData();
155579
155680
  this.HQChart.Draw();
155580
155681
  }
155682
+
155683
+ this.OnSplitXCoordinate=function(event, data, obj)
155684
+ {
155685
+ var frame=data.Frame;
155686
+ if (IFrameSplitOperator.IsNonEmptyArray(frame.VerticalInfo))
155687
+ {
155688
+ for(var i=0;i<frame.VerticalInfo.length;++i)
155689
+ {
155690
+ var item=frame.VerticalInfo[i];
155691
+ if (!item) continue;
155692
+ if (item.Font) item.Font=this.FrameSplitTextFont;
155693
+ }
155694
+ }
155695
+ }
155696
+
155697
+ this.OnSplitYCoordinate=function(event, data, obj)
155698
+ {
155699
+ var frame=data.Frame;
155700
+ if (IFrameSplitOperator.IsNonEmptyArray(frame.HorizontalInfo))
155701
+ {
155702
+ for(var i=0;i<frame.HorizontalInfo.length;++i)
155703
+ {
155704
+ var item=frame.HorizontalInfo[i];
155705
+ if (!item) continue;
155706
+ if (item.Font) item.Font=this.FrameSplitTextFont;
155707
+ }
155708
+ }
155709
+ }
155581
155710
  }
155582
155711
 
155583
155712
 
@@ -155605,7 +155734,7 @@ JSPopMinuteChart.GetMinuteOption=function()
155605
155734
  //BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
155606
155735
  //AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
155607
155736
 
155608
- CorssCursorInfo:{ Left:2, Right:1, Bottom:1 },
155737
+ CorssCursorInfo:{ Left:1, Right:1, Bottom:1 },
155609
155738
 
155610
155739
  MinuteLine:
155611
155740
  {
@@ -155633,8 +155762,8 @@ JSPopMinuteChart.GetMinuteOption=function()
155633
155762
  {
155634
155763
  Left:20, //左边间距
155635
155764
  Right:20, //右边间距
155636
- Top:25,
155637
- Bottom:25,
155765
+ Top:20,
155766
+ Bottom:20,
155638
155767
 
155639
155768
  AutoLeft:{ Blank:10, MinWidth:60 },
155640
155769
  AutoRight:{ Blank:10, MinWidth:60 },
@@ -155665,6 +155794,11 @@ function JSTooltipMinuteChart()
155665
155794
 
155666
155795
  this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
155667
155796
  this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
155797
+
155798
+ this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
155799
+ this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
155800
+ this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
155801
+
155668
155802
  this.OnCreatedCallback;
155669
155803
 
155670
155804
  this.Minute=
@@ -155712,6 +155846,35 @@ function JSTooltipMinuteChart()
155712
155846
  if (this.HQChart) this.Minute.Option.Language=g_JSChartLocalization.GetLanguageName(this.HQChart.LanguageID);
155713
155847
  this.Minute.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
155714
155848
  this.Minute.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
155849
+
155850
+
155851
+ var reloadResourceEvent=
155852
+ {
155853
+ event:JSCHART_EVENT_ID.ON_RELOAD_RESOURCE,
155854
+ callback:(event, data, obj)=>{ this.LoadChartResource(obj); }
155855
+ }
155856
+
155857
+ var splitXEvent=
155858
+ {
155859
+ event:JSCHART_EVENT_ID.ON_SPLIT_XCOORDINATE,
155860
+ callback:(event, data, obj)=>{ this.OnSplitXCoordinate(event, data, obj); }
155861
+ };
155862
+
155863
+ var splitYEvent=
155864
+ {
155865
+ event:JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE,
155866
+ callback:(event, data, obj)=>{ this.OnSplitYCoordinate(event, data, obj); }
155867
+ }
155868
+
155869
+ if (Array.isArray(this.Minute.Option.EventCallback))
155870
+ {
155871
+ this.Minute.Option.EventCallback.unshift(reloadResourceEvent,splitYEvent,splitYEvent);
155872
+ }
155873
+ else
155874
+ {
155875
+ this.Minute.Option.EventCallback=[reloadResourceEvent,splitXEvent,splitYEvent];
155876
+ }
155877
+
155715
155878
  chart.SetOption(this.Minute.Option); //设置K线配置
155716
155879
 
155717
155880
  document.body.appendChild(divDom);
@@ -155752,6 +155915,8 @@ function JSTooltipMinuteChart()
155752
155915
 
155753
155916
  this.OnCreateHQChart=function(chart)
155754
155917
  {
155918
+ this.LoadChartResource(chart);
155919
+
155755
155920
  if (this.OnCreatedCallback) this.OnCreatedCallback(chart);
155756
155921
  }
155757
155922
 
@@ -155832,6 +155997,10 @@ function JSTooltipMinuteChart()
155832
155997
  this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
155833
155998
  this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
155834
155999
 
156000
+ this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
156001
+ this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
156002
+ this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
156003
+
155835
156004
  if (!this.DivDialog) return;
155836
156005
 
155837
156006
  this.UpdateStyle();
@@ -155839,6 +156008,63 @@ function JSTooltipMinuteChart()
155839
156008
  if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
155840
156009
  }
155841
156010
 
156011
+ this.LoadChartResource=function(chart)
156012
+ {
156013
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.TitlePaint))
156014
+ {
156015
+ for(var i=0;i<chart.TitlePaint.length;++i)
156016
+ {
156017
+ var item=chart.TitlePaint[i];
156018
+ if (!item) continue;
156019
+
156020
+ item.Font=this.TitleFont;
156021
+ }
156022
+ }
156023
+
156024
+ if (IFrameSplitOperator.IsNonEmptyArray(chart.WindowIndex))
156025
+ {
156026
+ for(var i=0;i<chart.WindowIndex.length;++i) //去掉指标里面的字体
156027
+ {
156028
+ var item=chart.WindowIndex[i];
156029
+ if (!item) continue;
156030
+ item.TitleFont=null;
156031
+ }
156032
+ }
156033
+
156034
+ if (chart.ChartCorssCursor)
156035
+ {
156036
+ chart.ChartCorssCursor.Font=this.CorssCursorFont;
156037
+ }
156038
+ }
156039
+
156040
+ this.OnSplitXCoordinate=function(event, data, obj)
156041
+ {
156042
+ var frame=data.Frame;
156043
+ if (IFrameSplitOperator.IsNonEmptyArray(frame.VerticalInfo))
156044
+ {
156045
+ for(var i=0;i<frame.VerticalInfo.length;++i)
156046
+ {
156047
+ var item=frame.VerticalInfo[i];
156048
+ if (!item) continue;
156049
+ if (item.Font) item.Font=this.FrameSplitTextFont;
156050
+ }
156051
+ }
156052
+ }
156053
+
156054
+ this.OnSplitYCoordinate=function(event, data, obj)
156055
+ {
156056
+ var frame=data.Frame;
156057
+ if (IFrameSplitOperator.IsNonEmptyArray(frame.HorizontalInfo))
156058
+ {
156059
+ for(var i=0;i<frame.HorizontalInfo.length;++i)
156060
+ {
156061
+ var item=frame.HorizontalInfo[i];
156062
+ if (!item) continue;
156063
+ if (item.Font) item.Font=this.FrameSplitTextFont;
156064
+ }
156065
+ }
156066
+ }
156067
+
155842
156068
  }
155843
156069
 
155844
156070
  JSTooltipMinuteChart.GetMinuteOption=function()
@@ -155865,7 +156091,7 @@ JSTooltipMinuteChart.GetMinuteOption=function()
155865
156091
  //BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
155866
156092
  //AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
155867
156093
 
155868
- CorssCursorInfo:{ Left:2, Right:1, Bottom:1 },
156094
+ CorssCursorInfo:{ Left:1, Right:1, Bottom:1 },
155869
156095
 
155870
156096
  MinuteLine:
155871
156097
  {
@@ -155895,8 +156121,8 @@ JSTooltipMinuteChart.GetMinuteOption=function()
155895
156121
  {
155896
156122
  Left:20, //左边间距
155897
156123
  Right:120, //右边间距
155898
- Top:25,
155899
- Bottom:25,
156124
+ Top:20,
156125
+ Bottom:20,
155900
156126
 
155901
156127
  AutoLeft:{ Blank:10, MinWidth:40 },
155902
156128
  AutoRight:{ Blank:10, MinWidth:40 },
@@ -161308,7 +161534,7 @@ function HQChartScriptWorker()
161308
161534
 
161309
161535
 
161310
161536
 
161311
- var HQCHART_VERSION="1.1.14854";
161537
+ var HQCHART_VERSION="1.1.14859";
161312
161538
 
161313
161539
  function PrintHQChartVersion()
161314
161540
  {