mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 02:11:57 +00:00
Dnn't add series to main plot if they are not in the column
This commit is contained in:
parent
2e0978e20a
commit
d7af1a303d
|
@ -312,25 +312,29 @@ export default class CandleChart extends Vue {
|
|||
if ('main_plot' in this.plotConfig) {
|
||||
Object.entries(this.plotConfig.main_plot).forEach(([key, value]) => {
|
||||
const col = this.dataset.columns.findIndex((el) => el === key);
|
||||
if (options.legend && options.legend.data) {
|
||||
options.legend.data.push(key);
|
||||
}
|
||||
const sp: echarts.EChartOption.Series = {
|
||||
name: key,
|
||||
type: value.type || 'line',
|
||||
xAxisIndex: 0,
|
||||
yAxisIndex: 0,
|
||||
itemStyle: {
|
||||
color: value.color,
|
||||
},
|
||||
encode: {
|
||||
x: colDate,
|
||||
y: col,
|
||||
},
|
||||
showSymbol: false,
|
||||
};
|
||||
if (options.series) {
|
||||
options.series.push(sp);
|
||||
if (col > 1) {
|
||||
if (options.legend && options.legend.data) {
|
||||
options.legend.data.push(key);
|
||||
}
|
||||
const sp: echarts.EChartOption.Series = {
|
||||
name: key,
|
||||
type: value.type || 'line',
|
||||
xAxisIndex: 0,
|
||||
yAxisIndex: 0,
|
||||
itemStyle: {
|
||||
color: value.color,
|
||||
},
|
||||
encode: {
|
||||
x: colDate,
|
||||
y: col,
|
||||
},
|
||||
showSymbol: false,
|
||||
};
|
||||
if (options.series) {
|
||||
options.series.push(sp);
|
||||
}
|
||||
} else {
|
||||
console.log(`element ${key} for main plot not found in columns.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user