@fc-plot/ts-graph 0.24.0 → 0.24.2

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.
@@ -0,0 +1,502 @@
1
+ [
2
+ {
3
+ "id": "series_5",
4
+ "refId": "A",
5
+ "name": "",
6
+ "metric": {},
7
+ "expr": "avg(cpu_usage_idle)",
8
+ "data": [
9
+ [1701241560, "86.41565038618812"],
10
+ [1701241575, "91.88684918040855"],
11
+ [1701241590, "93.05035534841561"],
12
+ [1701241605, "89.02838020385536"],
13
+ [1701241620, "86.12729717861598"],
14
+ [1701241635, "92.39301495894664"],
15
+ [1701241650, "93.0433473918964"],
16
+ [1701241665, "91.52376824517287"],
17
+ [1701241680, "86.95503210491106"],
18
+ [1701241695, "91.97933208006174"],
19
+ [1701241710, "92.41861018546953"],
20
+ [1701241725, "91.38369832997836"],
21
+ [1701241740, "86.82251791948613"],
22
+ [1701241755, "92.1645927093775"],
23
+ [1701241770, "92.89810718541838"],
24
+ [1701241785, "91.4258846054412"],
25
+ [1701241800, "87.03014158632803"],
26
+ [1701241815, "91.90283825396227"],
27
+ [1701241830, "92.71120080814254"],
28
+ [1701241845, "91.11141430371556"],
29
+ [1701241860, "86.32712753006516"],
30
+ [1701241875, "92.20729192204914"],
31
+ [1701241890, "93.07495312412868"],
32
+ [1701241905, "89.7460127306123"],
33
+ [1701241920, "86.16056418557312"],
34
+ [1701241935, "92.3694104006657"],
35
+ [1701241950, "92.74344022157686"],
36
+ [1701241965, "91.2833611049561"],
37
+ [1701241980, "86.53159302428415"],
38
+ [1701241995, "92.27793594735671"],
39
+ [1701242010, "92.31927289168536"],
40
+ [1701242025, "91.64915255529466"],
41
+ [1701242040, "86.83429593244446"],
42
+ [1701242055, "91.73194532541781"],
43
+ [1701242070, "92.90714798577855"],
44
+ [1701242085, "91.50436899221167"],
45
+ [1701242100, "86.8494431946263"],
46
+ [1701242115, "91.99455071265777"],
47
+ [1701242130, "92.81199152704261"],
48
+ [1701242145, "91.49752253856191"],
49
+ [1701242160, "86.7971182074306"],
50
+ [1701242175, "92.32783843218692"],
51
+ [1701242190, "92.94323169725207"],
52
+ [1701242205, "90.51720411921445"],
53
+ [1701242220, "84.98019265345627"],
54
+ [1701242235, "92.18643747513676"],
55
+ [1701242250, "93.12216563250205"],
56
+ [1701242265, "91.1403322131979"],
57
+ [1701242280, "86.82216024175027"],
58
+ [1701242295, "92.23729088729486"],
59
+ [1701242310, "92.7964273942508"],
60
+ [1701242325, "91.23215958483658"],
61
+ [1701242340, "87.07319390792706"],
62
+ [1701242355, "92.17366397002635"],
63
+ [1701242370, "92.79412255335431"],
64
+ [1701242385, "91.39982471702353"],
65
+ [1701242400, "86.94952772853622"],
66
+ [1701242415, "92.08953048412367"],
67
+ [1701242430, "92.82551821891379"],
68
+ [1701242445, "91.24738399126004"],
69
+ [1701242460, "86.82542874877394"],
70
+ [1701242475, "92.40977459916434"],
71
+ [1701242490, "92.61759994720938"],
72
+ [1701242505, "91.45134470010703"],
73
+ [1701242520, "84.46486014246868"],
74
+ [1701242535, "92.28103233459021"],
75
+ [1701242550, "93.15558650258508"],
76
+ [1701242565, "91.00020229061984"],
77
+ [1701242580, "86.80906927181621"],
78
+ [1701242595, "91.83692578983792"],
79
+ [1701242610, "92.53484842883967"],
80
+ [1701242625, "90.60181501164391"],
81
+ [1701242640, "87.00673010270933"],
82
+ [1701242655, "92.06218692443258"],
83
+ [1701242670, "93.09958064837812"],
84
+ [1701242685, "91.09477858641405"],
85
+ [1701242700, "87.0257756423789"],
86
+ [1701242715, "91.65725823666611"],
87
+ [1701242730, "93.09411522463289"],
88
+ [1701242745, "91.31379458756255"],
89
+ [1701242760, "87.17160682376357"],
90
+ [1701242775, "92.14411401095283"],
91
+ [1701242790, "92.56757383776966"],
92
+ [1701242805, "91.38454610471206"],
93
+ [1701242820, "84.43852548111863"],
94
+ [1701242835, "92.27953457001709"],
95
+ [1701242850, "92.90102261302717"],
96
+ [1701242865, "91.37192570608721"],
97
+ [1701242880, "86.6775018079744"],
98
+ [1701242895, "91.81368813650442"],
99
+ [1701242910, "92.04142117218763"],
100
+ [1701242925, "90.68871491857023"],
101
+ [1701242940, "86.91713444482383"],
102
+ [1701242955, "92.08743478616113"],
103
+ [1701242970, "93.02327740674475"],
104
+ [1701242985, "91.3043697978432"],
105
+ [1701243000, "86.70810178735402"],
106
+ [1701243015, "92.09580087437364"],
107
+ [1701243030, "92.7908722034989"],
108
+ [1701243045, "91.059710051974"],
109
+ [1701243060, "86.86700424613433"],
110
+ [1701243075, "91.80452749876756"],
111
+ [1701243090, "92.99597826717581"],
112
+ [1701243105, "91.24270445630732"],
113
+ [1701243120, "85.31107651501597"],
114
+ [1701243135, "90.45823256136018"],
115
+ [1701243150, "92.98536772432017"],
116
+ [1701243165, "91.15376317332559"],
117
+ [1701243180, "86.95593413751497"],
118
+ [1701243195, "91.82028509845749"],
119
+ [1701243210, "92.38343838510461"],
120
+ [1701243225, "91.16599192750809"],
121
+ [1701243240, "86.63412545757674"],
122
+ [1701243255, "92.39245913147931"],
123
+ [1701243270, "92.77046045903786"],
124
+ [1701243285, "91.0051552389929"],
125
+ [1701243300, "86.56905013870566"],
126
+ [1701243315, "91.76830815129298"],
127
+ [1701243330, "92.38040849284947"],
128
+ [1701243345, "91.24124984272754"],
129
+ [1701243360, "86.51980380410109"],
130
+ [1701243375, "92.37874490485311"],
131
+ [1701243390, "93.17556003120163"],
132
+ [1701243405, "91.0278074589026"],
133
+ [1701243420, "86.74169171513986"],
134
+ [1701243435, "89.43620783310078"],
135
+ [1701243450, "93.20867251193775"],
136
+ [1701243465, "91.45383436253869"],
137
+ [1701243480, "86.68115628215891"],
138
+ [1701243495, "92.09319512827341"],
139
+ [1701243510, "92.79958940302761"],
140
+ [1701243525, "91.08381800563188"],
141
+ [1701243540, "86.73380970498084"],
142
+ [1701243555, "92.05858350101857"],
143
+ [1701243570, "92.47460811765329"],
144
+ [1701243585, "91.12548014281842"],
145
+ [1701243600, "86.99267130080787"],
146
+ [1701243615, "92.04826360600937"],
147
+ [1701243630, "92.91689084520858"],
148
+ [1701243645, "91.25396697154335"],
149
+ [1701243660, "86.94254010268699"],
150
+ [1701243675, "92.07255723887495"],
151
+ [1701243690, "92.89268145777407"],
152
+ [1701243705, "91.19840466623603"],
153
+ [1701243720, "86.87513066128524"],
154
+ [1701243735, "89.56746220959157"],
155
+ [1701243750, "93.09738208055958"],
156
+ [1701243765, "91.13213280598913"],
157
+ [1701243780, "87.14467763899896"],
158
+ [1701243795, "91.67273351479872"],
159
+ [1701243810, "92.50140390171386"],
160
+ [1701243825, "91.23947837143736"],
161
+ [1701243840, "86.68877858322685"],
162
+ [1701243855, "91.93118683073277"],
163
+ [1701243870, "92.91179636309775"],
164
+ [1701243885, "91.1094830401543"],
165
+ [1701243900, "86.86893391272575"],
166
+ [1701243915, "91.55004854282805"],
167
+ [1701243930, "92.60877121475541"],
168
+ [1701243945, "91.16941151574196"],
169
+ [1701243960, "86.83187700932244"],
170
+ [1701243975, "91.75008763224146"],
171
+ [1701243990, "93.25670835253689"],
172
+ [1701244005, "91.02537608018011"],
173
+ [1701244020, "86.79760223720154"],
174
+ [1701244035, "89.00095429147416"],
175
+ [1701244050, "93.06266169822275"],
176
+ [1701244065, "91.68223960834791"],
177
+ [1701244080, "86.3841229065818"],
178
+ [1701244095, "92.36052335424543"],
179
+ [1701244110, "92.64505337024723"],
180
+ [1701244125, "91.39689233170019"],
181
+ [1701244140, "87.08207890067456"],
182
+ [1701244155, "91.83345386632914"],
183
+ [1701244170, "93.00021295586848"],
184
+ [1701244185, "90.89262801917417"],
185
+ [1701244200, "86.06380118082811"],
186
+ [1701244215, "92.04942583437612"],
187
+ [1701244230, "92.87256732007522"],
188
+ [1701244245, "91.51102934808434"],
189
+ [1701244260, "86.78032044896675"],
190
+ [1701244275, "91.98081882843152"],
191
+ [1701244290, "92.77126104257215"],
192
+ [1701244305, "91.26770364038236"],
193
+ [1701244320, "86.82151528611502"],
194
+ [1701244335, "90.75734764417469"],
195
+ [1701244350, "91.83574522166563"],
196
+ [1701244365, "91.18830196203582"],
197
+ [1701244380, "86.98634454804184"],
198
+ [1701244395, "91.97328401342415"],
199
+ [1701244410, "91.83089666655641"],
200
+ [1701244425, "91.09165524834638"],
201
+ [1701244440, "86.20265128236801"],
202
+ [1701244455, "92.145570306534"],
203
+ [1701244470, "92.57355639013394"],
204
+ [1701244485, "91.0558009345629"],
205
+ [1701244500, "86.79864941758649"],
206
+ [1701244515, "91.21805104684915"],
207
+ [1701244530, "92.72645284702224"],
208
+ [1701244545, "91.14179108573478"],
209
+ [1701244560, "86.46993528943109"],
210
+ [1701244575, "91.96981036174226"],
211
+ [1701244590, "92.87453123107088"],
212
+ [1701244605, "91.28610164175531"],
213
+ [1701244620, "86.84268722537279"],
214
+ [1701244635, "91.88038159159707"],
215
+ [1701244650, "89.9507334729549"],
216
+ [1701244665, "91.66894771648887"],
217
+ [1701244680, "92.10608357084946"],
218
+ [1701244695, "92.23014104822914"],
219
+ [1701244710, "92.27884524517644"],
220
+ [1701244725, "92.82772405446372"],
221
+ [1701244740, "87.31769570223994"],
222
+ [1701244755, "92.37543370153212"],
223
+ [1701244770, "92.44276982173176"],
224
+ [1701244785, "91.1847139851617"],
225
+ [1701244800, "86.93564815396965"],
226
+ [1701244815, "92.12018956006568"],
227
+ [1701244830, "92.95264388098146"],
228
+ [1701244845, "90.84385745477479"],
229
+ [1701244860, "87.03509949787966"],
230
+ [1701244875, "92.28709379401978"],
231
+ [1701244890, "92.73153001553048"],
232
+ [1701244905, "91.41712540216975"],
233
+ [1701244920, "86.95886889034675"],
234
+ [1701244935, "92.76848566296579"],
235
+ [1701244950, "90.24678537548535"],
236
+ [1701244965, "91.44033730616981"],
237
+ [1701244980, "86.94643584828339"],
238
+ [1701244995, "92.40393775981606"],
239
+ [1701245010, "92.41568970267346"],
240
+ [1701245025, "91.50947700660592"],
241
+ [1701245040, "87.05782937133287"],
242
+ [1701245055, "91.97476597570275"],
243
+ [1701245070, "92.88270153280698"],
244
+ [1701245085, "91.01603189059624"],
245
+ [1701245100, "85.67398118800278"],
246
+ [1701245115, "92.11788184668185"],
247
+ [1701245130, "92.5548635419469"],
248
+ [1701245145, "91.47893108695932"],
249
+ [1701245160, "86.9342790664209"]
250
+ ]
251
+ },
252
+ {
253
+ "id": "series_6",
254
+ "refId": "B",
255
+ "name": "",
256
+ "metric": {},
257
+ "expr": "avg(disk_used)",
258
+ "data": [
259
+ [1701241560, "109322774528"],
260
+ [1701241575, "109323604992"],
261
+ [1701241590, "109324357632"],
262
+ [1701241605, "109327187968"],
263
+ [1701241620, "109327929344"],
264
+ [1701241635, "109328769024"],
265
+ [1701241650, "109329521664"],
266
+ [1701241665, "109330220032"],
267
+ [1701241680, "109330928640"],
268
+ [1701241695, "109331815424"],
269
+ [1701241710, "109332482048"],
270
+ [1701241725, "109333261312"],
271
+ [1701241740, "109333902336"],
272
+ [1701241755, "109334839296"],
273
+ [1701241770, "109335515136"],
274
+ [1701241785, "109336308736"],
275
+ [1701241800, "109336948736"],
276
+ [1701241815, "109337894912"],
277
+ [1701241830, "109338537984"],
278
+ [1701241845, "109339327488"],
279
+ [1701241860, "109339992064"],
280
+ [1701241875, "109340900352"],
281
+ [1701241890, "109341566976"],
282
+ [1701241905, "109366864896"],
283
+ [1701241920, "109343035392"],
284
+ [1701241935, "109343889408"],
285
+ [1701241950, "109344618496"],
286
+ [1701241965, "109345318912"],
287
+ [1701241980, "109346064384"],
288
+ [1701241995, "109346908160"],
289
+ [1701242010, "109347635200"],
290
+ [1701242025, "109348387840"],
291
+ [1701242040, "109349144576"],
292
+ [1701242055, "109349993472"],
293
+ [1701242070, "109350688768"],
294
+ [1701242085, "109351447552"],
295
+ [1701242100, "109352141824"],
296
+ [1701242115, "109353033728"],
297
+ [1701242130, "109353732096"],
298
+ [1701242145, "109354514432"],
299
+ [1701242160, "109355167744"],
300
+ [1701242175, "109356101632"],
301
+ [1701242190, "109356729344"],
302
+ [1701242205, "109387011072"],
303
+ [1701242220, "109358204928"],
304
+ [1701242235, "109359134720"],
305
+ [1701242250, "109359788032"],
306
+ [1701242265, "109360623616"],
307
+ [1701242280, "109361272832"],
308
+ [1701242295, "109364275200"],
309
+ [1701242310, "109364951040"],
310
+ [1701242325, "109365713920"],
311
+ [1701242340, "109366418432"],
312
+ [1701242355, "109367279616"],
313
+ [1701242370, "109367991296"],
314
+ [1701242385, "109368682496"],
315
+ [1701242400, "109369425920"],
316
+ [1701242415, "109370251264"],
317
+ [1701242430, "109370983424"],
318
+ [1701242445, "109371706368"],
319
+ [1701242460, "109372451840"],
320
+ [1701242475, "109373274112"],
321
+ [1701242490, "109374030848"],
322
+ [1701242505, "109374748672"],
323
+ [1701242520, "109375484928"],
324
+ [1701242535, "109376337920"],
325
+ [1701242550, "109379124224"],
326
+ [1701242565, "109379893248"],
327
+ [1701242580, "109380587520"],
328
+ [1701242595, "109381498880"],
329
+ [1701242610, "109382146048"],
330
+ [1701242625, "109382969344"],
331
+ [1701242640, "109383630848"],
332
+ [1701242655, "109384576000"],
333
+ [1701242670, "109385199616"],
334
+ [1701242685, "109386006528"],
335
+ [1701242700, "109386653696"],
336
+ [1701242715, "109387585536"],
337
+ [1701242730, "109388211200"],
338
+ [1701242745, "109388960768"],
339
+ [1701242760, "109389662208"],
340
+ [1701242775, "109390573568"],
341
+ [1701242790, "109391244288"],
342
+ [1701242805, "109391963136"],
343
+ [1701242820, "109392722944"],
344
+ [1701242835, "109393561600"],
345
+ [1701242850, "109394294784"],
346
+ [1701242865, "109395020800"],
347
+ [1701242880, "109395759104"],
348
+ [1701242895, "109396620288"],
349
+ [1701242910, "109397346304"],
350
+ [1701242925, "109398065152"],
351
+ [1701242940, "109398795264"],
352
+ [1701242955, "109399633920"],
353
+ [1701242970, "109400303616"],
354
+ [1701242985, "109401089024"],
355
+ [1701243000, "109401768960"],
356
+ [1701243015, "109402669056"],
357
+ [1701243030, "109404344320"],
358
+ [1701243045, "109405146112"],
359
+ [1701243060, "109405774848"],
360
+ [1701243075, "109406703616"],
361
+ [1701243090, "109407347712"],
362
+ [1701243105, "109408141312"],
363
+ [1701243120, "109417804800"],
364
+ [1701243135, "109409741824"],
365
+ [1701243150, "109410379776"],
366
+ [1701243165, "109411185664"],
367
+ [1701243180, "109411848192"],
368
+ [1701243195, "109412749312"],
369
+ [1701243210, "109413413888"],
370
+ [1701243225, "109414158336"],
371
+ [1701243240, "109414878208"],
372
+ [1701243255, "109415711744"],
373
+ [1701243270, "109416453120"],
374
+ [1701243285, "109417158656"],
375
+ [1701243300, "109417907200"],
376
+ [1701243315, "109418731520"],
377
+ [1701243330, "109419484160"],
378
+ [1701243345, "109420203008"],
379
+ [1701243360, "109420933120"],
380
+ [1701243375, "109421803520"],
381
+ [1701243390, "109422478336"],
382
+ [1701243405, "109423243264"],
383
+ [1701243420, "109436938240"],
384
+ [1701243435, "109424837632"],
385
+ [1701243450, "109425465344"],
386
+ [1701243465, "109426273280"],
387
+ [1701243480, "109426921472"],
388
+ [1701243495, "109427850240"],
389
+ [1701243510, "109428478976"],
390
+ [1701243525, "109429297152"],
391
+ [1701243540, "109429923840"],
392
+ [1701243555, "109430849536"],
393
+ [1701243570, "109420980224"],
394
+ [1701243585, "109421782016"],
395
+ [1701243600, "109422425088"],
396
+ [1701243615, "109423333376"],
397
+ [1701243630, "109424020480"],
398
+ [1701243645, "109424787456"],
399
+ [1701243660, "109425466368"],
400
+ [1701243675, "109426320384"],
401
+ [1701243690, "109427055616"],
402
+ [1701243705, "109427790848"],
403
+ [1701243720, "109428526080"],
404
+ [1701243735, "109429393408"],
405
+ [1701243750, "109430116352"],
406
+ [1701243765, "109430840320"],
407
+ [1701243780, "109431575552"],
408
+ [1701243795, "109432422400"],
409
+ [1701243810, "109433141248"],
410
+ [1701243825, "109433870336"],
411
+ [1701243840, "109434546176"],
412
+ [1701243855, "109435459584"],
413
+ [1701243870, "109436106752"],
414
+ [1701243885, "109436904448"],
415
+ [1701243900, "109439661056"],
416
+ [1701243915, "109440611328"],
417
+ [1701243930, "109439153152"],
418
+ [1701243945, "109439968256"],
419
+ [1701243960, "109440618496"],
420
+ [1701243975, "109441560576"],
421
+ [1701243990, "109442214912"],
422
+ [1701244005, "109443005440"],
423
+ [1701244020, "109443662848"],
424
+ [1701244035, "109444575232"],
425
+ [1701244050, "109445258240"],
426
+ [1701244065, "109446017024"],
427
+ [1701244080, "109446735872"],
428
+ [1701244095, "109447562240"],
429
+ [1701244110, "109448301568"],
430
+ [1701244125, "109449008128"],
431
+ [1701244140, "109449742336"],
432
+ [1701244155, "109452667904"],
433
+ [1701244170, "109453416448"],
434
+ [1701244185, "109454127104"],
435
+ [1701244200, "109454892032"],
436
+ [1701244215, "109455731712"],
437
+ [1701244230, "109456485376"],
438
+ [1701244245, "109457199104"],
439
+ [1701244260, "109457904640"],
440
+ [1701244275, "109458782208"],
441
+ [1701244290, "109459462144"],
442
+ [1701244305, "109460241408"],
443
+ [1701244320, "109461422080"],
444
+ [1701244335, "109462367232"],
445
+ [1701244350, "109463023616"],
446
+ [1701244365, "109463820288"],
447
+ [1701244380, "109464478720"],
448
+ [1701244395, "109465420800"],
449
+ [1701244410, "109466130432"],
450
+ [1701244425, "109466968064"],
451
+ [1701244440, "109467630592"],
452
+ [1701244455, "109468562432"],
453
+ [1701244470, "109469196288"],
454
+ [1701244485, "109469965312"],
455
+ [1701244500, "109470642176"],
456
+ [1701244515, "109471526912"],
457
+ [1701244530, "109472247808"],
458
+ [1701244545, "109472963584"],
459
+ [1701244560, "109503652864"],
460
+ [1701244575, "109508399104"],
461
+ [1701244590, "109509136384"],
462
+ [1701244605, "109509852160"],
463
+ [1701244620, "109510597632"],
464
+ [1701244635, "109511447552"],
465
+ [1701244650, "109512205312"],
466
+ [1701244665, "109512923136"],
467
+ [1701244680, "109495563264"],
468
+ [1701244695, "109495838720"],
469
+ [1701244710, "109496035328"],
470
+ [1701244725, "109479628800"],
471
+ [1701244740, "109480826880"],
472
+ [1701244755, "109481614336"],
473
+ [1701244770, "109482322944"],
474
+ [1701244785, "109483033600"],
475
+ [1701244800, "109483776000"],
476
+ [1701244815, "109482949632"],
477
+ [1701244830, "109484748800"],
478
+ [1701244845, "109485414400"],
479
+ [1701244860, "109486125056"],
480
+ [1701244875, "109484092416"],
481
+ [1701244890, "109484801024"],
482
+ [1701244905, "109485500416"],
483
+ [1701244920, "109486209024"],
484
+ [1701244935, "109487077376"],
485
+ [1701244950, "109487733760"],
486
+ [1701244965, "109488527360"],
487
+ [1701244980, "109489170432"],
488
+ [1701244995, "109490085888"],
489
+ [1701245010, "109490747392"],
490
+ [1701245025, "109491554304"],
491
+ [1701245040, "109492199424"],
492
+ [1701245055, "109493133312"],
493
+ [1701245070, "109493756928"],
494
+ [1701245085, "109494544384"],
495
+ [1701245100, "109495241728"],
496
+ [1701245115, "109496105984"],
497
+ [1701245130, "109496782848"],
498
+ [1701245145, "109497535488"],
499
+ [1701245160, "109498244096"]
500
+ ]
501
+ }
502
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fc-plot/ts-graph",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "scripts": {
5
5
  "commit": "npx git-cz",
6
6
  "compile": "fetk run compile",
package/src/index.ts CHANGED
@@ -247,7 +247,7 @@ export default class TsGraph {
247
247
  if (this.options.yAxis.visible) {
248
248
  this.yAxis.draw(this.yScales);
249
249
  }
250
- if (this.options.yAxis2.visible && this.options.yAxis2.matchName) {
250
+ if (this.options.yAxis2.visible && this.options.yAxis2.matchRefId) {
251
251
  this.yAxis2.draw(this.y2Scales);
252
252
  }
253
253
  if (redrawLegend) {
@@ -569,8 +569,8 @@ export default class TsGraph {
569
569
  // get axis domain
570
570
  if (
571
571
  yAxis2.visible &&
572
- yAxis2.matchName &&
573
- yAxis2.matchName === serie.name
572
+ yAxis2.matchRefId &&
573
+ yAxis2.matchRefId === serie.refId
574
574
  ) {
575
575
  if (y2min < y) {
576
576
  y2min = y;
@@ -601,7 +601,7 @@ export default class TsGraph {
601
601
  // 如果缩放至没有数据点(无法计算出 ymin 和 ymax),则不更新 domain
602
602
  if (ymin !== -Infinity && ymax !== Infinity) {
603
603
  this.yAxis.setDomain(this.yScales, { ymin, ymax });
604
- if (yAxis2.visible && yAxis2.matchName) {
604
+ if (yAxis2.visible && yAxis2.matchRefId) {
605
605
  this.yAxis2.setDomain(this.y2Scales, { y2min, y2max });
606
606
  }
607
607
  }
@@ -790,8 +790,8 @@ export default class TsGraph {
790
790
  if (typeof y === "number" && !isNaN(y)) {
791
791
  if (
792
792
  yAxis2.visible &&
793
- yAxis2.matchName &&
794
- yAxis2.matchName === serie.name
793
+ yAxis2.matchRefId &&
794
+ yAxis2.matchRefId === serie.refId
795
795
  ) {
796
796
  if (typeof y2min !== "number" || y < y2min) {
797
797
  y2min = y;
@@ -896,7 +896,7 @@ export default class TsGraph {
896
896
  this.yAxis = yAxis;
897
897
  this.yScales = yAxis.init();
898
898
 
899
- if (this.options.yAxis2.visible && this.options.yAxis2.matchName) {
899
+ if (this.options.yAxis2.visible && this.options.yAxis2.matchRefId) {
900
900
  const yAxis2 = new YAxis2(this.options, this.backContext);
901
901
  this.yAxis2 = yAxis2;
902
902
  this.y2Scales = yAxis2.init();
package/src/interface.ts CHANGED
@@ -82,7 +82,7 @@ export type YAxis = {
82
82
  plotLines: PlotLine[];
83
83
  plotLinesFixed?: boolean;
84
84
  tickValueFormatter?: (value: number) => string;
85
- matchName?: string; // 用于匹配 y 轴,如果不填则默认匹配第一个 y 轴
85
+ matchRefId?: string; // 用于匹配 y 轴,如果不填则默认匹配第一个 y 轴
86
86
  };
87
87
 
88
88
  export type SerieDataItemMarker = {
@@ -98,6 +98,7 @@ export type SerieDataItem = {
98
98
  };
99
99
 
100
100
  export interface Serie {
101
+ refId: string;
101
102
  name: string;
102
103
  color: string;
103
104
  visible: boolean;
package/src/line.ts CHANGED
@@ -38,10 +38,10 @@ export default class Line {
38
38
  const x = xScales(new Date(xVal));
39
39
  return x;
40
40
  };
41
- const yAccessor = (d: SerieDataItem, ykey: any, serieName: string) => {
41
+ const yAccessor = (d: SerieDataItem, ykey: any, refId: string) => {
42
42
  const val = d[ykey];
43
43
  const yScalesFunc =
44
- yAxis2.visible && yAxis2.matchName && serieName === yAxis2.matchName
44
+ yAxis2.visible && yAxis2.matchRefId && refId === yAxis2.matchRefId
45
45
  ? y2Scales
46
46
  : yScales;
47
47
  if (typeof val === "number" && !isNaN(val)) {
@@ -78,7 +78,7 @@ export default class Line {
78
78
  .x(xAccessor)
79
79
  .y0((d: SerieDataItem) => {
80
80
  if (ykey2 && ykey2 in d) {
81
- return yAccessor(d, ykey, serie.name);
81
+ return yAccessor(d, ykey, serie.refId);
82
82
  }
83
83
  if (xAxis.visible) {
84
84
  return height - xAxis.tickpadding - xAxis.labels.fontSize - 5;
@@ -87,9 +87,9 @@ export default class Line {
87
87
  })
88
88
  .y1((d: SerieDataItem) => {
89
89
  if (ykey2 && ykey2 in d) {
90
- return yAccessor(d, ykey2, serie.name);
90
+ return yAccessor(d, ykey2, serie.refId);
91
91
  }
92
- return yAccessor(d, ykey, serie.name);
92
+ return yAccessor(d, ykey, serie.refId);
93
93
  })
94
94
  .defined(definedAccessor)
95
95
  .context(ctx);
@@ -115,7 +115,7 @@ export default class Line {
115
115
  .line()
116
116
  .x(xAccessor)
117
117
  .y((d: SerieDataItem) => {
118
- return yAccessor(d, ykey, serie.name);
118
+ return yAccessor(d, ykey, serie.refId);
119
119
  })
120
120
  .defined(definedAccessor)
121
121
  .context(ctx);
package/src/tooltip.ts CHANGED
@@ -109,7 +109,7 @@ export default class Tooltip {
109
109
 
110
110
  nearestPoints = tempNearestPoints.map((item: any) => {
111
111
  const yScalesFunc =
112
- yAxis2.visible && yAxis2.matchName && item.name === yAxis2.matchName
112
+ yAxis2.visible && yAxis2.matchRefId && item.refId === yAxis2.matchRefId
113
113
  ? y2Scales
114
114
  : yScales;
115
115
  return {