Forum Discussion

ChesAsosa's avatar
ChesAsosa
Cloud Apps
07-03-2023
Solved

Sparkline Disappearing in Widget

Good morning, I am new to Sparklines in Blox and running into an issue where some of my sparklines will show data but will not scale so that you can see the trend line on the indicator. I have attac...
  • irismaessen's avatar
    irismaessen
    07-07-2023

    The problem is that these nulls only show up because of the groupby and apparently that will just give you those nulls (or at least I haven't found an alternative yet).

    I tried wrapping an IF statement around the formula with an ISNULL check:
    IF(ISNULL(([YourFormula]), 0, ([YourFormula])) but that still got me the same results.

    This might be worth a try (pretty hacky though):
    Blox won't let you put value filters on a widget, but if there's a value filter already *on* the widget when you make a Blox widget out of it, it appears to stay put. So.
    - Copy your Blox code somewhere (or save it as a template)
    - Change widget type to Pivot (or line/column chart)
    - Select the filter option in the formula panel for your sparkline.
    - You want a value filter, I used >0 but if you have negative values pick something else that will include all your actual possible values. Apply the filter.
    - Change widget type back to Blox and reapply your Blox design.
    - Apply the widget changes.

    This will remove the days with no data from the sparkline -- but also from the main total and any other sparklines you might have in the same widget. And it won't show the gaps. But it *will* at least show a sparkline.

    So probably if this technique is employed, it is best employed in a widget where this sparkline is isolated.