mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 21:15:15 +00:00
Don't add series to legend if series does not exist
This commit is contained in:
parent
15fbffe43a
commit
0ead7aa722
|
@ -453,16 +453,12 @@ export default class CandleChart extends Vue {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Object.entries(value).forEach(([sk, sv]) => {
|
Object.entries(value).forEach(([sk, sv]) => {
|
||||||
if (
|
|
||||||
!Array.isArray(this.chartOptions.legend) &&
|
|
||||||
this.chartOptions.legend?.data &&
|
|
||||||
Array.isArray(this.chartOptions.legend.data)
|
|
||||||
) {
|
|
||||||
this.chartOptions.legend.data.push(sk);
|
|
||||||
}
|
|
||||||
// entries per subplot
|
// entries per subplot
|
||||||
const col = this.dataset.columns.findIndex((el) => el === sk);
|
const col = this.dataset.columns.findIndex((el) => el === sk);
|
||||||
if (col > 0) {
|
if (col > 0) {
|
||||||
|
if (!Array.isArray(this.chartOptions.legend) && this.chartOptions.legend?.data) {
|
||||||
|
this.chartOptions.legend.data.push(sk);
|
||||||
|
}
|
||||||
const sp: SeriesOption = {
|
const sp: SeriesOption = {
|
||||||
name: sk,
|
name: sk,
|
||||||
type: sv.type || 'line',
|
type: sv.type || 'line',
|
||||||
|
@ -519,11 +515,7 @@ export default class CandleChart extends Vue {
|
||||||
if (Array.isArray(this.chartOptions?.series)) {
|
if (Array.isArray(this.chartOptions?.series)) {
|
||||||
this.chartOptions.series.push(sp);
|
this.chartOptions.series.push(sp);
|
||||||
}
|
}
|
||||||
if (
|
if (!Array.isArray(this.chartOptions.legend) && this.chartOptions.legend?.data) {
|
||||||
this.chartOptions.legend &&
|
|
||||||
!Array.isArray(this.chartOptions.legend) &&
|
|
||||||
this.chartOptions.legend.data
|
|
||||||
) {
|
|
||||||
this.chartOptions.legend.data.push(nameClose);
|
this.chartOptions.legend.data.push(nameClose);
|
||||||
}
|
}
|
||||||
const closeSeries: ScatterSeriesOption = {
|
const closeSeries: ScatterSeriesOption = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user