Struggling to add custom graph to my plugin

First you need to have a yield Metric for each color with a different name (like by adding the name of the color)

yield Metric(
    f"remaining_{ink}",
    remain,
    levels=(20,5),
    boundaries=(0,100)
)

Then in your graph definition, the metrics have to match these names exactly

graph_info["hp_officejet_remaining_combined"] = { 
    "metrics": [ 
        ("remaining_Yellow", "line"), 
        ("remaining_Magenta", "line"), 
        ("remaining_Cyan", "line"), 
        ("remaining_Black", "line"),
    ],
}
1 Like