score:27
Accepted answer
To remove/diminish grid-lines, you can set maxTicksLimit
property of ticks
to a number (amount of grid-lines - approx.) , like so :
scale: {
ticks: {
maxTicksLimit: 3
}
}
BONUS: If you wish to remove all the grid-lines, setting maxTicksLimit
to 0
will not work. Instead add the following in your chart options :
gridLines: {
display: false
}
To remove grid-line labels (ticks), you can set display
property to false
for scale ticks , as such :
scale: {
ticks: {
display: false
}
}
ᴡᴏʀᴋɪɴɢ ᴇxᴀᴍᴘʟᴇ ⧩
let ctx = document.querySelector('#canvas').getContext('2d');
let chart = new Chart(ctx, {
type: 'radar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
datasets: [{
label: 'RADAR 1',
data: [3, 1, 6, 4, 7, 5, 4],
backgroundColor: 'rgba(0,119,204,0.2)',
borderColor: 'rgba(0,119,204, 0.5)'
}, {
label: 'RADAR 2',
data: [4, 2, 3, 6, 1, 7, 5],
backgroundColor: 'rgba(255, 0, 0 ,0.2)',
borderColor: 'rgba(255, 0, 0 ,0.5)'
}]
},
options: {
scale: {
ticks: {
display: false,
maxTicksLimit: 3
}
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js"></script>
<canvas id="canvas"></canvas>
Source: stackoverflow.com
Related Query
- How to remove gridlines and grid labels in Chartjs Radar?
- How to change the fontFamily of the labels and remove the grid in chart.js
- how to change background in chartjs and remove background lines?
- Chart.js Radar Chart How to Remove Outer Labels
- ChartJs - Pie Chart - how to remove labels that are on the pie chart
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to hide grid lines and x-axis labels in chart.js?
- How to add new data point and remove leftmost data point dynamically in Chartjs
- how can i remove the grid lines in chartJs
- ChartJS adding shadow color to grid and custom x-axis labels
- Chartjs Radar chart - How to dynamically highlight one of the gridlines at a specific point
- How to remove all gridlines and ticks all lines in lines chart in javascript taken from cdn)
- How to remove old chart and append new chart to div using chartjs
- How remove duplicates xAxis labels and show all values on chart
- How to show tick marks and labels with grid line for the specific one on the X axis with Chart.js?
- ChartJs - Doughnut Chart - how to remove labels if percentage is less than a limit
- how to remove duplicate data set labels in chartjs
- How to remove Grid lines except for zero line and border Chartjs?
- How to offset x and y axis grid points and labels using chart.js?
- how to only show zero grid axes at center and hide all other gridlines in chart js
- How to add space Between Columns in Bar chartjs and remove the space in the end
- How to remove square label from tooltip and make its information in one line?
- Chartjs radar indexed labels
- How to change the color of legend in chartjs and be able to add one more legend?
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- How to show data values or index labels in ChartJs (Latest Version)
- How to feed hour and minute data into chartJS
- Chartjs Radar - Change color of end point labels
- How to get onClick Event for a Label in ChartJS and React?
- How to remove grid on chart.js
More Query from same tag
- Chart.js label on bar
- TypeError: Chart.defaults.global.tooltips is undefined in AngularJS
- Query with empty results laravel eloquent
- How to display stacked line chartjs
- ng2-charts: Datalabels values are not shown in my grapghs
- Chart.js Show Label near Line in combined Chart
- Get X, Y onClick chart coordinates in ChartJS
- Chart JS tooltip and label width is zeroed
- How to create a line chart indicating which month a user wrote more or less blogs?
- Chartjs change horizontal axis value
- How to constantly update y axis using a C# function to update a Live (Streaming) Chart.js Chart in ASP.NET core Web Application Razor Pages
- Chartjs not showing chart
- chartjs cutoutPercentage and tooltips does not works in nextjs
- How do I change the colour of a Chart.js line when drawn above/below an arbitary value?
- Multiple Charts of the Same Type in ChartJS2 ReactJS - Buggy Tooltips
- How to draw multiple color bars in a bar chart along a Horizontal Line using chart.js
- Chart JS Tooltip Currency Problem - Stacked Bar Chart
- Get hash value Rails / Chart JS / Google Chart
- Dynamic data in bar chart not rendering React js
- How to import Chart.js with Webpack
- How to set only min and max values in y-axis (chart js)
- Angularjs - Can't call the value from form to graph
- Angular 5 and chart.js ts error
- How to filter hover on a chart in ChartJS?
- Tiny error in the ChartJs book
- How can I merge multiple HTTP calls to one entity model in Angular
- add value to Line chart.js
- Chart with tool tip values
- How to make Chart.js Bubble chart with ng2-chart?
- $scope variable not updating when factory object changes AngularJS