hqchart 1.1.14853 → 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.
@@ -732,6 +732,10 @@ HQData.RequestRealtimeData=function(data, callback)
732
732
 
733
733
  var hqchartData={ code:0, stock:aryStock };
734
734
 
735
+ var time=new Date();
736
+ //if (time.getSeconds()%3==1)
737
+ hqchartData.LatestPointFlash={ FlashCount:2 };
738
+
735
739
 
736
740
  callback(hqchartData);
737
741
 
@@ -2279,6 +2283,8 @@ HQData.Report_APIIndex=function(data, callback)
2279
2283
  HQData.APIIndex_DRAWSVG(data, callback);
2280
2284
  else if (request.Data.indexname=="API_BASELINE_BAR")
2281
2285
  HQData.APIIndex_BASELINE_BAR(data, callback);
2286
+ else if (request.Data.indexname=="API_VERTLINE")
2287
+ HQData.APIIndex_VERTLINE(data, callback);
2282
2288
  }
2283
2289
 
2284
2290
 
@@ -3649,7 +3655,7 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
3649
3655
  {
3650
3656
  var kItem=kData.Data[i];
3651
3657
 
3652
- var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35)*-1 };
3658
+ var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35) };
3653
3659
  pointData.Draw.DrawData.push(item);
3654
3660
  }
3655
3661
 
@@ -3665,3 +3671,41 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
3665
3671
  }
3666
3672
 
3667
3673
 
3674
+ HQData.APIIndex_VERTLINE=function(data, callback)
3675
+ {
3676
+ data.PreventDefault=true;
3677
+ var hqchart=data.HQChart;
3678
+ var kData=hqchart.GetKData();
3679
+
3680
+ var lineData=
3681
+ {
3682
+ name:"VERTLINE", type:1,
3683
+ Draw:
3684
+ {
3685
+ Name:"VERTLINE",
3686
+ DrawType:"VERTLINE",
3687
+ DrawData:{ Data:[] },
3688
+ },
3689
+ };
3690
+
3691
+ for(var i=0;i<kData.Data.length;++i)
3692
+ {
3693
+ var kItem=kData.Data[i];
3694
+
3695
+ var value=0;
3696
+ if (i%5==1) value=1;
3697
+ lineData.Draw.DrawData.Data[i]=value;
3698
+ }
3699
+
3700
+ var apiData=
3701
+ {
3702
+ code:0,
3703
+ stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
3704
+ outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ lineData] },
3705
+ };
3706
+
3707
+ console.log('[HQData.APIIndex_VERTLINE] apiData ', apiData);
3708
+ callback(apiData);
3709
+ }
3710
+
3711
+
@@ -4883,6 +4883,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
4883
4883
 
4884
4884
  this.AdjustTitleHeight(chart);
4885
4885
 
4886
+ if (option.LatestPointFlash)
4887
+ {
4888
+ var item=option.LatestPointFlash;
4889
+ if (item.Enable)
4890
+ {
4891
+ this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
4892
+ chart.CreateExtendChart("LatestPointFlashPaint", item);
4893
+ chart.StartLatestPointFlash();
4894
+ }
4895
+ }
4896
+
4886
4897
  return chart;
4887
4898
  }
4888
4899
 
@@ -6900,6 +6911,8 @@ var JSCHART_EVENT_ID=
6900
6911
  ON_CLICK_CHART_CELL:171, //点击图形单元
6901
6912
 
6902
6913
  GET_DEFAULT_INDEX_PARAM:172, //获取指标默认参数
6914
+
6915
+ ON_RELOAD_RESOURCE:173,
6903
6916
  }
6904
6917
 
6905
6918
  var JSCHART_OPERATOR_ID=
@@ -13592,6 +13605,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
13592
13605
  this.ReloadChartCorssCursor(option,option.Resource);
13593
13606
  this.ReloadChartDrawPictureResource(option.Resource);
13594
13607
 
13608
+ var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_RELOAD_RESOURCE); //配色重新加载
13609
+ if (event && event.Callback)
13610
+ {
13611
+ var sendData={ Option:option };
13612
+ event.Callback(event, sendData, this);
13613
+ }
13614
+
13595
13615
  if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
13596
13616
  else if (option.Draw==true || option.Redraw==true) this.Draw(); //是否立即重绘
13597
13617
 
@@ -31339,6 +31359,8 @@ function ChartKLine()
31339
31359
  LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
31340
31360
  }
31341
31361
 
31362
+ this.LastPoint={ }; //最后一个点的信息 {X, Y, KItem:, Date:, Time: }
31363
+
31342
31364
  this.AddToDaySummary=function(kItem)
