Skip to content

Commit

Permalink
Fix radar default aspect ratio and samples
Browse files Browse the repository at this point in the history
Now that the aspect ratio is correctly handled, fix samples for charts with aspect ratio of 1 which was vertically too large. Also fix the default aspect ratio for radar charts which wasn't applied when creating a chart directly using new Chart(ctx, { type: 'radar' }).
  • Loading branch information
simonbrunel committed Sep 23, 2016
1 parent 16bcd6a commit d610987
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion samples/doughnut.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>

<body>
<div id="canvas-holder" style="width:75%">
<div id="canvas-holder" style="width:40%">
<canvas id="chart-area" />
</div>
<button id="randomizeData">Randomize Data</button>
Expand Down
2 changes: 1 addition & 1 deletion samples/polar-area.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>

<body>
<div id="canvas-holder" style="width:75%">
<div id="canvas-holder" style="width:40%">
<canvas id="chart-area"></canvas>
</div>
<button id="randomizeData">Randomize Data</button>
Expand Down
2 changes: 1 addition & 1 deletion samples/radar-skip-points.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>

<body>
<div style="width:75%">
<div style="width:40%">
<canvas id="canvas"></canvas>
</div>
<button id="randomizeData">Randomize Data</button>
Expand Down
2 changes: 1 addition & 1 deletion samples/radar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</head>

<body>
<div style="width:75%">
<div style="width:40%">
<canvas id="canvas"></canvas>
</div>
<button id="randomizeData">Randomize Data</button>
Expand Down
1 change: 0 additions & 1 deletion src/charts/Chart.Radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module.exports = function(Chart) {

Chart.Radar = function(context, config) {
config.options = Chart.helpers.configMerge({aspectRatio: 1}, config.options);
config.type = 'radar';

return new Chart(context, config);
Expand Down
1 change: 1 addition & 0 deletions src/controllers/controller.radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = function(Chart) {
var helpers = Chart.helpers;

Chart.defaults.radar = {
aspectRatio: 1,
scale: {
type: 'radialLinear'
},
Expand Down

0 comments on commit d610987

Please sign in to comment.