score:5
Accepted answer
Presumably you are looking to disable the tick lines which can be achieved via the drawTicks
property:
new Chart(document.getElementById('canvas'), {
type: 'bar',
data: {
labels: ['a', 'b', 'c'],
datasets: [{
label: 'series1',
data: [1, 2, 4]
}]
},
options: {
scales: {
xAxes: [{
gridLines: {
drawTicks: false
},
ticks: {
padding: 10
}
}],
yAxes: [{
gridLines: {
drawTicks: false
},
ticks: {
beginAtZero: true,
padding: 10
}
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
<canvas id="canvas">
gridLines:
drawTicks: false;
}
Refer to the documentation for further information.
Source: stackoverflow.com
Related Query
- ChartJS disable gridlines outside chart area
- ChartJs (ver: 2.8.0): Custom tooltip does not hide if clicked (or mouse pointer is moved) outside the chart canvas area
- Chart area background color chartjs
- Display values outside of pie chart in chartjs
- chartjs - top and bottom padding of a chart area
- how to highlight a specific area on chartjs line chart
- ChartJS bar chart - trigger hover even when the cursor is outside of the bar
- Background color of the chart area in chartjs not working
- Disable or hide YAixs of chart in chartJs
- ChartJS Polar Area Chart Scale Removing
- Chartjs Radar chart - How to dynamically highlight one of the gridlines at a specific point
- How to plot a line chart which has both the start and points outside the canvas area using Chart.js
- ChartJS custom legend doughnut separate legend from chart area
- Chart.js Line chart Option does not disable gridlines
- Calling data from outside of Chartjs code
- VueJS + Chartjs - Chart only renders after code change
- Chartjs Polar Area Chart - Data labels shown don't rotate with startAngle
- Add an image as background in ChartJS chart area [Not to canvas]
- Display Chartjs tooltip values outside the canvas - multi line chart
- ChartJS Data Overflowing Chart area
- Disable background chart on chartjs
- ChartJs - width scale of chart area and label area
- Dynamically update values of a chartjs chart
- Chartjs Bar Chart showing old data when hovering
- Chartjs v2.0: stacked bar chart
- Chartjs random colors for each part of pie chart with data dynamically from database
- How to disable chartjs legendclick
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- ReferenceError: Chart is not defined - chartjs
- How to disable a tooltip for a specific dataset in ChartJS
More Query from same tag
- Bubble Chart in Chartjs not working
- chart.js chart failing to render
- Why must I create my VueJS application before using ChartJS?
- PrimeNg bar chart how to show a label for the y-axis
- Increase point radius when tootip shown for certain data on Charts.js
- Legend position is not vertically in middle in Donut chart
- How do we can use chart.js in angular JS?
- Unexpected text "NaN" appearing near y-axis of the Chart
- How to keep rounded bar corners when data is filtered chartJs?
- Chart.js animations when updating chart data
- How can I style scale numbers in a Polar Area chart (chart.js)
- How to import a doughnut Chart using Chart JS for Blazor?
- How to align ChartJS bars to the left?
- give values to Chartjs
- chartjs - no smooth rendering on time series plot
- How to change position of label of y-axes in chartjs?
- Chart with Time axis only displaying first grid line and tick label (unitStepSize)
- Chartjs does not render chart when set responsive option to true
- JavaScript - Convert dates and times (Chart.js and Moment.js)
- How to add a ChartPoint to a DataSet in Chart.js with TypeScript?
- How to use saved data in Ionic/Angular?
- Chart.js max legend height
- How to display that data was unavaible during some time in a Chart.js (or any other library's) timeline graph
- Grabbing the title in plugin for ChartJS
- How can I add background color of length bars in chart (chartJS)?
- ChartJS: add a clickable text in title
- Modifying the X-Axis Labels of a Bar chart in Chart.js 2
- Chartjs dynamic chart return both x & y axis undefined
- Chart.js canvas cuts off doughnut stroke
- ChartJS zoom/pan onPan event not firing in React useEffect hook