Skip to content

Feature/axis and line options - #144

Open
PA (EquinetPaul) wants to merge 5 commits into
microsoft:mainfrom
EquinetPaul:feature/axis-and-line-options
Open

Feature/axis and line options#144
PA (EquinetPaul) wants to merge 5 commits into
microsoft:mainfrom
EquinetPaul:feature/axis-and-line-options

Conversation

@EquinetPaul

Copy link
Copy Markdown

Four formatting options for the chart axes and lines. Each is a self-contained
commit with its own version bump, and each defaults to the current behaviour, so
an existing report renders unchanged after the merge.

  • 3.1.2.0Label Area Sizing (Auto / Fixed) on both Y axes: reserves a fixed
    pixel width for the label area, so stacked visuals keep their plot areas aligned
    when a filter changes the magnitude of the displayed values.
  • 3.1.3.0Scatter added to Line > Type: renders each data point as a
    standalone circle instead of a connecting path.
  • 3.1.4.0Min / Max on the X axis: pins the axis range instead of fitting
    it to the data, mirroring what the Y axis cards already offer.
  • 3.1.5.0Zoom Slider card: a zoom slider on the X axis, the Y axis or both,
    narrowing the axis to the range kept between its two handles.

@EquinetPaul

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Adds a Label Area Sizing option (Auto / Fixed) to the Y axis and the
secondary Y axis. Auto keeps the upstream behaviour of sizing the label
area from the rendered labels. Fixed reserves exactly the configured
pixel width (clamped to half of the viewport so the plot area cannot
collapse on small tiles), so stacked visuals keep their plot areas
aligned when filters change the magnitude of the displayed values.
Labels wider than the reserved area are ellipsised through the existing
getTailoredTextOrDefault helper.
Adds a third value to the Line > Type dropdown that renders each data
point as a standalone circle instead of a connecting path. The new
ScatterComponent is a sibling of LineComponent and AreaComponent behind
the existing ComboComponent dispatch, and reuses the current value dot
sizing (thickness * radius factor) and per-point colors, so KPI color
segments, selection, highlight and high contrast keep working unchanged.
Points without a value are skipped rather than interpolated over.

The line shape settings that cannot apply to standalone points
(interpolation and line style) are hidden when Scatter is selected.
Pins the X axis range instead of fitting it to the data, mirroring what
the Y axis cards already offer. The boundaries are applied to the axis
representation just before the scale is built, the same way postProcess
applies the Y boundaries: an empty setting keeps the computed bound and
an inverted pair is reordered so the scale never receives a reversed
domain.

The input matches the axis type - numeric fields on a numeric axis, date
fields on a date axis, neither on a categorical axis, whose domain is a
list of categories rather than a range. Date boundaries are typed as
text because the formatting API exposes no date property type; an entry
that cannot be read as a date is ignored so a typo falls back to the
computed bound instead of collapsing the axis.
Adds a Zoom Slider formatting card, off by default, that shows a zoom
slider on the X axis, the Y axis or both. Each slider narrows its axis
to the range kept between its two handles, applied to the domain next to
the boundaries the author pinned, so zooming stays relative to the axis
actually on screen. The X axis slider is offered only on a date or a
numeric axis: a categorical axis has no range to narrow, its domain
being the list of categories. The guard sits both in the pane and at
render time, since the field can be swapped for a text column while the
setting stays on.

Each slider spans the drawing area rather than the plot container, and
its track is inset by a handle radius so a handle at either end stays
inside the slider. The zoom is view state: it lives in the visual across
renders, is never persisted, and resets whenever Power BI pushes an
update. The chart is rebuilt when a drag ends rather than on every
pointer move, since a rebuild re-runs the whole data pipeline.

Also confines the chart marks to the drawing area. A narrowed range
still maps every point through the scale, so the points outside it land
far beyond the drawing area, and nothing clipped that: the chart SVG is
set to overflow: visible and the only clipping boundary is the plot,
which the Y axis lives inside. The marks were painted across the Y axis
labels and out to the edge of the tile - 1428 px left of the plot at
1024x768 with a pinned axis, 362 px at 300x200 after one drag. The clip
covers the drawing area grown by the margin reserved for dot radii, and
applies to the marks only, so the labels, the hover dots, the vertical
line and the clear catcher keep their behaviour. It guards every way the
range can be narrowed, including the Y axis Min/Max the visual already
offered, where the overflow was a pre-existing defect.
@EquinetPaul
PA (EquinetPaul) force-pushed the feature/axis-and-line-options branch from f72165e to d2ced2b Compare August 16, 2026 10:33
@EquinetPaul

Copy link
Copy Markdown
Author

Note on the version bumps: each commit bumps package.json / package-lock.json and adds a matching CHANGELOG.md entry
If you would rather own versioning at release time, I can to drop the bumps and keep only the changelog entries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant