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.
- package/lib/umychart.vue.js +50 -31
- package/package.json +1 -1
- package/src/jscommon/umychart.NetworkFilterTest.js +45 -1
- package/src/jscommon/umychart.PopMinuteChart.js +189 -9
- package/src/jscommon/umychart.complier.js +11 -1
- package/src/jscommon/umychart.js +107 -0
- package/src/jscommon/umychart.style.js +2 -2
- package/src/jscommon/umychart.testdata.js +45 -1
- package/src/jscommon/umychart.uniapp.h5/umychart.uniapp.h5.js +121 -4
- package/src/jscommon/umychart.version.js +1 -1
- package/src/jscommon/umychart.vue/umychart.NetworkFilterTest.vue.js +45 -1
- package/src/jscommon/umychart.vue/umychart.vue.js +310 -13
package/package.json
CHANGED
|
@@ -56246,6 +56246,10 @@ HQData.RequestRealtimeData=function(data, callback)
|
|
|
56246
56246
|
|
|
56247
56247
|
var hqchartData={ code:0, stock:aryStock };
|
|
56248
56248
|
|
|
56249
|
+
var time=new Date();
|
|
56250
|
+
//if (time.getSeconds()%3==1)
|
|
56251
|
+
hqchartData.LatestPointFlash={ FlashCount:2 };
|
|
56252
|
+
|
|
56249
56253
|
|
|
56250
56254
|
callback(hqchartData);
|
|
56251
56255
|
|
|
@@ -57793,6 +57797,8 @@ HQData.Report_APIIndex=function(data, callback)
|
|
|
57793
57797
|
HQData.APIIndex_DRAWSVG(data, callback);
|
|
57794
57798
|
else if (request.Data.indexname=="API_BASELINE_BAR")
|
|
57795
57799
|
HQData.APIIndex_BASELINE_BAR(data, callback);
|
|
57800
|
+
else if (request.Data.indexname=="API_VERTLINE")
|
|
57801
|
+
HQData.APIIndex_VERTLINE(data, callback);
|
|
57796
57802
|
}
|
|
57797
57803
|
|
|
57798
57804
|
|
|
@@ -59163,7 +59169,7 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
|
|
|
59163
59169
|
{
|
|
59164
59170
|
var kItem=kData.Data[i];
|
|
59165
59171
|
|
|
59166
|
-
var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35)
|
|
59172
|
+
var item={ Date:kItem.Date, Time:kItem.Time, Up:kItem.Vol*0.2, Down:(kItem.Vol*0.35) };
|
|
59167
59173
|
pointData.Draw.DrawData.push(item);
|
|
59168
59174
|
}
|
|
59169
59175
|
|
|
@@ -59179,3 +59185,41 @@ HQData.APIIndex_BASELINE_BAR=function(data, callback)
|
|
|
59179
59185
|
}
|
|
59180
59186
|
|
|
59181
59187
|
|
|
59188
|
+
HQData.APIIndex_VERTLINE=function(data, callback)
|
|
59189
|
+
{
|
|
59190
|
+
data.PreventDefault=true;
|
|
59191
|
+
var hqchart=data.HQChart;
|
|
59192
|
+
var kData=hqchart.GetKData();
|
|
59193
|
+
|
|
59194
|
+
var lineData=
|
|
59195
|
+
{
|
|
59196
|
+
name:"VERTLINE", type:1,
|
|
59197
|
+
Draw:
|
|
59198
|
+
{
|
|
59199
|
+
Name:"VERTLINE",
|
|
59200
|
+
DrawType:"VERTLINE",
|
|
59201
|
+
DrawData:{ Data:[] },
|
|
59202
|
+
},
|
|
59203
|
+
};
|
|
59204
|
+
|
|
59205
|
+
for(var i=0;i<kData.Data.length;++i)
|
|
59206
|
+
{
|
|
59207
|
+
var kItem=kData.Data[i];
|
|
59208
|
+
|
|
59209
|
+
var value=0;
|
|
59210
|
+
if (i%5==1) value=1;
|
|
59211
|
+
lineData.Draw.DrawData.Data[i]=value;
|
|
59212
|
+
}
|
|
59213
|
+
|
|
59214
|
+
var apiData=
|
|
59215
|
+
{
|
|
59216
|
+
code:0,
|
|
59217
|
+
stock:{ name:hqchart.Name, symbol:hqchart.Symbol },
|
|
59218
|
+
outdata: { date:kData.GetDate(), time:kData.GetTime(), outvar:[ lineData] },
|
|
59219
|
+
};
|
|
59220
|
+
|
|
59221
|
+
console.log('[HQData.APIIndex_VERTLINE] apiData ', apiData);
|
|
59222
|
+
callback(apiData);
|
|
59223
|
+
}
|
|
59224
|
+
|
|
59225
|
+
|
|
@@ -25,6 +25,10 @@ function JSPopMinuteChart()
|
|
|
25
25
|
this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
|
|
26
26
|
this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
|
|
27
27
|
|
|
28
|
+
this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
|
|
29
|
+
this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
|
|
30
|
+
this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
|
|
31
|
+
|
|
28
32
|
this.Minute=
|
|
29
33
|
{
|
|
30
34
|
Option:JSPopMinuteChart.GetMinuteOption(),
|
|
@@ -106,13 +110,31 @@ function JSPopMinuteChart()
|
|
|
106
110
|
callback:(event, data, obj)=>{ this.OnKeyDown(event, data, obj); }
|
|
107
111
|
};
|
|
108
112
|
|
|
113
|
+
var reloadResourceEvent=
|
|
114
|
+
{
|
|
115
|
+
event:JSCHART_EVENT_ID.ON_RELOAD_RESOURCE,
|
|
116
|
+
callback:(event, data, obj)=>{ this.LoadChartResource(obj); }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var splitXEvent=
|
|
120
|
+
{
|
|
121
|
+
event:JSCHART_EVENT_ID.ON_SPLIT_XCOORDINATE,
|
|
122
|
+
callback:(event, data, obj)=>{ this.OnSplitXCoordinate(event, data, obj); }
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var splitYEvent=
|
|
126
|
+
{
|
|
127
|
+
event:JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE,
|
|
128
|
+
callback:(event, data, obj)=>{ this.OnSplitYCoordinate(event, data, obj); }
|
|
129
|
+
}
|
|
130
|
+
|
|
109
131
|
if (Array.isArray(this.Minute.Option.EventCallback))
|
|
110
132
|
{
|
|
111
|
-
this.Minute.Option.EventCallback.
|
|
133
|
+
this.Minute.Option.EventCallback.unshift(keyDownEvent,reloadResourceEvent,splitYEvent,splitYEvent);
|
|
112
134
|
}
|
|
113
135
|
else
|
|
114
136
|
{
|
|
115
|
-
this.Minute.Option.EventCallback=[keyDownEvent];
|
|
137
|
+
this.Minute.Option.EventCallback=[keyDownEvent,reloadResourceEvent,splitXEvent,splitYEvent];
|
|
116
138
|
}
|
|
117
139
|
|
|
118
140
|
chart.SetOption(this.Minute.Option); //设置K线配置
|
|
@@ -151,7 +173,7 @@ function JSPopMinuteChart()
|
|
|
151
173
|
|
|
152
174
|
this.OnCreateHQChart=function(chart)
|
|
153
175
|
{
|
|
154
|
-
|
|
176
|
+
this.LoadChartResource(chart);
|
|
155
177
|
}
|
|
156
178
|
|
|
157
179
|
this.Destroy=function()
|
|
@@ -272,6 +294,10 @@ function JSPopMinuteChart()
|
|
|
272
294
|
this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
|
|
273
295
|
this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
|
|
274
296
|
|
|
297
|
+
this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font;
|
|
298
|
+
this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
|
|
299
|
+
this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font
|
|
300
|
+
|
|
275
301
|
if (!this.DivDialog) return;
|
|
276
302
|
|
|
277
303
|
this.UpdateStyle();
|
|
@@ -279,6 +305,35 @@ function JSPopMinuteChart()
|
|
|
279
305
|
if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
|
|
280
306
|
}
|
|
281
307
|
|
|
308
|
+
this.LoadChartResource=function(chart)
|
|
309
|
+
{
|
|
310
|
+
if (IFrameSplitOperator.IsNonEmptyArray(chart.TitlePaint))
|
|
311
|
+
{
|
|
312
|
+
for(var i=0;i<chart.TitlePaint.length;++i)
|
|
313
|
+
{
|
|
314
|
+
var item=chart.TitlePaint[i];
|
|
315
|
+
if (!item) continue;
|
|
316
|
+
|
|
317
|
+
item.Font=this.TitleFont;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
if (IFrameSplitOperator.IsNonEmptyArray(chart.WindowIndex))
|
|
322
|
+
{
|
|
323
|
+
for(var i=0;i<chart.WindowIndex.length;++i) //去掉指标里面的字体
|
|
324
|
+
{
|
|
325
|
+
var item=chart.WindowIndex[i];
|
|
326
|
+
if (!item) continue;
|
|
327
|
+
item.TitleFont=null;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (chart.ChartCorssCursor)
|
|
332
|
+
{
|
|
333
|
+
chart.ChartCorssCursor.Font=this.CorssCursorFont;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
282
337
|
this.SetLanguage=function(language)
|
|
283
338
|
{
|
|
284
339
|
if (!this.DivDialog) return;
|
|
@@ -405,6 +460,34 @@ function JSPopMinuteChart()
|
|
|
405
460
|
finder.Chart.ClearData();
|
|
406
461
|
this.HQChart.Draw();
|
|
407
462
|
}
|
|
463
|
+
|
|
464
|
+
this.OnSplitXCoordinate=function(event, data, obj)
|
|
465
|
+
{
|
|
466
|
+
var frame=data.Frame;
|
|
467
|
+
if (IFrameSplitOperator.IsNonEmptyArray(frame.VerticalInfo))
|
|
468
|
+
{
|
|
469
|
+
for(var i=0;i<frame.VerticalInfo.length;++i)
|
|
470
|
+
{
|
|
471
|
+
var item=frame.VerticalInfo[i];
|
|
472
|
+
if (!item) continue;
|
|
473
|
+
if (item.Font) item.Font=this.FrameSplitTextFont;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
this.OnSplitYCoordinate=function(event, data, obj)
|
|
479
|
+
{
|
|
480
|
+
var frame=data.Frame;
|
|
481
|
+
if (IFrameSplitOperator.IsNonEmptyArray(frame.HorizontalInfo))
|
|
482
|
+
{
|
|
483
|
+
for(var i=0;i<frame.HorizontalInfo.length;++i)
|
|
484
|
+
{
|
|
485
|
+
var item=frame.HorizontalInfo[i];
|
|
486
|
+
if (!item) continue;
|
|
487
|
+
if (item.Font) item.Font=this.FrameSplitTextFont;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
408
491
|
}
|
|
409
492
|
|
|
410
493
|
|
|
@@ -432,7 +515,7 @@ JSPopMinuteChart.GetMinuteOption=function()
|
|
|
432
515
|
//BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
|
|
433
516
|
//AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
|
|
434
517
|
|
|
435
|
-
CorssCursorInfo:{ Left:
|
|
518
|
+
CorssCursorInfo:{ Left:1, Right:1, Bottom:1 },
|
|
436
519
|
|
|
437
520
|
MinuteLine:
|
|
438
521
|
{
|
|
@@ -460,8 +543,8 @@ JSPopMinuteChart.GetMinuteOption=function()
|
|
|
460
543
|
{
|
|
461
544
|
Left:20, //左边间距
|
|
462
545
|
Right:20, //右边间距
|
|
463
|
-
Top:
|
|
464
|
-
Bottom:
|
|
546
|
+
Top:20,
|
|
547
|
+
Bottom:20,
|
|
465
548
|
|
|
466
549
|
AutoLeft:{ Blank:10, MinWidth:60 },
|
|
467
550
|
AutoRight:{ Blank:10, MinWidth:60 },
|
|
@@ -492,6 +575,11 @@ function JSTooltipMinuteChart()
|
|
|
492
575
|
|
|
493
576
|
this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
|
|
494
577
|
this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
|
|
578
|
+
|
|
579
|
+
this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
|
|
580
|
+
this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
|
|
581
|
+
this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
|
|
582
|
+
|
|
495
583
|
this.OnCreatedCallback;
|
|
496
584
|
|
|
497
585
|
this.Minute=
|
|
@@ -539,6 +627,35 @@ function JSTooltipMinuteChart()
|
|
|
539
627
|
if (this.HQChart) this.Minute.Option.Language=g_JSChartLocalization.GetLanguageName(this.HQChart.LanguageID);
|
|
540
628
|
this.Minute.Option.OnCreatedCallback=(chart)=>{ this.OnCreateHQChart(chart); }
|
|
541
629
|
this.Minute.Option.NetworkFilter=(data, callback)=>{ this.NetworkFilter(data, callback); }
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
var reloadResourceEvent=
|
|
633
|
+
{
|
|
634
|
+
event:JSCHART_EVENT_ID.ON_RELOAD_RESOURCE,
|
|
635
|
+
callback:(event, data, obj)=>{ this.LoadChartResource(obj); }
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
var splitXEvent=
|
|
639
|
+
{
|
|
640
|
+
event:JSCHART_EVENT_ID.ON_SPLIT_XCOORDINATE,
|
|
641
|
+
callback:(event, data, obj)=>{ this.OnSplitXCoordinate(event, data, obj); }
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
var splitYEvent=
|
|
645
|
+
{
|
|
646
|
+
event:JSCHART_EVENT_ID.ON_SPLIT_YCOORDINATE,
|
|
647
|
+
callback:(event, data, obj)=>{ this.OnSplitYCoordinate(event, data, obj); }
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
if (Array.isArray(this.Minute.Option.EventCallback))
|
|
651
|
+
{
|
|
652
|
+
this.Minute.Option.EventCallback.unshift(reloadResourceEvent,splitYEvent,splitYEvent);
|
|
653
|
+
}
|
|
654
|
+
else
|
|
655
|
+
{
|
|
656
|
+
this.Minute.Option.EventCallback=[reloadResourceEvent,splitXEvent,splitYEvent];
|
|
657
|
+
}
|
|
658
|
+
|
|
542
659
|
chart.SetOption(this.Minute.Option); //设置K线配置
|
|
543
660
|
|
|
544
661
|
document.body.appendChild(divDom);
|
|
@@ -579,6 +696,8 @@ function JSTooltipMinuteChart()
|
|
|
579
696
|
|
|
580
697
|
this.OnCreateHQChart=function(chart)
|
|
581
698
|
{
|
|
699
|
+
this.LoadChartResource(chart);
|
|
700
|
+
|
|
582
701
|
if (this.OnCreatedCallback) this.OnCreatedCallback(chart);
|
|
583
702
|
}
|
|
584
703
|
|
|
@@ -659,6 +778,10 @@ function JSTooltipMinuteChart()
|
|
|
659
778
|
this.BGColor=g_JSChartResource.PopMinuteChart.BGColor;
|
|
660
779
|
this.BorderColor=g_JSChartResource.PopMinuteChart.BorderColor;
|
|
661
780
|
|
|
781
|
+
this.TitleFont=g_JSChartResource.PopMinuteChart.Title.Font; //指标标题字体
|
|
782
|
+
this.CorssCursorFont=g_JSChartResource.PopMinuteChart.CorssCursor.Font; //十字光标
|
|
783
|
+
this.FrameSplitTextFont=g_JSChartResource.PopMinuteChart.Frame.Font; //刻度文字
|
|
784
|
+
|
|
662
785
|
if (!this.DivDialog) return;
|
|
663
786
|
|
|
664
787
|
this.UpdateStyle();
|
|
@@ -666,6 +789,63 @@ function JSTooltipMinuteChart()
|
|
|
666
789
|
if (this.Minute.JSChart) this.Minute.JSChart.ReloadResource(option);
|
|
667
790
|
}
|
|
668
791
|
|
|
792
|
+
this.LoadChartResource=function(chart)
|
|
793
|
+
{
|
|
794
|
+
if (IFrameSplitOperator.IsNonEmptyArray(chart.TitlePaint))
|
|
795
|
+
{
|
|
796
|
+
for(var i=0;i<chart.TitlePaint.length;++i)
|
|
797
|
+
{
|
|
798
|
+
var item=chart.TitlePaint[i];
|
|
799
|
+
if (!item) continue;
|
|
800
|
+
|
|
801
|
+
item.Font=this.TitleFont;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (IFrameSplitOperator.IsNonEmptyArray(chart.WindowIndex))
|
|
806
|
+
{
|
|
807
|
+
for(var i=0;i<chart.WindowIndex.length;++i) //去掉指标里面的字体
|
|
808
|
+
{
|
|
809
|
+
var item=chart.WindowIndex[i];
|
|
810
|
+
if (!item) continue;
|
|
811
|
+
item.TitleFont=null;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
if (chart.ChartCorssCursor)
|
|
816
|
+
{
|
|
817
|
+
chart.ChartCorssCursor.Font=this.CorssCursorFont;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
this.OnSplitXCoordinate=function(event, data, obj)
|
|
822
|
+
{
|
|
823
|
+
var frame=data.Frame;
|
|
824
|
+
if (IFrameSplitOperator.IsNonEmptyArray(frame.VerticalInfo))
|
|
825
|
+
{
|
|
826
|
+
for(var i=0;i<frame.VerticalInfo.length;++i)
|
|
827
|
+
{
|
|
828
|
+
var item=frame.VerticalInfo[i];
|
|
829
|
+
if (!item) continue;
|
|
830
|
+
if (item.Font) item.Font=this.FrameSplitTextFont;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
this.OnSplitYCoordinate=function(event, data, obj)
|
|
836
|
+
{
|
|
837
|
+
var frame=data.Frame;
|
|
838
|
+
if (IFrameSplitOperator.IsNonEmptyArray(frame.HorizontalInfo))
|
|
839
|
+
{
|
|
840
|
+
for(var i=0;i<frame.HorizontalInfo.length;++i)
|
|
841
|
+
{
|
|
842
|
+
var item=frame.HorizontalInfo[i];
|
|
843
|
+
if (!item) continue;
|
|
844
|
+
if (item.Font) item.Font=this.FrameSplitTextFont;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
669
849
|
}
|
|
670
850
|
|
|
671
851
|
JSTooltipMinuteChart.GetMinuteOption=function()
|
|
@@ -692,7 +872,7 @@ JSTooltipMinuteChart.GetMinuteOption=function()
|
|
|
692
872
|
//BeforeOpen:{IsShow:true, Width:120, IsShowMultiDay:true, MulitiDayWidth:100, },
|
|
693
873
|
//AfterClose:{IsShow:true, Width:100, IsShowMultiDay:true, MulitiDayWidth:50, ShareVol:2 }, //ShareVol:0=盘后成交量独立坐标, 1==盘后成交量主图共用 2==盘后成交量盘前共用
|
|
694
874
|
|
|
695
|
-
CorssCursorInfo:{ Left:
|
|
875
|
+
CorssCursorInfo:{ Left:1, Right:1, Bottom:1 },
|
|
696
876
|
|
|
697
877
|
MinuteLine:
|
|
698
878
|
{
|
|
@@ -722,8 +902,8 @@ JSTooltipMinuteChart.GetMinuteOption=function()
|
|
|
722
902
|
{
|
|
723
903
|
Left:20, //左边间距
|
|
724
904
|
Right:120, //右边间距
|
|
725
|
-
Top:
|
|
726
|
-
Bottom:
|
|
905
|
+
Top:20,
|
|
906
|
+
Bottom:20,
|
|
727
907
|
|
|
728
908
|
AutoLeft:{ Blank:10, MinWidth:40 },
|
|
729
909
|
AutoRight:{ Blank:10, MinWidth:40 },
|
|
@@ -20261,7 +20261,7 @@ var SCRIPT_CHART_NAME=
|
|
|
20261
20261
|
CLIP_COLOR_STICK:"CLIP_COLOR_STICK", //上下柱子 裁剪
|
|
20262
20262
|
|
|
20263
20263
|
DRAW_KLINE:"DRAWKLINE",
|
|
20264
|
-
BASELINE_BAR:"BASELINE_BAR"
|
|
20264
|
+
BASELINE_BAR:"BASELINE_BAR",
|
|
20265
20265
|
}
|
|
20266
20266
|
|
|
20267
20267
|
|
|
@@ -25220,6 +25220,16 @@ function APIScriptIndex(name,script,args,option, isOverlay)
|
|
|
25220
25220
|
|
|
25221
25221
|
result.push(outVarItem);
|
|
25222
25222
|
}
|
|
25223
|
+
else if (draw.DrawType=="VERTLINE") //竖线
|
|
25224
|
+
{
|
|
25225
|
+
drawItem.Text=draw.Text;
|
|
25226
|
+
drawItem.Name=draw.Name;
|
|
25227
|
+
drawItem.DrawType=draw.DrawType;
|
|
25228
|
+
drawItem.DrawData={ Data:this.FittingArray(draw.DrawData.Data,date,time,hqChart) };
|
|
25229
|
+
outVarItem.Draw=drawItem;
|
|
25230
|
+
|
|
25231
|
+
result.push(outVarItem);
|
|
25232
|
+
}
|
|
25223
25233
|
else if (draw.DrawType=='STICKLINE') //柱子
|
|
25224
25234
|
{
|
|
25225
25235
|
drawItem.Name=draw.Name;
|
package/src/jscommon/umychart.js
CHANGED
|
@@ -787,6 +787,17 @@ function JSChart(divElement, bOffscreen, bCacheCanvas)
|
|
|
787
787
|
|
|
788
788
|
this.AdjustTitleHeight(chart);
|
|
789
789
|
|
|
790
|
+
if (option.LatestPointFlash)
|
|
791
|
+
{
|
|
792
|
+
var item=option.LatestPointFlash;
|
|
793
|
+
if (item.Enable)
|
|
794
|
+
{
|
|
795
|
+
this.CreateExtraCanvasElement(JSChart.LatestPointFlashKey, { ZIndex:6 });
|
|
796
|
+
chart.CreateExtendChart("LatestPointFlashPaint", item);
|
|
797
|
+
chart.StartLatestPointFlash();
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
790
801
|
return chart;
|
|
791
802
|
}
|
|
792
803
|
|
|
@@ -2804,6 +2815,8 @@ var JSCHART_EVENT_ID=
|
|
|
2804
2815
|
ON_CLICK_CHART_CELL:171, //点击图形单元
|
|
2805
2816
|
|
|
2806
2817
|
GET_DEFAULT_INDEX_PARAM:172, //获取指标默认参数
|
|
2818
|
+
|
|
2819
|
+
ON_RELOAD_RESOURCE:173,
|
|
2807
2820
|
}
|
|
2808
2821
|
|
|
2809
2822
|
var JSCHART_OPERATOR_ID=
|
|
@@ -9496,6 +9509,13 @@ function JSChartContainer(uielement, OffscreenElement, cacheElement)
|
|
|
9496
9509
|
this.ReloadChartCorssCursor(option,option.Resource);
|
|
9497
9510
|
this.ReloadChartDrawPictureResource(option.Resource);
|
|
9498
9511
|
|
|
9512
|
+
var event=this.GetEventCallback(JSCHART_EVENT_ID.ON_RELOAD_RESOURCE); //配色重新加载
|
|
9513
|
+
if (event && event.Callback)
|
|
9514
|
+
{
|
|
9515
|
+
var sendData={ Option:option };
|
|
9516
|
+
event.Callback(event, sendData, this);
|
|
9517
|
+
}
|
|
9518
|
+
|
|
9499
9519
|
if (option.Update && this.Update) this.Update( {UpdateCursorIndexType:2} ); //是否立即更新并重绘
|
|
9500
9520
|
else if (option.Draw==true || option.Redraw==true) this.Draw(); //是否立即重绘
|
|
9501
9521
|
|
|
@@ -27243,6 +27263,8 @@ function ChartKLine()
|
|
|
27243
27263
|
LeftMargin:g_JSChartResource.DaySummaryKLine.LeftMargin,
|
|
27244
27264
|
}
|
|
27245
27265
|
|
|
27266
|
+
this.LastPoint={ }; //最后一个点的信息 {X, Y, KItem:, Date:, Time: }
|
|
27267
|
+
|
|
27246
27268
|
this.AddToDaySummary=function(kItem)
|
|
27247
27269
|
{
|
|
27248
27270
|
if (!this.DaySummary.Enable) return false;
|
|
@@ -27746,6 +27768,8 @@ function ChartKLine()
|
|
|
27746
27768
|
if (i==this.Data.Data.length-1)
|
|
27747
27769
|
{
|
|
27748
27770
|
ptLast={ X:x, Y:yClose, XLeft:left, XRight:right, KItem:data, ChartRight:chartright };
|
|
27771
|
+
|
|
27772
|
+
this.LastPoint={ X:x, Y:yClose, KItem:data };
|
|
27749
27773
|
}
|
|
27750
27774
|
|
|
27751
27775
|
if (this.PriceGap.Enable )
|
|
@@ -27879,6 +27903,11 @@ function ChartKLine()
|
|
|
27879
27903
|
|
|
27880
27904
|
prePoint={ X:x, Y:yClose};
|
|
27881
27905
|
|
|
27906
|
+
if (i==this.Data.Data.length-1) //最后一个点
|
|
27907
|
+
{
|
|
27908
|
+
this.LastPoint={ X:x, Y:yClose, KItem:data };
|
|
27909
|
+
}
|
|
27910
|
+
|
|
27882
27911
|
if (this.PriceGap.Enable)
|
|
27883
27912
|
{
|
|
27884
27913
|
var yLow=this.GetYFromData(data.Low, false);
|
|
@@ -29842,8 +29871,29 @@ function ChartKLine()
|
|
|
29842
29871
|
this.Canvas.clip();
|
|
29843
29872
|
}
|
|
29844
29873
|
|
|
29874
|
+
this.ClearLastPoint=function()
|
|
29875
|
+
{
|
|
29876
|
+
this.LastPoint={ };
|
|
29877
|
+
if (this.ChartFrame.GlobalOption)
|
|
29878
|
+
{
|
|
29879
|
+
var item=this.ChartFrame.GlobalOption;
|
|
29880
|
+
item.LatestPoint=null;
|
|
29881
|
+
}
|
|
29882
|
+
}
|
|
29883
|
+
|
|
29884
|
+
this.UpdateGlobalLatestPoint=function()
|
|
29885
|
+
{
|
|
29886
|
+
if (this.Identify!="Main-KLine") return;
|
|
29887
|
+
if (!this.ChartFrame.GlobalOption) return;
|
|
29888
|
+
|
|
29889
|
+
var item=this.ChartFrame.GlobalOption;
|
|
29890
|
+
if (IFrameSplitOperator.IsNumber(this.LastPoint.X) && IFrameSplitOperator.IsNumber(this.LastPoint.Y))
|
|
29891
|
+
item.LatestPoint={ X:this.LastPoint.X, Y:this.LastPoint.Y };
|
|
29892
|
+
}
|
|
29893
|
+
|
|
29845
29894
|
this.Draw=function()
|
|
29846
29895
|
{
|
|
29896
|
+
this.ClearLastPoint();
|
|
29847
29897
|
if (!this.IsShow || this.ChartFrame.IsMinSize || !this.IsVisible) return;
|
|
29848
29898
|
if (this.IsShowIndexTitleOnly()) return;
|
|
29849
29899
|
if (this.IsHideScriptIndex()) return;
|
|
@@ -29900,6 +29950,7 @@ function ChartKLine()
|
|
|
29900
29950
|
this.Canvas.restore();
|
|
29901
29951
|
this.DrawPredictionLine();
|
|
29902
29952
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
29953
|
+
this.UpdateGlobalLatestPoint();
|
|
29903
29954
|
return;
|
|
29904
29955
|
}
|
|
29905
29956
|
else if (this.DrawType==2)
|
|
@@ -29971,6 +30022,8 @@ function ChartKLine()
|
|
|
29971
30022
|
|
|
29972
30023
|
this.Canvas.restore();
|
|
29973
30024
|
|
|
30025
|
+
this.UpdateGlobalLatestPoint();
|
|
30026
|
+
|
|
29974
30027
|
this.DrawPredictionLine();
|
|
29975
30028
|
if (this.PriceGap.Enable) this.DrawPriceGap();
|
|
29976
30029
|
|
|
@@ -52074,6 +52127,7 @@ function LatestPointFlashPaint()
|
|
|
52074
52127
|
this.BGColor=g_JSChartResource.LatestPointFlash.BGColor;
|
|
52075
52128
|
this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
|
|
52076
52129
|
this.DrawPriority=IExtendChartPainting.DRAW_PRIORITY_ID.LEVEL_25;
|
|
52130
|
+
this.Style=1; //0=默认配置 1=图形保持一致
|
|
52077
52131
|
this.FlashCanvas;
|
|
52078
52132
|
|
|
52079
52133
|
this.SetOption=function(option)
|
|
@@ -52098,6 +52152,23 @@ function LatestPointFlashPaint()
|
|
|
52098
52152
|
this.BGRadius=g_JSChartResource.LatestPointFlash.BGRadius;
|
|
52099
52153
|
}
|
|
52100
52154
|
|
|
52155
|
+
this.GetChartColor=function()
|
|
52156
|
+
{
|
|
52157
|
+
var chart=this.HQChart.ChartPaint[0];
|
|
52158
|
+
if (!chart) return;
|
|
52159
|
+
|
|
52160
|
+
if (chart.ClassName=="ChartKLine")
|
|
52161
|
+
{
|
|
52162
|
+
this.PointColor=chart.CloseLineColor;
|
|
52163
|
+
this.BGColor=IChartDrawPicture.ColorToRGBA(chart.CloseLineColor, 0.6);
|
|
52164
|
+
}
|
|
52165
|
+
else if (chart.ClassName=="ChartMinutePriceLine")
|
|
52166
|
+
{
|
|
52167
|
+
this.PointColor=chart.Color;
|
|
52168
|
+
this.BGColor=IChartDrawPicture.ColorToRGBA(chart.Color, 0.6);
|
|
52169
|
+
}
|
|
52170
|
+
}
|
|
52171
|
+
|
|
52101
52172
|
this.Draw=function()
|
|
52102
52173
|
{
|
|
52103
52174
|
if (!this.FlashCanvas) return;
|
|
@@ -52116,6 +52187,8 @@ function LatestPointFlashPaint()
|
|
|
52116
52187
|
var point=this.HQChart.GlobalOption.LatestPoint;
|
|
52117
52188
|
if (!IFrameSplitOperator.IsNumber(point.X) || !IFrameSplitOperator.IsNumber(point.Y)) return;
|
|
52118
52189
|
|
|
52190
|
+
if (this.Style==1) this.GetChartColor();
|
|
52191
|
+
|
|
52119
52192
|
this.FlashCanvas.fillStyle=this.BGColor;
|
|
52120
52193
|
this.FlashCanvas.beginPath();
|
|
52121
52194
|
this.FlashCanvas.arc(point.X,point.Y,this.BGRadius,0,360,false);
|
|
@@ -75067,6 +75140,21 @@ function JSChartResource()
|
|
|
75067
75140
|
{
|
|
75068
75141
|
LineColor:"rgba(255,165,0,0.6)",
|
|
75069
75142
|
LineWidth:2,
|
|
75143
|
+
},
|
|
75144
|
+
|
|
75145
|
+
Title:
|
|
75146
|
+
{
|
|
75147
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`,
|
|
75148
|
+
},
|
|
75149
|
+
|
|
75150
|
+
CorssCursor:
|
|
75151
|
+
{
|
|
75152
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`
|
|
75153
|
+
},
|
|
75154
|
+
|
|
75155
|
+
Frame:
|
|
75156
|
+
{
|
|
75157
|
+
Font:`${12*GetDevicePixelRatio()}px 微软雅黑`, //刻度坐标
|
|
75070
75158
|
}
|
|
75071
75159
|
}
|
|
75072
75160
|
|
|
@@ -76749,6 +76837,18 @@ function JSChartResource()
|
|
|
76749
76837
|
if (item.Mark.LineColor) dest.Mark.LineColor=item.Mark.LineColor;
|
|
76750
76838
|
if (IFrameSplitOperator.IsNumber(item.Mark.LineWidth)) dest.Mark.LineWidth=item.Mark.LineWidth;
|
|
76751
76839
|
}
|
|
76840
|
+
if (item.Title)
|
|
76841
|
+
{
|
|
76842
|
+
if (item.Title.Font) dest.Title.Font=item.Title.Font;
|
|
76843
|
+
}
|
|
76844
|
+
if (item.CorssCursor)
|
|
76845
|
+
{
|
|
76846
|
+
if (item.CorssCursor.Font) dest.CorssCursor.Font=item.CorssCursor.Font;
|
|
76847
|
+
}
|
|
76848
|
+
if (item.Frame)
|
|
76849
|
+
{
|
|
76850
|
+
if (item.Frame.Font) dest.Frame.Font=item.Frame.Font;
|
|
76851
|
+
}
|
|
76752
76852
|
}
|
|
76753
76853
|
|
|
76754
76854
|
if (style.PopKLineChart)
|
|
@@ -82330,6 +82430,13 @@ function KLineChartContainer(uielement,OffscreenElement, cacheElement)
|
|
|
82330
82430
|
|
|
82331
82431
|
if (!bFind) return;
|
|
82332
82432
|
}
|
|
82433
|
+
|
|
82434
|
+
if (data.LatestPointFlash) //最新数据闪烁
|
|
82435
|
+
{
|
|
82436
|
+
var item=data.LatestPointFlash;
|
|
82437
|
+
if (IFrameSplitOperator.IsNumber(item.FlashCount))
|
|
82438
|
+
this.SetLatestPointFlash(item.FlashCount)
|
|
82439
|
+
}
|
|
82333
82440
|
|
|
82334
82441
|
var bindData=new ChartData();
|
|
82335
82442
|
bindData.Data=this.SourceData.Data;
|
|
@@ -159,7 +159,7 @@ function GetBlackStyle()
|
|
|
159
159
|
MultiDayBorderPen:"rgba(236,236,236,0.5)",
|
|
160
160
|
FrameSplitPen: "rgba(236,236,236,0.13)", //分割线
|
|
161
161
|
FrameSplitTextColor: "rgb(220,220,220)", //刻度文字颜色
|
|
162
|
-
FrameSplitTextFont:
|
|
162
|
+
FrameSplitTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑", //坐标刻度文字字体
|
|
163
163
|
FrameTitleBGColor: "rgb(0,0,0)", //标题栏背景色
|
|
164
164
|
OverlayIndexTitleBGColor:'rgba(0,0,0,0.7)', //叠加指标背景色
|
|
165
165
|
|
|
@@ -195,7 +195,7 @@ function GetBlackStyle()
|
|
|
195
195
|
|
|
196
196
|
CorssCursorBGColor: "rgb(43,54,69)", //十字光标背景
|
|
197
197
|
CorssCursorTextColor: "rgb(255,255,255)",
|
|
198
|
-
CorssCursorTextFont:
|
|
198
|
+
CorssCursorTextFont: 14*GetDevicePixelRatio() +"px 微软雅黑",
|
|
199
199
|
CorssCursorHPenColor: "rgb(130,130,130)", //十字光标线段颜色
|
|
200
200
|
CorssCursorVPenColor: "rgb(130,130,130)", //十字光标线段颜色
|
|
201
201
|
|