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

applying chart-xs class on doughnut/pie-chart #633

Closed
gaspaonrocks opened this issue May 29, 2017 · 2 comments
Closed

applying chart-xs class on doughnut/pie-chart #633

gaspaonrocks opened this issue May 29, 2017 · 2 comments

Comments

@gaspaonrocks
Copy link

Hi,

as the title says, i don't know how to reproduce the sizing of the demo page for a pie chart...

When i look at the code, there's a chart-xs class that seems to do the trick, but I can find it anywhere...

I might be missing something...

I' ve added chart.js, angular-chart.js, bootstrap.js and jquery as dependencies, I also added bootstrap.css and the example app.css.

I don't really know where to look now...

Thanks !

@jtblin
Copy link
Owner

jtblin commented May 29, 2017

What version of Chart.js do you use? Unfortunately they decided to double the aspect ratio for pie (and family) charts so you'll need to set aspect ratio to 1 to avoid this. See chartjs/Chart.js#4079

@gaspaonrocks
Copy link
Author

Modifying chart.js in the node_modules folder like this :

Chart.defaults.polarArea.aspectRatio = 2;
Chart.defaults.doughnut.aspectRatio = 2;
Chart.defaults.radar.aspectRatio = 2;

from 1 to 2 let it have the same size as the other chart types.

Thank you very much for pointing me to the link on chartjs page ;-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants