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

Specify axis padding values in pixels or percentages instead of data values #251

Closed
danelkhen opened this issue May 20, 2014 · 7 comments
Closed
Labels
C-feature-request Category: A feature request or an enhancement

Comments

@danelkhen
Copy link
Contributor

It seems that y.axis.padding behaviour uses data related units, which are relative to each graph's data.

Is it possible to specify padding values in pixels or percentages? This allows multiple graphs to have a consistent look, even if they show a completely different range of numbers.

Here's an example of two charts, having the same value for padding, but look entirely different (because the padding is data-related)

var chart = c3.generate({
    data: {
        columns: [
            ['sample', 30, 200, 100, 400, 150, 250]
        ]
    },
    axis: {
        y: {
            min: 0,
            padding: {bottom:10}
        }
    }
});
var chart2 = c3.generate({
    data: {
        columns: [
            ['sample', 0.3, 0.4, 0.7, 0.9, 0.15, 0.25]
        ]
    },
    axis: {
        y: {
            min: 0,
            padding: {bottom:10}
        }
    }
});
@masayuki0812
Copy link
Member

Hi, I totally agree. I'll fix this. Thanks!

@danelkhen
Copy link
Contributor Author

Thanks!

@masayuki0812
Copy link
Member

Oh, I forgot writing comment.. This commit will be included in next version. And please see the sample I committed too. Thanks!

@danelkhen
Copy link
Contributor Author

Yeah I figured it out by looking at your git commit, it's working perfectly. :-)

ethanjli added a commit to ethanjli/infant-resuscitation-data-display that referenced this issue Jul 29, 2016
Hacked together using C3 grids...
Adapted an old C3js commit for y axis padding for x axis padding (refer
to c3js/c3#251)
@geofreyflores
Copy link

I know this is closed, but seems related. I was wondering if this is available for the x-axis as well, or do I need to open a new ticket?

@typeofweb
Copy link

It seems it's not available for x-axis?

@rumitbodiwala
Copy link

if chart is small than not show Y axis and on click on that chart become large and show Y axis how to this is possible??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request or an enhancement
Projects
None yet
Development

No branches or pull requests

5 participants