Skip to content

[Bug] Mixed Timeseries Chart value labels use the wrong Y-axis formatter #40419

@innovark37

Description

@innovark37

Bug description

In the Mixed Timeseries Chart, value labels are formatted using the wrong Y-axis formatter when the chart contains series assigned to different Y axes.

For example, Query A is configured as a line chart and uses the secondary Y-axis, while Query B is configured as a bar chart and uses the primary Y-axis.

If a number format is set for the primary Y-axis, that format is correctly applied to the primary Y-axis labels, but it is incorrectly applied to the value labels of the line chart from Query A instead of the bar chart from Query B.

The same issue happens in the opposite direction: if a number format is set for the secondary Y-axis, it is correctly applied to the secondary Y-axis labels, but it is incorrectly applied to the value labels of the bar chart from Query B instead of the line chart from Query A.

Tooltip values are formatted correctly, so the issue seems to affect only the value labels shown directly on the chart.

How to reproduce the bug

  1. Create a Mixed Timeseries Chart.
  2. Configure Query A as a line chart.
  3. Configure Query B as a bar chart.
  4. Assign Query A to the secondary Y-axis.
  5. Assign Query B to the primary Y-axis.
  6. Enable value labels/markers for the series (checkbox "Show Values").
  7. Set y-axis format for the primary Y-axis, for example .2%.
  8. Observe the chart.

Actual results

When the primary Y-axis format is set:

  • the left Y-axis tick labels are formatted correctly;
  • the value labels/markers on the line chart are formatted using the primary Y-axis format;
  • the bar chart value labels are not formatted with the primary Y-axis format.

When the secondary Y-axis format is set:

  • the right Y-axis tick labels are formatted correctly;
  • the value labels/markers on the bar chart are formatted using the secondary Y-axis format;
  • the line chart value labels are not formatted with the secondary Y-axis format.

The tooltip formatting is correct for both queries.

Expected results

Value labels/markers should use the formatter that corresponds to the Y-axis assigned to their own query/series.

In this setup:

  • Query A / line chart uses the secondary Y-axis, so its value labels should use the secondary Y-axis format.
  • Query B / bar chart uses the primary Y-axis, so its value labels should use the primary Y-axis format.

Tooltip formatting should remain unchanged, since it already appears to work correctly.

Screenshots/recordings

In this chart, the primary Y-axis is displayed on the left side of the chart, and the secondary Y-axis is displayed on the right side.

Image

The issue is clearly visible when the tooltip is displayed: the tooltip shows the correct formatting for each series, while the value labels on the chart use the wrong Y-axis formatter.
Image

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions