Skip to content

Commit

Permalink
Merge pull request #801 from thanhlmm/fix-export-missing-bg-color
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov authored Jul 30, 2021
2 parents db1c243 + beabb57 commit 71b0720
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/chart-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class ChartWidget implements IDestroyable {
const image = this._timeAxisWidget.getImage();
ctx.drawImage(image, targetX, targetY, size.w, size.h);
if (this._isRightAxisVisible()) {
targetX = firstPane.getSize().w;
targetX += firstPane.getSize().w;
drawStub('right');
ctx.restore();
}
Expand Down
16 changes: 16 additions & 0 deletions tests/e2e/graphics/test-cases/take-screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,37 @@ function runTestCase(container) {
timeScale: {
barSpacing: 20,
},
layout: {
backgroundColor: '#fff',
},
leftPriceScale: {
visible: true,
scaleMargins: {
top: 0.75,
bottom: 0,
},
},
rightPriceScale: {
visible: true,
},
});

const mainSeries = chart.addCandlestickSeries({
drawBorder: true,
borderColor: 'blue',
priceScaleId: 'left',
});

mainSeries.setData(generateData());

const secondarySeries = chart.addCandlestickSeries({
drawBorder: true,
borderColor: 'blue',
priceScaleId: 'right',
});

secondarySeries.setData(generateData());

const histSeries = chart.addHistogramSeries({
lineWidth: 1,
color: '#ff0000',
Expand All @@ -82,5 +97,6 @@ function runTestCase(container) {
screenshot.style.top = '260px';

const parent = container.parentNode;
parent.style.backgroundColor = 'yellow';
parent.appendChild(screenshot);
}

0 comments on commit 71b0720

Please sign in to comment.