score:9
Accepted answer
I was able to hardcode the size of the graph by turning off responsiveness:
options: {
responsive: false
}
score:1
Using Both options, maintainAspectRatio: false AND responsive: false seem to do the trick of making the chart fit the canvas as sized in the canvas height and width tags.
score:5
I solved the problem by adding "maintainAspectRatio: false" to the options.
options : {
maintainAspectRatio: false
};
Source: stackoverflow.com
Related Query
- Chart.js ignoring canvas height & width
- React chart : prevent chart's canvas scaling with height and width
- Unable to set width and height on canvas in chart js
- Binding Chart to Canvas height width
- attempting to change height and width of canvas for chart
- Prevent size of canvas chart js to equal window height and width
- Chart.js: width and height of a pie chart not respected
- How to get the actual chart width and height in chart.js
- Changing width of chart.js chart without changing height
- Why would a ChartJS chart end up with width 0 and height 0?
- canvas does not display proper width and height chart.js
- Chart.js canvas and chart width gets overwritten when redrawn
- HorizontalBar chart is displayed below canvas when I set height with style attribute for chart div (Chart.js 2.9.4)
- Html canvas element resets width and height to zero after drag/drop
- Height for chart area (not the canvas size)?
- Set height of chart in Chart.js
- How to clear a chart from a canvas so that hover events cannot be triggered?
- Setting width and height
- chart js 2 how to set bar width
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- Canvas static height Chartjs
- How to use PrimeNg Chart of Width and Height?
- set background color to save canvas chart
- ChartJs bar chart - keep bars left instead of equally spread across the width
- Changing width and height in angular-chart.js module
- Resize the width and height of the ng2-charts
- Can Chart.js combines Line Chart and Bar Chart in one canvas
- Chart js - Get bar width after render
- (Vue, ChartJS) Create gradient background for chart from child component canvas context
- Chart.js, dashed line, full width chart
More Query from same tag
- How to use percentage scale with Chart.js
- How to make a prefilled doughnut in chart.js?
- Chartjs graphs are not respecting height of container
- Check if element exists before trying to call getContext
- Chartjs 2.0 - Increase height of x-axis labels
- How to remove x axis scale labels Chart.Js
- break y axis in line chart chart.js
- How to disable a custom tooltip for a dataset in Chart.js line chart?
- ChartJS vertical line not removed on touchend
- drawing line chart with chartjs
- Chart.js: How can a line series (out of many) change line color and thickness upon mouse hover?
- Why is my data on chartjs not starting from the data that it should
- Angular Chart color does not change
- Chart.js in Vue defining multiple datasets
- Chart.js Polar Area Chart is not scale right
- Sequence of loading JavaScript <script> files
- 0 line style of Chart.js line chart
- Show point values in Radar Chart using chart.js
- ChartJS - Graphic with multiple values on the same date
- Charts.js: Load new data set to an existing chart
- Unable to hide x axis for horizontal bar chart vue js
- What library should I use to create costume chart in react native?
- I want to use an object to help create a chart with Chartjs
- ChartJS - Change legend to toggle buttons
- How to subscribe to elements in a response object
- Html canvas element resets width and height to zero after drag/drop
- Chart JS Re-Animate chart with onclick
- Javascript: problems with the order of my index
- chartjs loading data from ajax doesn't work fine
- Chart.js - Multiple Line Charts - [2]