Can we add dynamic threshold values in bar graph based of query results?

Can we add dynamic threshold values in bar graph based of query results?

I need to set two threshold values in a bar graph, which I need to read from DB and show it in the bar graph?