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

fix: fix polar config setup #421

Merged
merged 1 commit into from
May 9, 2024
Merged

fix: fix polar config setup #421

merged 1 commit into from
May 9, 2024

Conversation

Koooooo-7
Copy link
Member

Description

Fix the Polar config which maintain with hasPolar, close #414 .

Fixed output

	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.WithPolarOps(opts.Polar{}),
		charts.WithTitleOpts(opts.Title{Title: "Two Value-Axes in Polar"}),
		charts.WithTooltipOpts(
			opts.Tooltip{
				Show:        opts.Bool(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"),
	)

	os.WriteFile("Is-414.html", polar.RenderContent(), 0o644)

TODO: remove the EnablePolarType in bar chart.

Please share your ideas and awesome changes to let us know more :)


Type of change

  • Bug fix (Non-breaking change which fixes an issue)
  • New feature (Non-breaking change which adds functionality)
  • Breaking change (Would cause existing functionality to not work as expected)
  • Docs
  • Others

@Koooooo-7 Koooooo-7 merged commit 48b021d into master May 9, 2024
5 checks passed
@Koooooo-7 Koooooo-7 deleted the is-414 branch May 9, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polar plots failing with undefined findAxisModel
1 participant