31343
31365
  {
31344
31366
  if (!this.DaySummary.Enable) return false;
@@ -31842,6 +31864,8 @@ function ChartKLine()
31842
31864
  if (i==this.Data.Data.length-1)
31843
31865
  {
31844
31866
  ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
31867
+
31868
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
31845
31869
  }
31846
31870
 
31847
31871
  if (this.PriceGap.Enable )
@@ -31975,6 +31999,11 @@ function ChartKLine()
31975
31999
 
31976
32000
  prePoint={ X:x, Y:yClose};
31977
32001
 
32002
+ if (i==this.Data.Data.length-1) //最后一个点
32003
+ {
32004
+ this.LastPoint={ X:x, Y:yClose, KItem:data };
32005
+ }
32006
+
31978
32007
  if (this.PriceGap.Enable)
31979
32008
  {
31980
32009
  var yLow=this.GetYFromData(data.Low, false);
@@ -33938,8 +33967,29 @@ function ChartKLine()
33938
33967
  this.Canvas.clip();
33939
33968
  }
33940
33969
 
33970
+ this.ClearLastPoint=function()
33971
+ {
33972
+ this.LastPoint={ };
33973
+ if (this.ChartFrame.GlobalOption)
33974
+ {
33975
+ var item=this.ChartFrame.GlobalOption;
33976
+ item.LatestPoint=null;
33977
+ }
33978
+ }
33979
+
33980
+ this.UpdateGlobalLatestPoint=function()
33981
+ {
33982
+ if (this.Identify!="Main-KLine") return;
33983
+ if (!this.ChartFrame.GlobalOption) return;
33984
+
33985
+ var item=this.ChartFrame.GlobalOption;
33986
+ if (IFrameSplitOperator.IsNumber(this.LastPoint.X) && IFrameSplitOperator.IsNumber(this.LastPoint.Y))
33987
+ item.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
33988
+ }
33989
+
33941
33990
  this.Draw=function()
33942
33991
  {
33992
+ this.ClearLastPoint();
33943
33993
  if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
33944
33994
  if (this.IsShowIndexTitleOnly()) return;
33945
33995
  if (this.IsHideScriptIndex()) return;
@@ -33996,6 +34046,7 @@ function ChartKLine()
33996
34046
  this.Canvas.restore();
33997
34047
  this.DrawPredictionLine();
33998
34048
  if (this.PriceGap.Enable) this.DrawPriceGap();
34049
+ this.UpdateGlobalLatestPoint();
33999
34050
  return;
34000
34051
  }
34001
34052
  else if (this.DrawType==2)
@@ -34067,6 +34118,8 @@ function ChartKLine()
34067
34118
 
34068
34119
  this.Canvas.restore();
34069
34120
 
34121
+ this.UpdateGlobalLatestPoint();
34122
+
34070
34123
  this.DrawPredictionLine();
34071
34124
  if (this.PriceGap.Enable) this.DrawPriceGap();
34072
34125
 
@@ -56170,6 +56223,7 @@ function LatestPointFlashPaint()
56170
56223
  this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
56171
56224
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56172
56225
  this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
56226
+ this.Style=1; //0=默认配置 1=图形保持一致
56173
56227
  this.FlashCanvas;
56174
56228
 
56175
56229
  this.SetOption=function(option)
@@ -56194,6 +56248,23 @@ function LatestPointFlashPaint()
56194
56248
  this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
56195
56249
  }
56196
56250
 
56251
+ this.GetChartColor=function()
56252
+ {
56253
+ var chart=this.HQChart.ChartPaint[0];
56254
+ if (!chart) return;
56255
+
56256
+ if (chart.ClassName=="ChartKLine")
56257
+ {
56258
+ this.PointColor=chart.CloseLineColor;
56259
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor, 0.6);
56260
+ }
56261
+ else if (chart.ClassName=="ChartMinutePriceLine")
56262
+ {
56263
+ this.PointColor=chart.Color;
56264
+ this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color, 0.6);
56265
+ }
56266
+ }
56267
+
56197
56268
  this.Draw=function()
