Skip to content

Commit c6ecc10

Browse files
author
Павел Ахметчанов
committed
[#70] schose step for finder of boarder for SLA rect
1 parent 66d575c commit c6ecc10

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/charts/AddSlaLine.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const renderSlaPercentageLabel = ({ chartElement, value, slaProcentile, slaPosit
122122
const findDiaposonForSlaRectPosition = ({ chartElement, slaProcentile, ticsVals }) => {
123123
const maxDay = ticsVals[ticsVals.length - 1].value;
124124
const slaPosition = [0, 0];
125+
const step = maxDay < 50 ? 0.5 : 1;
125126
let pIn = 0;
126127
let day = ticsVals[0].value;
127128

@@ -132,7 +133,7 @@ const findDiaposonForSlaRectPosition = ({ chartElement, slaProcentile, ticsVals
132133
valPosition = getChartLinePosition(ticsVals, day);
133134
fProcentile = calculateSlaProcentile({ chartElement, slaPosition: valPosition });
134135

135-
day += 0.1; // for case if user set fractional number to input
136+
day += step; // for case if user set fractional number to input
136137
if (fProcentile === slaProcentile) {
137138
slaPosition[pIn] = valPosition;
138139

0 commit comments

Comments
 (0)