Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two options: ColorAbove and ColorBelow #38

Open
perbu opened this issue Nov 8, 2022 · 1 comment
Open

Two options: ColorAbove and ColorBelow #38

perbu opened this issue Nov 8, 2022 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@perbu
Copy link

perbu commented Nov 8, 2022

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.

@guptarohit guptarohit added enhancement New feature or request question Further information is requested labels Jun 21, 2023
@0x090909
Copy link

very helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants