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

Allow for changes to the templates #247

Open
kaihendry opened this issue Sep 28, 2022 · 1 comment
Open

Allow for changes to the templates #247

kaihendry opened this issue Sep 28, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kaihendry
Copy link

I've noticed https://github.com/go-echarts/go-echarts/blob/master/render/engine.go

I want to override https://github.com/go-echarts/go-echarts/blob/master/templates/chart.go in particular

idk how you can allow users to override, add Templates to Renderer interface please?

@go-echarts go-echarts deleted a comment from Rocketchat23 Oct 23, 2022
@Koooooo-7 Koooooo-7 added the enhancement New feature or request label Oct 23, 2022
@Koooooo-7
Copy link
Member

Hi @kaihendry , you can implement ur own render same in engine.go to do the render thing. i.e.

type MyRender struct {

}

func (mr *MyRender) Render(w io.Writer) error {
	// ...
	return nil
}

func run() {
	bar := NewBar()
	bar.Renderer = &MyRender{}
	_ = bar.Render(ioutil.Discard)
}

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

No branches or pull requests

2 participants