Belchertown graph in different colors

109 views
Skip to first unread message

Stefan Gliessmann

unread,
Mar 17, 2025, 9:01:04 AM3/17/25
to weewx-user
Hello -

I am wondering if it is possible to have the graph in different colors depending on the value.

I tried something like this:

    [[chartBMSCurrent]]

        title = BMS Main Current

        width = 100%

        connectNulls = true

        [[[Imain]]]

            zIndex = 1

            name = "I main"

                colors_enabled = 1

                color1_position = < -1

                color1 = "#ff2c2c"

                color2_position = < 1

                color2 = "#fafa2a"

                color3_position = > 1.1

                color3 = "#3cb043"


But that did not yield my wish ...

Is it actually possible?

TIA,
Stefan

MaKi68

unread,
Mar 19, 2025, 4:43:46 AM3/19/25
to weewx-user

Hello,

Here https://github.com/poblabs/weewx-belchertown/wiki/Belchertown-Charts-Documentation you can find:

Color can be set to change based on the value being displayed. You can specify up to 7 colors. Both the color and the color position must be specified. Once the value rises above a given position, the corresponding color will be set. In this example, the wind speed has exceeded color7_position, so color7 is displayed. If the wind speed were 24 MPH, color4 would be used. color1 is used as the default if the value is below all set positions (if wind speed is <3 MPH in this example).

[[exampleGauge]] title = Example gauge chart type = gauge [[[windGust]]] rounded = 1 colors_enabled = 1 color1_position = 3 color1 = "#1278c8" color2_position = 7 color2 = "#1fafdd" color3_position = 12 color3 = "#71bc3c" color4_position = 20 color4 = "#ffae00" color5_position = 30 color5 = "#ff7f00" color6_position = 40 color6 = "#ff4500" color7_position = 50 color7 = "#9f00c5" yAxis_min = 0 yAxis_max = 70

Stefan Gliessmann

unread,
Mar 19, 2025, 5:19:38 AM3/19/25
to weewx-user
Hi MaKi68,

Thank you for your feedback.

Yes, I did implement the Gauge with different colors.

Screenshot 2025-03-19 at 10.09.43.png

Now, I would like to color the line graph on the right with the same colors. That’s where I struggle …

Code for the gauge on the left:

    [[ImainGauge]]

        title = Liontron Main Current

        type = gauge

        [[[Imain]]]

            rounded = 1

                colors_enabled = 1

                color1_position = -1

                color1 = "#ff2c2c"

                color2_position = 1

                color2 = "#fafa2a"

                color3_position = 3

                color3 = "#3cb043"

                color4_position = 20

                color4 = "#21D300"

                color5_position = 40

                color5 = "#39FF14"

                yAxis_min = -10

                yAxis_max = 50


And the code for the line graph on the right (without any color settings as they are unknown to me):

    [[chartBMSCurrent]]

        title = BMS Main Current

#        width = 100%

        connectNulls = true

        [[[Imain]]]

            zIndex = 1


Thanks for your help,
Stefan

MaKi68

unread,
Mar 19, 2025, 8:46:21 AM3/19/25
to weewx-user
Hello Stefan,

Sorry, but I think with line it doesn't work...

LG
Manfred
Reply all
Reply to author
Forward
0 new messages