Make Chart Margins and Padding Optional/Adjustable
See original GitHub issueIs your feature request related to a problem? Please describe.
We have removed the left axis labels, but can’t left-align the chart because the entire element has been translated:
<g class="apexcharts-inner apexcharts-graphical" transform="translate(20, 30)">
- Red Line: This is the left SVG bound, where we would like to align the chart.
- Green Line: This is where the chart begins because of the translate. Margin should be optional
- Blue Line: This is where the series data starts, this data should also be optional
- Orange Lines: The same data padding on the right side should be optional
Describe the solution you’d like
Give options to remove/adjust these margins/padding (currently the only way is to use Sparklines, but this limits other options)
Describe alternatives you’ve considered
Forking repo; manual/external CSS overrides; masking with external elements; etc
Additional context
n/a
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:28 (6 by maintainers)
Top Results From Across the Web
Padding - Chart.js
Let's say you wanted to add 50px of padding to the left side of the chart canvas, you would do: let chart =...
Read more >Chart.js adds unwanted padding on top and below chart with ...
I think if you give the parent-div of your chart the wanted 180x180pixels, you can add to your options chartArea: { width: '100%',...
Read more >How To Add A Margin Between The Chart Area And The Chart Line
Chart margin is the space between the chart border and the canvas border. For a line/area chart canvas padding is the space between...
Read more >Chart Paddings and Margins - FusionCharts
Chart margin is the space between the chart border and the canvas border. You can set the chart margins on any one of...
Read more >How to Adjust the Width or Height of Chart Margins on an Excel
Surrounding an excel chart is a border, which may be called the "border of the chart ... Drag these handles to make the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@benhaynes The way to remove all paddings/margins would be
yaxis.show = false
This should remove all unnecessary spacings. Let me know if the above settings worked.
This update is available in v2.2.0
Is there a way to keep the y-axis labels but still remove the extra padding on the left? It’s unideal that the only way to get rid of it is by removing helpful labeling.