go-echarts / go-echarts

🎨 The adorable charts library for Golang

Home Page:https://go-echarts.github.io/go-echarts/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can not show scatter3d chart

lwch opened this issue · comments

commented

errors in console

analysis.html:44 Uncaught ReferenceError: action_tFTQHrTwdNaT is not defined
    at analysis.html:44:41
(匿名) @ analysis.html:44
analysis.html:75 Uncaught ReferenceError: action_XMCGsMhuEKAR is not defined
    at analysis.html:75:41
(匿名) @ analysis.html:75
analysis.html:106 Uncaught ReferenceError: action_wFOgBgmuzWyM is not defined
    at analysis.html:106:41

Hi @lwch , As per to the echarts-gl.min.js doesn't support the newer echarts version which we upgrade to v5.4.3.
The workaround is downgrade the echarts version to 4.x.
Sorry for the inconvenient, we will do the compatibility asap.

  • On page usage
        page := components.NewPage()
	page.AssetsHost = "https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/"
  • On single chart usage
	bar := charts.NewBar()
	bar.SetGlobalOptions(
		charts.WithInitializationOpts(opts.Initialization{
			AssetsHost: "https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/",
		}),
        )
commented

I'm using code above, but it is still not work

page := components.NewPage()
page.AssetsHost = "https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/"

scatter := charts.NewScatter3D()
scatter.SetGlobalOptions(
    charts.WithInitializationOpts(opts.Initialization{
        AssetsHost: "https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/",
    })
)

the error is below:

echarts.min.js:22 Uncaught Error: Component series.scatter3D not exists. Load it first.
    at i.getClass (echarts.min.js:22:93426)
    at e.<anonymous> (echarts.min.js:22:156058)
    at Array.forEach (<anonymous>)
    at R (echarts.min.js:22:3297)
    at e.<anonymous> (echarts.min.js:22:155960)
    at ku.topologicalTravel (echarts.min.js:22:148471)
    at e.mergeOption (echarts.min.js:22:155563)
    at e.<anonymous> (echarts.min.js:22:155031)
    at e.resetOption (echarts.min.js:22:155047)
    at e.setOption (echarts.min.js:22:154493)

Hi @lwch , I found that the host changes all resources, this issue still exist.
please, use this instead.

	page := components.NewPage()
	page.AssetsHost = "#invalid"
	page.AddCustomizedJSAssets("https://cdn.jsdelivr.net/npm/echarts@4.9.0/dist/echarts.min.js")
	page.AddCustomizedJSAssets("https://go-echarts.github.io/go-echarts-assets/assets/echarts-gl.min.js"
	

Hi @lwch , plz use go-echarts v2.3.0 to check whether it works or not.

commented

successed, thanks a lot