56198
56269
  {
56199
56270
  if (!this.FlashCanvas) return;
@@ -56212,6 +56283,8 @@ function LatestPointFlashPaint()
56212
56283
  var point=this.HQChart.GlobalOption.LatestPoint;
56213
56284
  if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
56214
56285
 
56286
+ if (this.Style==1) this.GetChartColor();
56287
+
56215
56288
  this.FlashCanvas.fillStyle=this.BGColor;
56216
56289
  this.FlashCanvas.beginPath();
56217
56290
  this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
@@ -79163,6 +79236,21 @@ function JSChartResource()
79163
79236
  {
79164
79237
  LineColor:"rgba(255,165,0,0.6)",
79165
79238
  LineWidth:2,
79239
+ },
79240
+
79241
+ Title:
79242
+ {
79243
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
79244
+ },
79245
+
79246
+ CorssCursor:
79247
+ {
79248
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`
79249
+ },
79250
+
79251
+ Frame:
79252
+ {
79253
+ Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, //刻度坐标
79166
79254
  }
79167
79255
  }
79168
79256
 
@@ -80845,6 +80933,18 @@ function JSChartResource()
80845
80933
  if (item.Mark.LineColor) dest.Mark.LineColor=item.Mark.LineColor;
80846
80934
  if (IFrameSplitOperator.IsNumber(item.Mark.LineWidth)) dest.Mark.LineWidth=item.Mark.LineWidth;
80847
80935
  }
80936
+ if (item.Title)
80937
+ {
80938
+ if (item.Title.Font) dest.Title.Font=item.Title.Font;
80939
+ }
80940
+ if (item.CorssCursor)
80941
+ {
80942
+ if (item.CorssCursor.Font) dest.CorssCursor.Font=item.CorssCursor.Font;
80943
+ }
80944
+ if (item.Frame)
80945
+ {
80946
+ if (item.Frame.Font) dest.Frame.Font=item.Frame.Font;
80947
+ }
80848
80948
  }
80849
80949
 
80850
80950
  if (style.PopKLineChart)
@@ -86426,6 +86526,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
86426
86526
 
86427
86527
  if (!bFind) return;
86428
86528
  }
86529
+
86530
+ if (data.LatestPointFlash) //最新数据闪烁
86531
+ {
86532
+ var item=data.LatestPointFlash;
86533
+ if (IFrameSplitOperator.IsNumber(item.FlashCount))
86534
+ this.SetLatestPointFlash(item.FlashCount)
86535
+ }
86429
86536
 
86430
86537
  var bindData=new ChartData();
86431
86538
  bindData.Data=this.SourceData.Data;
@@ -127263,7 +127370,7 @@ var SCRIPT_CHART_NAME=
127263
127370
  CLIP_COLOR_STICK:"CLIP_COLOR_STICK", //上下柱子 裁剪
127264
127371
 
127265
127372
  DRAW_KLINE:"DRAWKLINE",
127266
- BASELINE_BAR:"BASELINE_BAR"
127373
+ BASELINE_BAR:"BASELINE_BAR",
127267
127374
  }
127268
127375
 
127269
127376
 
@@ -132222,6 +132329,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
132222
132329
 
132223
132330
  result.push(outVarItem);
132224
132331
  }
132332
+ else if (draw.DrawType=="VERTLINE") //竖线
132333
+ {
132334
+ drawItem.Text=draw.Text;
132335
+ drawItem.Name=draw.Name;
132336
+ drawItem.DrawType=draw.DrawType;
132337
+ drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
132338
+ outVarItem.Draw=drawItem;
132339
+
132340
+ result.push(outVarItem);
132341
+ }
132225
132342
  else if (draw.DrawType=='STICKLINE') //柱子
132226
132343
  {
132227
132344
  drawItem.Name=draw.Name;
@@ -133823,7 +133940,7 @@ function GetBlackStyle()
133823
133940
  MultiDayBorderPen:"rgba(236,236,236,0.5)",
133824
133941
  FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
133825
133942
  FrameSplitTextColor: "rgb(220,220,220)", //刻度文字颜色
133826
- FrameSplitTextFont: 12*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
133943
+ FrameSplitTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
133827
133944
  FrameTitleBGColor: "rgb(0,0,0)", //标题栏背景色
133828
133945
  OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
133829
133946
 
@@ -133859,7 +133976,7 @@ function GetBlackStyle()
133859
133976
 
133860
133977
  CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
133861
133978
  CorssCursorTextColor: "rgb(255,255,255)",
133862
- CorssCursorTextFont: 12*GetDevicePixelRatio() +"px 微软雅黑",
133979
+ CorssCursorTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑",
133863
133980
  CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
133864
133981
  CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
133865
133982
 
@@ -150197,7 +150314,7 @@ function ScrollBarBGChart()
150197
150314
 
150198
150315
 
150199
150316
 
150200
- var HQCHART_VERSION="1.1.14852";
150317
+ var HQCHART_VERSION="1.1.14859";
150201
150318
 
150202
150319
  function PrintHQChartVersion()
150203
150320
  {
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var HQCHART_VERSION="1.1.14852";
8
+ var HQCHART_VERSION="1.1.14859";
9
9
 
10
10
  function PrintHQChartVersion()
11
11
  {
@@ -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
  /*暴露外部用的方法*/