mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix radar default aspect ratio and samples
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' }).
This commit is contained in:
parent
16bcd6adc5
commit
d610987cfb
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -5,6 +5,7 @@ module.exports = function(Chart) {
|
||||
var helpers = Chart.helpers;
|
||||
|
||||
Chart.defaults.radar = {
|
||||
aspectRatio: 1,
|
||||
scale: {
|
||||
type: 'radialLinear'
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user