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
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:
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?