chart-fx icon indicating copy to clipboard operation
chart-fx copied to clipboard

Feature/axis name generation handle missing info

Open dedeibel opened this issue 1 year ago • 1 comments

I am suggesting this change since I noticed two "problems" with the axis label handling.

  1. If there is no axis name specified there would be a space character before the unit part e.g.: _[V] (Space replaced by _ in the example)
  2. If there was no unit specified an empty set of brackets would be used: []
  • (Often seen when people don't set a unit - not so pretty in IMO)

The change would result in the following behaviour (taken from the tests):

Axis name, unit, scale

"axis name", "axis unit", 1.    → "axis name [axis unit]"
"DeviceA", "V", 1.              → "DeviceA [V]"
"DeviceA", "V", 0.001           → "DeviceA [mV]"
"axis name", null, 1.           → "axis name"
"", "V", 1.                     → "[V]"
null, "V", 1.                   → "[V]"
"", "", 1.                      → ""
null, null, 1.                  → null

In our code we extended DefaultNumericAxis because of this. With the changes this would not be necessary.

Please consider the above suggestion for integration.

dedeibel avatar Dec 06 '24 15:12 dedeibel