Skip to content

Two options: ColorAbove and ColorBelow #38

@perbu

Description

@perbu

Hi.

I've added some code to enable options to color the parts of the graph that is above/below a certain value. So this graph:
bilde

Is produced by the following code:

func main() {
	series := []float64{1, 2, 3, 4, 5, 4, 3, 2, 1}
	graph := asciigraph.Plot(series, asciigraph.Height(10),
		asciigraph.Width(50),
		asciigraph.Caption("A simple line graph"),
		asciigraph.ColorAbove(asciigraph.Red, 4.0),
		asciigraph.ColorBelow(asciigraph.DarkGreen, 2.0),
	)
	fmt.Println(graph)
}

Lemme know if you want me to contribute this in a proper manner. If so I'll but a bow on it and hand it over.

Cheers,

Per.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions