feat: display only odd days on x-axis for month duration
Co-authored-by: aider (gemini/gemini-3.1-pro-preview) <aider@aider.chat>
This commit is contained in:
@@ -82,7 +82,9 @@ function useSensor(measurement, name, end, duration) {
|
|||||||
data.forEach(d => {
|
data.forEach(d => {
|
||||||
const lbl = memoConvertTZ(isDST, d.time, duration.format);
|
const lbl = memoConvertTZ(isDST, d.time, duration.format);
|
||||||
if (lbl !== lastLabel) {
|
if (lbl !== lastLabel) {
|
||||||
|
if (duration.len !== 'Month' || parseInt(lbl, 10) % 2 !== 0) {
|
||||||
ticks.push(d.time);
|
ticks.push(d.time);
|
||||||
|
}
|
||||||
lastLabel = lbl;
|
lastLabel = lbl;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -731,7 +733,9 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura
|
|||||||
data.forEach(d => {
|
data.forEach(d => {
|
||||||
const lbl = memoConvertTZ(isDST, d.time, duration.format);
|
const lbl = memoConvertTZ(isDST, d.time, duration.format);
|
||||||
if (lbl !== lastLabel) {
|
if (lbl !== lastLabel) {
|
||||||
|
if (duration.len !== 'Month' || parseInt(lbl, 10) % 2 !== 0) {
|
||||||
ticks.push(d.time);
|
ticks.push(d.time);
|
||||||
|
}
|
||||||
lastLabel = lbl;
|
lastLabel = lbl;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user