score:64
Accepted answer
You need to set the option maintainAspectRatio
to false
....
new Chart(ctx).Line(data, {
responsive:true,
maintainAspectRatio: false
});
Fiddle - https://jsfiddle.net/3cxeyLc8/
score:1
Setting width and height 100% work for me
<LineChart :chart-data="chartData1" :options="options" style="width: 100%; height: 100%" />
score:15
Add the following CSS to #myChart:
<canvas id="myChart" style="width:100%;height:100%;"></canvas>
Source: stackoverflow.com
Related Query
- Chart.js is not respecting my container dimensions
- Why is chart.js canvas not respecting the padding of the container element?
- Chart.js responsive option - Chart not filling container
- Chartjs graphs are not respecting height of container
- ChartJS Bar Chart not respecting disabled legend when using cdn
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- how to not repeat code while creating multiple charts in chart js
- ReferenceError: Chart is not defined - chartjs
- Chart.js: bar chart first bar and last bar not displaying in full
- show label in tooltip but not in x axis for chartjs line chart
- Html chart does not fit a small Android WebView
- Chart.js ng2-charts colors in pie chart not showing
- Chart.JS Mixed Chart - Bars Not Showing
- chartjs height does not follow parent container
- Chart looks only grey, does not show the color - Chartjs,discordjs
- Angular-chart.js - Make line chart does not curve
- angular-chartjs line chart TypeError: t.merge is not a function
- Chart.js line chart is not displaying
- Chart.js: width and height of a pie chart not respected
- Uncaught TypeError: Chart is not a constructor when using Chart.js
- Line chart is not being displayed in Chart.js
- Series Details Not Showing in Angular Chart with Charts.js
- Chartjs not rendering chart and no error thrown
- Chart.js pie chart not showing in Google Chrome canvas
- Chart.js Chart in Angular does not load until resizing browser window
- vue.js vue-chartjs chart not updating when chartData replaced, updated etc
- Chart.js update function (chart,labels,data) will not update the chart
- Time series line chart is not displayed
- Chart JS custom tooltip not showing
- Time Series Line chart js in react not working
More Query from same tag
- Cannot read property 'map' of undefined when looking at an array with no index
- Generate PDF from HTML page made with Bootstrap and ChartJS in Laravel
- How to apply image on each bubble in chartjs?
- Chart js old chart data not clearing
- How can I hide legend text if it's zero?
- How to perform an histogram with the following dictionary?
- Is there any way to display float bar in chart.js?
- ChartJS horizontal label are 1-2px clipped
- Is there any way I can customize my chartjs
- Chartjs Polar Area Chart - Data labels shown don't rotate with startAngle
- chartjs how to update dynamically data from database(Chartjs cant get the data)
- Adding data to charts.js dynamically from tables
- How to update css for doughnut chart with ng2-charts
- Hiding spaces with zero values in bar chart with chart.js
- change long labels to multiline(wrap) label in ChartJs
- HTML file won't generate anything on webpage using Chart.js
- Force ChartJS to show Doughnut chart with null values
- Custom script tag in index.html is removed on each build in Ionic 2 RC.0
- Chart.js multiTooltip Labels in Pie
- Can't figure out why the values in my objects are changing
- How to increase the spacing between labels and the chart
- How do you set up a chart.js scatter line chart through angular-chart.js?
- Data not displaying in Chart JS from PHP JSON
- Horizontal BarChart with labels and additional text
- Hide legends in Chartjs
- Chart.js sync legend toggle on multiple charts
- How to make a step line with charts.JS
- Chart.js v3.60 - Add % symbol to the end of the tooltip label on a doughnut chart?
- Chart.js render problem when routing Angular
- Changing width of chart.js chart without changing height