Blueforcer / awtrix3

Custom firmware for the Ulanzi Smart Pixel clock or self made awtrix. Getting started is easy as 1-2-3
https://blueforcer.github.io/awtrix3/
Other
1.42k stars 112 forks source link

[FEATURE REQUEST] Bar Chart Background/Track Color #577

Open yatil opened 4 months ago

yatil commented 4 months ago

Feature Request

Describe the solution / feature you'd like

When plotting out a bar chart where many values can be zero, it helps glanceability to see where the tracks of the bars would be, it also helps with determining the relative value, especially when using fixed values.

Describe alternatives you've considered

My current alternative is to draw gray lines behind the bar chart. The chart is rendered on top of the drawing, so there is an illusion of having tracks there:

{
  "icon": "863",
  "autoscale": false,
  "draw": [
    { "dl": [ 9, 0,  9, 8, "#333333"] },
    { "dl": [11, 0, 11, 8, "#333333"] },
    { "dl": [13, 0, 13, 8, "#333333"] },
    { "dl": [15, 0, 15, 8, "#333333"] },
    { "dl": [17, 0, 17, 8, "#333333"] },
    { "dl": [19, 0, 19, 8, "#333333"] },
    { "dl": [21, 0, 21, 8, "#333333"] },
    { "dl": [23, 0, 23, 8, "#333333"] },
    { "dl": [25, 0, 25, 8, "#333333"] },
    { "dl": [27, 0, 27, 8, "#333333"] },
    { "dl": [29, 0, 29, 8, "#333333"] }
  ],
  "color": [73, 189, 254],
  "bar": [
    {{ (states('sensor.kmw_forecast_0_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_1_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_2_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_3_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_4_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_5_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_6_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_7_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_8_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_9_prec')  | float) | round(0, "ceil") }},
    {{ (states('sensor.kmw_forecast_10_prec') | float) | round(0, "ceil") }}
  ]
}

And while that is feasible to do with a known number of values, it gets harder otherwise. In addition, choosing the colors wisely and inverting the values for the bars would allow bar charts that are anchored to the top of the display.

Additional context

Here are screenshots without and with “tracks”:

Precipitation forecast with just one single blue pixel at the bottom right of the display Precipitation forecast with clear lines for each bar and the last bar has just one single blue pixel at the bottom right

Thanks for your consideration of this Feature Request!