question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Barchart x/yAxis label/unit not displaying?

See original GitHub issue

Using the following snippet:

<BarChart data={initialData} >
   <XAxis dataKey="name" label="Devices"/>
   <YAxis unit="MB"/>
   <CartesianGrid strokeDasharray="3 3"/>
   <Tooltip/>
   <Legend />
   <Bar dataKey="used" stackId="a" fill="#8884d8" unit=" MB" />
   <Bar dataKey="available" stackId="a" fill="#82ca9d" unit=" MB" />
</BarChart>

label on the XAxis is not rendering and neither is unit on the YAxis. Am I doing something wrong? The following is an example render:

image

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
muhgumuscommented, May 30, 2017

<XAxis dataKey=“name” tick={<CustomizedAxisTick />} interval={0} />

set interval={0}

3reactions
kenhoffcommented, Nov 2, 2016

Was able to make some progress by setting <BarChart margin={{top: 20, right: 80, bottom: 20, left: 20}}>, similar to how the ComposedChartWithAxisLabels does it above. Def not ideal, but at least it’s a start.

might also be able to just set some css:

.recharts-surface {
    overflow: visible;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to display all x labels in R barplot? - Stack Overflow
You may be able get all of the labels to appear if you use las=2 inside the plot() call. This argument and the...
Read more >
Excel Chart not showing SOME X-axis labels - Super User
On the sidebar, click on "CHART OPTIONS" and select "Horizontal (Category) Axis" from the drop down menu. Four icons will appear below the...
Read more >
Change the display of chart axes - Microsoft Support
To change the interval between axis labels, under Interval between labels, click Specify interval unit, and then in the text box, type the...
Read more >
Thread: Issue with Excel 2010 not displaying all X-axis labels
Basically the problem is that I need to display a bar chart with 150 catagories, and each individual X-axis label needs to be...
Read more >
PI16163: Bar chart does not display label correctly when value ...
APAR status. Closed as unreproducible in next release. Error description. When a bar is near the top of the x-axis (the distance between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found