Modifying scalar bar value labels

I need to apply a unit conversion to the numeric labels displayed with the scalar bar. I tried subclassing the scalar bar actor and overriding the EditAnnotations method, but there are no annotations to edit when the method is called. It seems to depend on how the underlying lookup table is configured. Is there a better way to do this? Do I need to explicitly annotate the lookup table?

1 Like

The solution I ultimately came up with was to create a custom scalar bar class and override the method that creates the labels (LayoutTicks). Unfortunately that method does a lot of other work, so I copied it verbatim from the base class and added the unit conversion. It would be nice if there were a hook in that method akin to EditAnnotations.

For those interested, here is what did not work:

  1. Overriding EditAnnotations. See the original post.
  2. Explicitly annotating the lookup table. Technically this worked, but annotations and labels are different things and are displayed independently by the scalar bar.
  3. Creating a custom lookup table to intercept Get/SetRange, perform the conversions, and forward to Get/SetTableRange. This fixed the labels but broke the colors, which was obvious in hindsight.