score:3
Without seeing your code for creating the chart it's only possible to guess at what the problem might be.
Generally speaking if you disable the legend
and the title
the chart should fill to the edge of the canvas, like so:
new Chart(
document.getElementById('doughnut-canvas'),
{
type: 'doughnut',
data: {
datasets: [{
data: [2, 1],
}]
},
options: {
legend: {
display: false
},
title: {
display: false
}
}
}
);
body {
background-color: #000;
}
.header {
color: white;
font-size: 16px;
font-weight: bold;
font-size: Verdana;
padding-left: 10px;
}
.doughnut-canvas-container {
width: 30%;
}
#doughnut-canvas {
background-color: red;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script>
<p class="header">CPU</p>
<div class="doughnut-canvas-container">
<canvas id="doughnut-canvas" class="chartjs-render-monitor"></canvas>
</div>
Source: stackoverflow.com
Related Query
- Chart.js doughnut canvas padding
- chart.js cuts off canvas - but padding makes doughnut very small
- Chart.js canvas resize of pie / doughnut chart
- Chart.js doughnut and pie chart at same canvas mixed
- getting additional value fields from data source for dx.chartjs doughnut chart
- Pie chart inside doughnut on same canvas
- While placing chart.js Doughnut Chart inside Primeng Carousel, the text inside the canvas seems blurred/distorted a little bit
- How to add text inside the doughnut chart using Chart.js?
- How to clear a chart from a canvas so that hover events cannot be triggered?
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- Why is chart.js canvas not respecting the padding of the container element?
- Chart.js padding canvas
- Chart.js doughnut chart tooltip size?
- How to add text in centre of the doughnut chart using Chart.js?
- Can't resize react-chartjs-2 doughnut chart
- set background color to save canvas chart
- chartjs - top and bottom padding of a chart area
- Display Doughnut Pie Chart As Circle Progress Chart.js
- Can Chart.js combines Line Chart and Bar Chart in one canvas
- Chart.JS full-width, responsive doughnut chart with Bootstrap
- Chart.js - Multiple Doughnut Charts on same Canvas
- How to display the labels in doughnut chart using ng2 charts?
- Chart.js HTML custom legend issues with doughnut chart
- How to create single value Doughnut or Pie chart using Chart.js?
- (Vue, ChartJS) Create gradient background for chart from child component canvas context
- Adding a label to a doughnut chart in Chart.js shows all values in each chart
- Doughnut chart adjusting problem in chart.js
- Chart.js pie chart not showing in Google Chrome canvas
- Increase padding between legend and chart with react-chartjs-2
- Chartjs doughnut chart with gradient color
More Query from same tag
- Show all values in Chart js y axis
- How to create dynamic D3 tickFormat in dc charts
- Chartjs - Insert labels at xAxes
- How to increase size and family in a radar's Chartjs label
- How to change background color in ng2-charts
- Bar chart with vertical lines in each bar
- ChartJS - Gradient color overlap
- In Stacked horizontal bar chart how to remove the vertical line in Chart.js?
- Loading or Activating ChartJS on Load
- Chart.js Using A JavaScript Object
- Canvas displays initially in Chrome but not in Firefox
- Drawing to canvas on click clears text when mouse leaves the chart
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- Get Chart js object from selector
- Trying to get total sum based on months on ApexCharts with Php
- using library without 'require' when using CDN
- How should i apply date picker in my chart
- Chart.js - PieChart defined background color for specific dataset element
- setting uneven tick stepsize spacing with chart.js
- Chart.js bar chart labels do not valign
- Charts in wicket
- Is it possible to get the assigned ref name in a component? Vue.js
- Angular using PrimeNG charjs problem with font colors
- Remove background on Chartjs v2 fixed tooltips
- Chart.js turn labels into links
- Angular and CharJS - ERROR TypeError: Cannot read property '15' of undefined
- Dynamically Creating Json Array Javascript
- Vue-chartjs not rendering chart until page resize
- Angular Chart Js legends click event not working
- laravel chartjs dates skipped