Skip to content

Commit 340a7b6

Browse files
committed
The legend is moved to right-up corner
1 parent 622177f commit 340a7b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/graph_spectrum_plot.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ GraphSpectrumPlot._drawFrequencyGraph = function (canvasCtx) {
271271
canvasCtx.lineWidth = 1;
272272
canvasCtx.strokeStyle = this.curvesColors[spectrumNum];
273273
canvasCtx.moveTo(0, HEIGHT);
274-
const filterPointsCount = 100;
274+
const filterPointsCount = 200;
275275
for (let pointNum = 0; pointNum < pointsCount; pointNum++) {
276276
// Apply moving average filter at spectrum points to get visible line
277277
let filterStartPoint = pointNum - filterPointsCount / 2;
@@ -426,11 +426,11 @@ GraphSpectrumPlot._drawPowerSpectralDensityGraph = function (canvasCtx) {
426426

427427
GraphSpectrumPlot._drawLegend = function (canvasCtx, WIDTH, HEIGHT, importedCurves) {
428428
const spectrumCount = importedCurves.length,
429-
legendPosX = 0.84 * WIDTH,
430-
legendPosY = 0.6 * HEIGHT,
429+
legendPosX = WIDTH - 180,
430+
legendPosY = 50,
431431
rowHeight = 16,
432432
padding = 4,
433-
legendWidth = 0.13 * WIDTH + padding,
433+
legendWidth = 150 + padding,
434434
legendHeight = spectrumCount * rowHeight + 3 * padding,
435435
legendArea = new Path2D();
436436

0 commit comments

Comments
 (0)