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.

Less Padding/Margin for Pie/Donut Charts

See original GitHub issue

Is your feature request related to a problem? Please describe. We use stencil-apexcharts for your charts. The charts look really good!!!

But in our opinion as described already in this issue #471 there are to margin/padding for your charts. for sure on pie and radialBar charts. If you have not a lot of space like on mobile devices you need to minimize paddings and margins.

The inner padding of an chart should be customizable, from there all charts (at least radialBar) made use of the container space allowed to it.

So we hope you can do some improvements on this point.

Thx

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
rinogocommented, Jul 14, 2020

Cross-posting this here in case it helps someone who lands on this Issue.

Using a radialBar chart, we wanted to eliminate the top and bottom padding/margins. Using chart.offsetY helped a bit, but only for the top margin.

Inspired by this comment, I was able to crop out unnecessary top and bottom margins using negative values for grid.padding.top and grid.padding.bottom. You can do something similar with the left and right padding as well. My code ended up looking something like this:

            var options = {
                ...
                //Remove the excess padding (https://github.com/apexcharts/apexcharts.js/issues/1272#issuecomment-591388290)
                grid: {
                    padding: {
                        top: -20,
                        bottom: -15
                    }
                },
                ...
            };

Hope this helps! 😁

3reactions
junedchhipacommented, Apr 10, 2019

Yeah, that looks like a lot of unwanted space 😃 Currently, the radial-bar charts attempt to make the width/height equal resulting in a square (which is not what everyone would want).

I will look at how this can be controlled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serie labels of pie/donut chart not completely shown - Telerik
Hello, the labels of pie/donut chart are not completely shown under ... is no a better workaround (except adjusting labels padding / margin...
Read more >
Remove padding or margins from Google Charts
This will indeed solve the "excessive" padding/margin/whitespace problem. However, if you wish to include axes labels and/or a legend you will need to...
Read more >
Pie and Doughnut Charts - FusionCharts
Pie and Donut Charts are great tools for visualizing Part-to-whole relationships in a dataset. This handy guide teaches all about making pie and...
Read more >
the C3 reference - C3.js | D3-based reusable chart library
Set padding for x axis. If this option is set, the range of the x axis will increase/decrease by the values. If no...
Read more >
anychart.charts.Pie class
anychart.charts.Pie class | Pie (Donut) chart class. | AnyChart API Reference.
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