Dynamic plotsizing depending on subplot size

This commit is contained in:
Matthias 2020-08-09 14:34:50 +02:00
parent bc2d91a08a
commit b6ffbc512f

View File

@ -92,6 +92,11 @@ export default class CandleChart extends Vue {
const colBuyData = this.dataset.columns.findIndex((el) => el === '_buy_signal_open'); const colBuyData = this.dataset.columns.findIndex((el) => el === '_buy_signal_open');
const colSellData = this.dataset.columns.findIndex((el) => el === '_sell_signal_open'); const colSellData = this.dataset.columns.findIndex((el) => el === '_sell_signal_open');
const subplotCount =
'subplots' in this.plotConfig ? Object.keys(this.plotConfig.subplots).length : 0;
console.log(`subplotcount: ${subplotCount}`);
// Always show ~250 candles max as starting point // Always show ~250 candles max as starting point
const startingZoom = (1 - 250 / this.dataset.length) * 100; const startingZoom = (1 - 250 / this.dataset.length) * 100;
@ -169,7 +174,7 @@ export default class CandleChart extends Vue {
{ {
left: MARGINLEFT, left: MARGINLEFT,
right: MARGINRIGHT, right: MARGINRIGHT,
height: '60%', height: subplotCount === 0 ? '70%' : '60%',
// top: '0px', // top: '0px',
// bottom: '150px', // bottom: '150px',
}, },
@ -177,7 +182,7 @@ export default class CandleChart extends Vue {
// Volume // Volume
left: MARGINLEFT, left: MARGINLEFT,
right: MARGINRIGHT, right: MARGINRIGHT,
top: '70%', top: subplotCount === 0 ? '80%' : '70%',
height: '10%', height: '10%',
}, },
], ],