score:1
you are using v3 of the lib while your options object syntax is in v2, please read the migration guide to check if you need to change anything else, for this issue all the scales are now a seperate object instead as listed as x and y axes in an array, also the prop name has changed.
example:
var options = {
type: 'line',
data: {
labels: ["red", "blue", "yellow", "green", "purple", "orange"],
datasets: [{
label: '# of votes',
data: [12, 19, 3, 5, 2, 3],
bordercolor: 'pink'
}]
},
options: {
scales: {
x: {
grid: {
display: false
}
},
y: {
grid: {
display: false
}
}
}
}
}
var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
new chart(ctx, options);
<body>
<canvas id="chartjscontainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/3.5.0/chart.js"></script>
</body>
Source: stackoverflow.com
Related Query
- Chart.js Line chart Option does not disable gridlines
- Angular-chart.js - Make line chart does not curve
- Chartjs does not render chart when set responsive option to true
- Chartjs backgroundColor for line chart does not appear in Vue app
- Chart.js line chart does not render data lines on iOS
- Trying to call API and plot a line chart but it does not show
- Chart.js - Line chart does not render all points when using Point[] format
- Line chart disable interpolation
- Chart.js responsive option - Chart not filling container
- show label in tooltip but not in x axis for chartjs line chart
- Html chart does not fit a small Android WebView
- Chart looks only grey, does not show the color - Chartjs,discordjs
- angular-chartjs line chart TypeError: t.merge is not a function
- Chart.js line chart is not displaying
- Line chart is not being displayed in Chart.js
- ChartJS disable gridlines outside chart area
- Chart.js Chart in Angular does not load until resizing browser window
- Time series line chart is not displayed
- Time Series Line chart js in react not working
- Click event of stacked line chart not working
- My pie chart (chartJs) does not appear
- Chart.js chart does not display when inside an ngIf.
- Stacked line chart not displaying correctly when Xaxis is time
- Chart.js tooltip not showing on line chart
- annotation line not visible in scatter chart in chartjs
- Chart.js Date and Time Bar Chart Not Rendering - Line Works Though
- Bar Chart of ChartJS does not Render
- Want only line not area under it in chart js
- Do not draw line on condition in ChartJS line chart
- Legend not displaying on Line or Bar chart - React-Chartjs-2
More Query from same tag
- how to group the chart
- Change Vertical Line and Color bar chart in bar chart.js
- How to disable chartjs legendclick
- ChartJS line chart x = y not rendering astraight line
- Is there anyway add 2 or more chart with foreach loop
- How do you hide the title of a chart tooltip?
- Align a data label below a point on a bubble graph (Chart.JS)
- Transparentize some bars of dataset in ChartJS
- Chart.js horizontal bar width
- Chart.JS spacing and padding
- Chart.js Legend Customization
- JavaScript critical error...Syntax Error (MVC 5) when passing array to Charts.js
- Chart.js Show labels on Pie chart
- 'Chart.js' time chart not displaying properly
- create a multi line chart using Chart.js
- How to set y axis to the max dataset value in Chartjs?
- automatic Y-axis scale: max is always as 120% of highest value in ChartJS
- How do I destroy/update Chart Data in this chart.js code example?
- Chartjs – change tooltip border radius
- add shadow for line in vue chartjs
- Chartjs is stripping trailing zeros in decimal datasets
- chartjs xaxis ticks with round values from shifted input data
- How can I avoid NaN on pie chart label in Chart JS
- Chart.js with plotting durations against dates
- Copy div content to dynamically create a modal window:possible?
- Moving point to clicked point in ChartJS (radarchart)
- Make arbitrary line dashed
- Add a click event to the bar chart of chartjs
- chart.js 3 stacked bar chart - tooltip showing for zero values
- Delay animation of chart.js