Axis limits: is the inline editor the right mechanism?

Open
#86 0 comments 0 reactions 1 assignee View on GitHub

@mrcsin is already working on this.

Since Sep 10, 2026.

Assessment

This issue has not been assessed yet.

Description

question

The question

Clicking the Y axis opens a small text box floating over the plot at the click point. It works, and it feels like a workaround. Is there a native mechanism that does this properly?

What it is today

  • A TextBox named AxisBoundEditor, hidden, sitting in a Panel over the plot and positioned by setting its margin to the click coordinates (Chart/TrendChartView.axaml:30-34, Chart/TrendChartView.axaml.cs:207-216).
  • The click is resolved against the axis region before anything else and handed to the router (Chart/TrendChartView.axaml.cs:158-160, Chart/ChartPressRouter.cs:14-24). Upper half of the axis edits the maximum, lower half the minimum (Chart/ChartAxisRegion.cs:74-77), and a double click autoscales instead.
  • Enter commits, parsing with the current culture, swapping inverted bounds (Chart/ChartAxisEdit.cs:5-14) and switching the pen to manual. Escape or losing focus dismisses it.
  • Only the active pen's axis is clickable (Chart/TrendChartViewModel.cs:107-110).

The pieces are separated properly: the hit test, the seed and the swap are pure and unit-tested. The awkward part is the presentation, a manually positioned control over the canvas, plus a double binding with no validation, so a non-numeric entry fails silently.

What to look at

  • Avalonia's Popup or Flyout anchored to the pointer, which is the native answer to a floating editor and handles placement, light dismiss and focus without arithmetic on margins.
  • NumericUpDown instead of a bare TextBox, which brings parsing, a format and range clamping.
  • Whether the editor belongs on the axis at all, once the toolbar gains a proper scale group (#82) and every pen carries a stored range (#65). Three ways to set the same two numbers is two too many, and docs/architecture/trend-interaction.md:73-74 says the duplication with the toolbar is deliberate.

An answer, not a rewrite. If a popup is the mechanism, the change is small and the pure parts stay as they are.

Dominant language
C#
Stars
0
Forks
0
Avg merge
18m
Merged PRs (30d)
42

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Semiteq/SemiPlot

All issues in Semiteq/SemiPlot

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.