Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Curve custom range #2624

Merged
merged 13 commits into from
Dec 18, 2024
Prev Previous commit
Next Next commit
test
robertbasti committed Dec 13, 2024
commit 8c3d4bad4e686a0662d3dfe3a5a917e408f46c36
Original file line number Diff line number Diff line change
@@ -439,12 +439,12 @@ const getChartOption = (
customRange: boolean,
_refreshGraph: boolean
) => {
_refreshGraph = false;
_refreshGraph = true;
const VALUE_OFFSET_FROM_COLUMN = 0.01;
const AUTO_REFRESH_SIZE = 300;
const LABEL_MAXIMUM_LENGHT = 13;
const LABEL_NUMBER_MAX_LENGTH = 9;
if (autoRefresh) data = data.slice(-AUTO_REFRESH_SIZE); // Slice to avoid lag while streaming
if (autoRefresh && _refreshGraph) data = data.slice(-AUTO_REFRESH_SIZE); // Slice to avoid lag while streaming
const indexCurve = columns[0].columnOf.mnemonic;
const indexUnit = columns[0].columnOf.unit;
const dataColumns = columns.filter((col) => col.property != indexCurve);
Original file line number Diff line number Diff line change
@@ -64,10 +64,10 @@ export const SettingCustomRanges = (props: {
type="number"
colors={colors}
onChange={(e: ChangeEvent<HTMLInputElement>) => {
const server = ranges.find(
const range = ranges.find(
(x) => x.curve === customRange.curve
);
server.minValue = Number(e.target.value);
range.minValue = Number(e.target.value);
setRanges(ranges);
props.onChange(ranges);
}}
@@ -80,10 +80,10 @@ export const SettingCustomRanges = (props: {
type="number"
colors={colors}
onChange={(e: ChangeEvent<HTMLInputElement>) => {
const server = ranges.find(
const range = ranges.find(
(x) => x.curve === customRange.curve
);
server.maxValue = Number(e.target.value);
range.maxValue = Number(e.target.value);
setRanges(ranges);
props.onChange(ranges);
}}