0

I am using the SPARKLINE function to display a bars graphic within a cell, using the optional parameters lowcolor and ymin. The idea behind lowcolor is to be able to identify the lowest value with a specific color, for instance for the formula

=SPARKLINE(QUERY(GoogleFinance("FB", "price", TODAY()-60, TODAY(), "daily"), "SELECT Col2"), {"charttype","column";"color", "#4147BF"; "highcolor","green";"lowcolor","red"})

I would get

enter image description here

Which isn't exactly very useful for me, as the lowest value is hardly visible.

So I added the ymin optional parameter to the above formula (in the example I just simplified it with a hardcoded value, but in my real sheet is calculated)

=SPARKLINE(QUERY(GoogleFinance("FB", "price", TODAY()-60, TODAY(), "daily"), "SELECT Col2"), {"charttype","column";"color", "#4147BF"; "highcolor","green";"lowcolor","red"; "ymin", 100})

Whichs gives me:

enter image description here

And that part is working OK, the min value of the Y axis is now set to 100, instead of the minimum value in the dataset. The problem is that the lowest bar in the dataset is not colored. I understand that Google Sheets is mixing up the min value of the dataset with that of the Y axis.

Would there be any way to be able to color the minimum bar of the dataset and still be able to set the ymin parameter?

1 Answer 1

1

I don't know if that is realy possible, but what about a result like this? sparkline

the cell below has the same sparkline formula but with "charttype", "winloss"

1
  • That's clever, it achieves the goal of identifying the lowest value at a glance. with the drawback of having to use a second row, but I might end up implementing this.
    – kerzek
    Mar 20, 2022 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.