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

The scatter plot marker positions do not always match the provided data #4935

Closed
lovasoa opened this issue Feb 5, 2025 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@lovasoa
Copy link

lovasoa commented Feb 5, 2025

Description

The scatter plot marker positions are incorrect.

Steps to Reproduce

  1. Open https://codepen.io/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-/pen/MYgMyjY?editors=0010
  2. Look at the position of the markers compared with the positions specified in the source

Source:

var options = {
  chart: {
    type: "scatter"
  },
  xaxis: {
    min: 0,
    max: 10,
    title: {
      text: "Growth Rate"
    },
  },
  yaxis: [
    {
      max: 25,
      min: 0,      
      title: {
        text: "GDP (Trillions USD)",
      }
    }
  ],
  series: [
    {
      name: "Brazil",
      data: [
        {
          x: 2.5,
          y: 2
        }
      ],
    },
    {
      name: "China",
      data: [
        {
          x: 6.5,
          y: 14
        }
      ],
    },
    {
      name: "United States",
      data: [
        {
          x: 2.3,
          y: 21
        }
      ],
      group: "apexcharts-axis-0"
    },
    {
      name: "France",
      data: [
        {
          x: 1.5,
          y: 3
        }
      ],
    },
    {
      name: "South Africa",
      data: [
        {
          x: 0.9,
          y: 0.3
        }
      ],
    }
  ],
  annotations: {
    yaxis: [],
    xaxis: [],
    points: []
  }
};

var chart = new ApexCharts(document.querySelector("#chart"), options);

chart.render();

Expected Behavior

The marker for "China", with an x value of 6.5 should be rendered further to the right, after the x axis tick for the value 6.

Actual Behavior

All markers seem to be rendered too far to the left.

Screenshots

Image

Reproduction Link

https://codepen.io/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-/pen/MYgMyjY?editors=0010

source

Initially reported on sqlpage/SQLPage#797

@lovasoa
Copy link
Author

lovasoa commented Feb 13, 2025

Thank you very much for the fix, @junedchhipa ! Do you think you could make a new release with the fix ?

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

No branches or pull requests

1 participant