Skip to content
Snippets Groups Projects
Commit 981f5eca authored by Yan, Andrew N.'s avatar Yan, Andrew N.
Browse files

add data labels to median stat points

parent dde93b42
No related branches found
No related tags found
No related merge requests found
......@@ -137,18 +137,38 @@ class Hydrograph {
}
_plotMedianPoints(plot, xScale, yScale) {
plot.selectAll('circle')
plot.selectAll('medianPoint')
.data(this._medianStats)
.enter()
.append('circle')
.attr('r', '8px')
.attr('fill', 'blue')
.attr('fill', 'yellow')
.attr('x', function(d) {
return xScale(d.time);
})
.attr('y', function(d) {
return yScale(d.value);
})
.attr('cx', function(d) {
return xScale(d.time);
})
.attr('cy', function(d) {
return yScale(d.value);
});
plot.selectAll('medianPointText')
.data(this._medianStats)
.enter()
.append('text')
.text(function(d) {
return d.label;
})
.attr('x', function(d) {
return xScale(d.time) + 10;
})
.attr('y', function(d) {
return yScale(d.value);
});
}
_plotTooltips(plot, xScale, yScale) {
......
......@@ -99,7 +99,7 @@ export function parseMedianData(medianData, timeSeries) {
let median = {
time: recordDate,
value: medianDatum.p50_va,
label: `${formatTime(recordDate)}\n${medianDatum.p50_va} ${unit}`
label: `${medianDatum.p50_va} ${unit}`
};
// don't include leap days if it's not a leap year
if (!isLeapYear(recordDate.getFullYear())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment