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

Polar plots failing with undefined findAxisModel #414

Closed
janpfeifer opened this issue Apr 13, 2024 · 3 comments · Fixed by #421
Closed

Polar plots failing with undefined findAxisModel #414

janpfeifer opened this issue Apr 13, 2024 · 3 comments · Fixed by #421
Assignees
Labels
bug Something isn't working

Comments

@janpfeifer
Copy link

Describe the issue

hi,

I'm trying to reproduce some of the demos in Apache ECharts, and in the Two Values-Axes in Polar I'm doing the following:

const numPoints = 100
data := make([]opts.LineData, numPoints)
for ii := range 100 {
    theta := (float64(ii) / numPoints) * 360.0;
    r := 5 * (1.0 + math.Sin((theta / 180) * math.Pi));
    data[ii] = opts.LineData{Value: []float64{r, theta}}
}

polar := charts.NewLine()
polar.SetGlobalOptions(
    charts.WithTitleOpts(opts.Title{Title: "Two Value-Axes in Polar",}), 
    charts.WithPolarOps(opts.Polar{
        Tooltip: opts.Tooltip{
            Show: true,
            Trigger: "axis",
            AxisPointer: &opts.AxisPointer{Type: "cross"},
        },
    }),
    charts.WithAngleAxisOps(opts.AngleAxis{
        PolarAxisBase: opts.PolarAxisBase{
            Type: "value",
            StartAngle: 0.0,
        },
    }),
    charts.WithRadiusAxisOps(opts.RadiusAxis{}),
)
polar.AddSeries(
    "line", data, charts.WithCoordinateSystem("polar"))

Which looks correct, but when I plot it, I get the following Javascript error in the console:

echarts.min.js:45 Uncaught TypeError: Cannot read properties of undefined (reading 'findAxisModel')
    at polar (echarts.min.js:45:242322)
    at echarts.min.js:45:244427
    at vx (echarts.min.js:45:244464)
    at e.getInitialData (echarts.min.js:45:324278)
    at e.init (echarts.min.js:45:158856)
    at e.<anonymous> (echarts.min.js:45:113807)
    at Array.forEach (<anonymous>)
    at E (echarts.min.js:35:5056)
    at e.<anonymous> (echarts.min.js:45:113440)
    at t.topologicalTravel (echarts.min.js:45:106659)

Maybe I'm doing something wrong ? Any ideas ?

Thanks!!

How to reproduce this issue

Just use the code in description.

Other information

No response

go-echarts version

v2.3.3

@janpfeifer janpfeifer added the bug Something isn't working label Apr 13, 2024
@Koooooo-7 Koooooo-7 added the need investigation Need investigation about this issue label Apr 19, 2024
@Koooooo-7 Koooooo-7 removed the need investigation Need investigation about this issue label May 9, 2024
@Koooooo-7 Koooooo-7 self-assigned this May 9, 2024
@Koooooo-7
Copy link
Member

Hi @janpfeifer , I reproduced the issue and checked the options, it generated wrong polar related options here.
go-echarts seems has a weird process on the Polar config now.
I gonna take a look on it and have a fix.

@janpfeifer
Copy link
Author

Thank you! I'm in a trip, so I haven't had the chance to check, but very appreciated!!

@Koooooo-7
Copy link
Member

Thank you! I'm in a trip, so I haven't had the chance to check, but very appreciated!!

No prob.
Although I fix this, I haven't released it yet. :)
Have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants