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

how to modify MarkLine color #365

Open
burgess001 opened this issue Jan 24, 2024 · 1 comment
Open

how to modify MarkLine color #365

burgess001 opened this issue Jan 24, 2024 · 1 comment
Labels
question Further information is requested

Comments

@burgess001
Copy link

how to modify MarkLine color,like this

image
@Koooooo-7
Copy link
Member

Hi @burgess001 , currently we don't have a WithHelper to change this easily.
Luckily I checked the series configs, it contains the MarkLine configs in interface{}.
You can do this as a workaround.

type MyItem struct {
	Name           string `json:"name"`
	YAxia          int    `json:"yAxia"`
	opts.LineStyle `json:"lineStyle"`
}

func barMarkLines() *charts.Bar {
	bar := charts.NewBar()
	bar.SetSeriesOptions(charts.WithSeriesOpts(func(s *charts.SingleSeries) {
		s.MarkLines = &opts.MarkLines{}
		s.MarkLines.Data = append(s.MarkLines.Data, &MyItem{
			Name:  "1111",
			YAxia: 200,
			LineStyle: opts.LineStyle{
				Color: "red",
			},
		})

	}))
	return bar
}

@Koooooo-7 Koooooo-7 added the question Further information is requested label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants