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

Data is not correctly displayed when stacked #333

Open
cedricdelpoux opened this issue Dec 17, 2022 · 1 comment
Open

Data is not correctly displayed when stacked #333

cedricdelpoux opened this issue Dec 17, 2022 · 1 comment

Comments

@cedricdelpoux
Copy link

Screenshot 2022-12-17 at 06 18 17

const data = [
    {
      label: "Data 1",
      data: [
        {
          date: "01",
          kilometers: 10,
        },
        {
          date: "03",
          kilometers: 9,
        },
      ],
    },
    {
      label: "Data 2",
      data: [
        {
          date: "01",
          kilometers: 70,
        },
        {
          date: "02",
          kilometers: 50,
        },
        {
          date: "04",
          kilometers: 100,
        },
      ],
    },
  ]
  
  const primaryAxis = React.useMemo(
    () => ({
      getValue: (datum) => datum.date,
    }),
    []
  )

  const secondaryAxes = React.useMemo(
    () => [
      {
        getValue: (datum) => datum.kilometers,
        elementType: "bar",
        stacked: true,
      },
    ],
    []
  )
  
<Chart
  options={{
    data,
    primaryAxis,
    secondaryAxes,
/>
@Tushar2098
Copy link

Tushar2098 commented Jul 16, 2023

I'm too facing same issue..it would be good if someone can look into it


image

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

No branches or pull requests

2 participants