Loss of values when unchecking a data feed

Hi,
sorry if I’m not using the correct terms.
I have a chart in a dashboard tracking 3 data series. When I hover the cursor over it, I get the values at the cursor position for all three series. Depending on the value I uncheck by clicking on it below the chart, the values no longer appear at all or only partially. They come back a little when moving to the edges of the chart but not always.
I don’t know if this error has already been reported and if it’s easy to fix.




Thank you for your help

Hi @tiboys,

Thanks for the feedback, I’ve never seen that :stuck_out_tongue:

When you say « the values », what do you mean? Are you talking about the legend that appears overlaid on the chart?

Is the issue having those small blue/red/green dots without text?

Yes, I’m indeed talking about the comments and values next to each bubble in the window that appears as an overlay on the chart.
I have the same problem on every chart, even with only 2 values.
:grimacing:

1 Like

@Terdious FYI there’s a small issue noticed by @tiboys on the tooltip :slight_smile:

I think you were the one who developed this part!

Oh yes, indeed!!
I’ll try to look into that!!

Thanks @tiboys for the report.

2 Likes

Well, in my defense, it obviously doesn’t come from my change ^^
It seems this part is what’s causing the issue:

        formatter: function(value) {
          if (Math.abs(value) \u003c 1) {
            return value; // For very low values, like crypto prices, use the normal value
          } else {
            console.log('value', value);
            return value.toFixed(2); // 2 decimal places for other values
          }
        }
      }

Because there was no condition for values that are not numbers. And when we want to hide a result, Apex still goes in there and sends a value=undefined => It breaks on .toFixed(2).

I just added a condition: if (Math.abs(value) \u003c 1 || isNaN(value)) if that works for you, I’ll send the PR @pierre-gilles.

No more issues:

1 Like

Well spotted! :slight_smile:

Perfect!

It’s good !!

3 Likes

Thank you very much for the fix @Terdious

1 Like

@Terdious Thanks for the PR !
Since I’m modifying the function in another PR, I’ve incorporated your fix into my PR :slight_smile:

1 Like

Perfect !!

1 Like

It’s merged and will be part of the next Gladys release!

4 Likes

Great, thanks :+1: