Skip to content

Commit

Permalink
Merge pull request #54 from sophie0730/develop
Browse files Browse the repository at this point in the history
v0.3.1
  • Loading branch information
sophie0730 authored Jan 15, 2024
2 parents b07e933 + b7af52d commit 64f5bea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/script/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,19 @@ export async function updateChart(item, time) {

const { chart } = charts[chartId];

if (chartId.includes('Max')) return;

chart.data.labels = times;

if (tags && tags[0] !== undefined) {
const tag = tags[0];
const groupData = groupByTag(responseData, tag);

chart.data.datasets.forEach((dataset) => {
if (groupData[dataset.label]) {
const key = (dataset.label).split(' ')[1];
if (groupData[key]) {
// eslint-disable-next-line no-param-reassign
dataset.data = groupData[dataset.label].map((entry) => entry._value);
dataset.data = groupData[key].map((entry) => entry._value);
}
});
} else {
Expand Down

0 comments on commit 64f5bea

Please sign in to comment.