react-charts icon indicating copy to clipboard operation
react-charts copied to clipboard

Primary axis dates for bar charts - bars are cut off

Open silas-v1 opened this issue 3 years ago • 8 comments

The "Multiple Axes" example is sufficient to describe the issue: image

Look at Tue 16 and Thu 25 dates -- only two of the three bars are display.

silas-v1 avatar Nov 16 '21 14:11 silas-v1

Can confirm, even shouldNice doesn't help.

konstantinkreft avatar Nov 17 '21 20:11 konstantinkreft

I'm running into this as well. I'm on 3.0.0-beta.34

paulgrieselhuber avatar Nov 22 '21 09:11 paulgrieselhuber

For ordinal data types its throwing error.

const { data, randomizeData } = useDemoConfig({ series: 3, dataType: "ordinal", });

bipinrajbhar avatar Nov 29 '21 15:11 bipinrajbhar

Hi @tannerlinsley, I have just submitted a sponsorship. This is the issue that we are hoping to see resolved.

paulgrieselhuber avatar Dec 15 '21 14:12 paulgrieselhuber

Well alright! I’ll dig in asap and try to find a good solution.

Tanner Linsley On Dec 15, 2021, 7:13 AM -0700, Paul Grieselhuber @.***>, wrote:

Hi @tannerlinsley, I have just submitted a sponsorship. This is the issue that we are hoping to see resolved. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

tannerlinsley avatar Dec 15 '21 17:12 tannerlinsley

I have a proposed fix here: https://github.com/tannerlinsley/react-charts/compare/beta...feat-padBandRange?expand=1

Let me know what you think

tannerlinsley avatar Dec 21 '21 06:12 tannerlinsley

Hey @tannerlinsley it's not obvious how I can test this feature. I tried via npm... do you mind sharing the best way to test this? Thanks!

silas-v1 avatar Dec 23 '21 19:12 silas-v1

We are having this issue as well. Installing react-charts from the commit (9c21df7) did not seem to help our issue.

In the above image, you can see that the right-most bar is completely cut off. If another "Yes" value is added, you can see it properly but the "No" bar is still hidden.

Screen Shot 2022-02-08 at 7 54 58 AM

In this image, you can see that the two left-most bars are overlapping each other.

This is our primary/secondary axes definitions:

const primaryAxis = useMemo<AxisOptions<Datum>>(
  () => ({
      scaleType: "time",
      getValue: (datum) => datum.primary,
  }),
  []
);

const secondaryAxes = useMemo<AxisOptions<Datum>[]>(
  () => [
    {
      getValue: (datum) => datum.secondary,
      min: 0,
      elementType: "bar",
    },
  ],
  []
);

kculmback-eig avatar Feb 08 '22 15:02 kculmback-eig