Skip to content

Data Graph misrenders when trackAgainstAverage is set without showAverageData #601

Description

@mairas

widget-data-graph reads trackAgainstAverage without checking whether the average series exists at all. With a stored showAverageData = false and trackAgainstAverage = true, the widget renders two ways that contradict what is on screen:

  • applyTitleAndAnnotationValues (widget-data-graph.component.ts:839) puts point.data.sma in the widget's big reading. The rolling stats are computed for every point regardless of the toggle, so the number is smoothed while no smoothed line is drawn.
  • createDatasets gives the Value dataset borderWidth: 0 and a fill, because it expects the Average dataset to supply the line. That dataset is never created, so the graph shows a shaded band and no line.

The same unguarded read appears in applyDynamicTrackAverageStyling and in the theme-colour paths around lines 636-762 — roughly ten call sites. The fix is to derive the effective flag once (trackAgainstAverage && showAverageData) and use it everywhere, with a spec for the mismatched pair.

The pair is not in the seed config, and after #600 the settings dialog resets it on open, so new configs cannot produce it. Existing stored dashboards can still carry it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions