-
Notifications
You must be signed in to change notification settings - Fork 19
MG-211 - Update time series bar chart fo fetch data from back-end #224
Conversation
02c677a
to
9555d77
Compare
b1c4bac
to
fa93291
Compare
fa93291
to
f367626
Compare
ui/web/static/js/charts.js
Outdated
from: ${this.chartData.startTime / 1000}, | ||
to: ${this.chartData.stopTime / 1000}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from: ${this.chartData.startTime / 1000}, | |
to: ${this.chartData.stopTime / 1000}, | |
from: ${this.chartData.startTime}, | |
to: ${this.chartData.stopTime}, |
90fb2ea
to
b27f358
Compare
ui/web/static/js/charts.js
Outdated
throw new Error("HTTP request failed with status: " + response.status); | ||
} | ||
const data = await response.json(); | ||
console.log(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove logs
Also make it such that aggregation is not compulsory. Check how it was changed in the line chart. Aggregation is not compulsory, but if a user selects aggregation, then they have to select interval |
ui/web/static/js/charts.js
Outdated
|
||
async function getData(barChart, chartData) { | ||
try { | ||
const apiEndpoint = "/data?channel=" + chartData.channel + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add prefix
} | ||
} | ||
toggleUpdateInterval(); | ||
aggregationTypeInput.addEventListener("change", toggleUpdateInterval); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toggleUpdateInterval();
aggregationTypeInput.addEventListener("change", toggleUpdateInterval);
what is the difference here. Since the function has been called by default in the first instance
chartData[pair[0]] = pair[1]; | ||
if (pair[0] === "startTime" || pair[0] === "stopTime") { | ||
const inputDate = new Date(pair[1]); | ||
chartData[pair[0]] = inputDate.getTime() * 1e6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r
chartData[pair[0]] = inputDate.getTime() * 1e6; | |
chartData[pair[0]] = inputDate.getTime() ; |
48cf431
to
2ab8736
Compare
@@ -226,7 +244,12 @@ <h5 class="modal-title" id="barChartModalLabel">Time Series Bar Chart</h5> | |||
let chartData = {}; | |||
let formData = new FormData(form); | |||
for (var pair of formData.entries()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (var pair of formData.entries()) { | |
for (let [name, value] of formData) { |
11d09c7
to
4ddff5e
Compare
@@ -216,31 +216,86 @@ class TimeSeriesBarChart extends Echart { | |||
}, | |||
xAxis: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xAxis: { | |
tooltip: { | |
trigger: 'axis' | |
}, | |
xAxis: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4ddff5e
to
2d275cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: felix.gateru <[email protected]>
Signed-off-by: felix.gateru <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
Signed-off-by: 1998-felix <[email protected]>
2d275cf
to
20939d2
Compare
What type of PR is this?
What does this do?
Populate the time series bar chart with data from the back-end
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Did you document any new/modified functionality?
Notes