score:2
Accepted answer
i fixed my issue,
i used this [legend]="doughnutchartlegend"
.html
<canvas basechart
[data]="doughnutchartdata" [labels]="doughnutchartlabels"
[options]="doughnutchartoptions" [legend]="doughnutchartlegend"
[charttype]="doughnutcharttype"
[colors]="[{backgroundcolor: ['rgb(116, 90, 242)', 'rgb(30, 136, 229)', '#06d79c', 'rgb(236, 239, 241)']}]"
(charthover)="charthovered($event)"
(chartclick)="chartclicked($event)"></canvas>
.ts
// doughnut
public doughnutchartlabels: string[] = [
'total',
'vacant dirty',
];
public doughnutchartoptions: any = {
borderwidth: 2,
maintainaspectratio: true,
cutoutpercentage: 55,
};
responsive: true;
public doughnutchartdata: number[] = [51, 1];
public doughnutcharttype: string = 'doughnut';
public doughnutchartlegend: boolean = false;
Source: stackoverflow.com
Related Query
- Hiding Chart.js labels in Angular6
- hiding x-axes labels with 0 values on a bar chart
- Limit labels number on Chart.js line chart
- Hiding labels on y axis in Chart.js
- Chart.js Show labels on Pie chart
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- chart.js: Show labels outside pie chart
- Chart.js how to show cursor pointer for labels & legends in line chart
- Chart JS data labels getting cut
- How to display Line Chart dataset point labels with Chart.js?
- Making the labels responsive in chart js
- Chart.js - Draw bar chart with multiple labels
- Chart JS grouped sub labels
- Display a limited number of labels only on X-Axis of Line Chart using Chart.js
- Changing x axis labels in Chart.js line chart
- How to display data labels outside in pie chart with lines in ionic
- Line chart with large number of labels on X axis
- Center point labels between ticks (Polar Area Chart JS)
- How to align Chart.JS line chart labels to the center
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- How to display the labels in doughnut chart using ng2 charts?
- Chart.js Bubble chart with custome X-axis labels
- Change labels colors for radar chart js
- ChartJS: Show all labels of a mixed chart in the tooltip
- Chart.js Radar Chart How to Remove Outer Labels
- ChartJS 2.0 - Huddle labels on pie chart
- Multiple line labels for chart js
- Remove radar chart labels in chart.js
- Chart JS: Ignoring x values and putting point data on first available labels
- Show labels on each sector to polar chart using angular js chart
More Query from same tag
- ChartJS: Translate x axis month to other languages
- chartjs - multi axis line chart - cannot read property 'min' of undefined
- How To get keys(index) of collection in laravel
- js devexpress PieChart Series color runtime
- Cannot import chart.js-plugins-annotations
- ChartJS Horizontal bars barely visible with 50 records on the Y axis
- How to position yAxes labels in chartJS
- How Export an Editable Chart with content to PPT and Excel
- Rendering Chart.js Bubble Chart Using Array Data
- Angular Chartjs error TS2304: Cannot find name OffscreenCanvasRenderingContext2D
- VueJS : How to group by based on response data columns
- Change color of line along labels Chart.js
- chart.js sum of the last 3h datavalues in a line chart
- How can I display `Null` value data on Y Axis using the Primitive dataset format in Chart.js V3.7.0?
- ChartJS adding shadow color to grid and custom x-axis labels
- Display Charts based on year select in django
- Remove chartjs pie chart highlight on hover
- Not drawing null values using chart.js
- How to show label for second y-axis in charts.js?
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- Hide all scale labels in chartjs
- Chartjs - first x-axis tick is not displayed
- How to add labels on top of the chart bar with Chart.js 2
- hh:mm in chart.js on X-axis and text labels on the Y-axis
- AngularJS/ChartJS: Get the current series
- Chart.js – Line Chart Tooltip Labels
- Chart.js: Dynamic Changing of Chart Type (Line to Bar as Example)
- Is it possible to reverse the display order of segments in polar chart?
- How to use PrimeNg Chart of Width and Height?
- Chart js - Draw center of each bubbles of a bubble chart