diff --git a/ui/app/components/stats-time-series.js b/ui/app/components/stats-time-series.js index d8363ed8f..401b6baf1 100644 --- a/ui/app/components/stats-time-series.js +++ b/ui/app/components/stats-time-series.js @@ -15,6 +15,10 @@ export default class StatsTimeSeries extends Component { return d3Format.format('.1~%'); } + get useDefaults() { + return this.args.useDefaults != null ? this.args.useDefaults : true; + } + // Specific a11y descriptors get description() { const data = this.args.data; @@ -44,7 +48,7 @@ export default class StatsTimeSeries extends Component { } yScale(data, xAxisOffset) { - const yValues = (data || []).mapBy('percent'); + const yValues = (data || []).mapBy(this.args.dataProp ? 'percentStack' : 'percent'); let [low, high] = [0, 1]; if (yValues.compact().length) { diff --git a/ui/app/templates/components/stats-time-series.hbs b/ui/app/templates/components/stats-time-series.hbs index 1d53b65d9..21e854b75 100644 --- a/ui/app/templates/components/stats-time-series.hbs +++ b/ui/app/templates/components/stats-time-series.hbs @@ -1,26 +1,31 @@ <:svg as |c|> - + {{#if this.useDefaults}} + + {{/if}} {{yield c to="svg"}} <:after as |c|> - -
  • - {{datum.formattedX}} - {{datum.formattedY}} -
  • -
    + {{#if this.useDefaults}} + +
  • + {{datum.formattedX}} + {{datum.formattedY}} +
  • +
    + {{/if}} {{yield c to="after"}}