Use ColorAbove and ColorBelow to highlight points that breach specific thresholds. These take precedence over SeriesColorGradient and SeriesColors.
asciigraph.ColorAbove(color, threshold): Colors points where value > threshold.asciigraph.ColorBelow(color, threshold): Colors points where value < threshold.
If both thresholds match the same point, ColorAbove wins.
package main
import (
"fmt"
"github.com/guptarohit/asciigraph"
)
func main() {
data := []float64{42, 48, 55, 81, 85, 91, 87, 34, 12, 17, 10, 18, 55, 50}
graph := asciigraph.Plot(data,
asciigraph.Height(10),
asciigraph.Width(25),
asciigraph.LowerBound(0),
asciigraph.UpperBound(100),
asciigraph.Caption("CPU usage % (red: critical, green: idle)"),
asciigraph.ColorAbove(asciigraph.Red, 80),
asciigraph.ColorBelow(asciigraph.Green, 25),
)
fmt.Println(graph)
}