score:9
Accepted answer
You're not providing the data in correct format for the scatter line
plot.
The correct format to provide the data is described by the following example from Chart.js Docs.
var scatterChart = new Chart(ctx/* your canvas context*/, {
type: 'line',
data: {
datasets: [{
label: 'Scatter Dataset',
data: [{
x: -10,
y: 0
}, {
x: 0,
y: 10
}, {
x: 10,
y: 5
}]
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'bottom'
}]
}
}
});
I think the x
and y
should be separable into different arrays, but you can always do a combination step and combine them into objects.
Source: stackoverflow.com
Related Query
- Chart.js xAxis linear scale : strange behavior
- chart.js scale xaxis with date, strange renderer
- How to prevent first/last bars from being cut off in a chart with time scale
- chartjs : how to set custom scale in bar chart
- Chart.js drag points on linear chart
- Chart Js Negative Scale
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- Chart.js - Bar chart with linear cartesian (numerical) X axis?
- set y-axis scale manually in a bar chart using angular-chart.js
- impossible to remove scale from radar chart (chart.js)
- ChartJS: create linear x-axis on bar chart
- Chart.js xaxis formatter changes the value shown in the chart
- Stacked line chart not displaying correctly when Xaxis is time
- how can i modify scale labels in angular chart js?
- Equal distance grouped bar chart irrespective of scale - chart.js
- How can I style scale numbers in a Polar Area chart (chart.js)
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- chart js - bar chart with time scale on Y axis in Hours and Minutes
- Chart.js Polar Area Chart is not scale right
- How to set a time scale to a ChartJS chart from JSON?
- Vertical line using Chart.js annotations plugin with linear scale on x axis
- How to select context or scale on chart in chartjs quickchart io to run getValueForPixel?
- Chart.js 3.5: linear gradient doesn't apply properly when multiple bars in the same chart
- Strange "padding" at chart area after updating chart.js (2.8.0 -> 3.4.1)
- Linear x axis for bar chart chartjs
- How to scale label size radar chart chart.js
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- Chart.js time scale graph - xAxis labelling
- chart looking strange on phone´s browser using chart.js
- ChartJS Polar Area Chart Scale Removing
More Query from same tag
- How to Integrate Chart.Funnel.js in Chart.js
- How to put indicator between yAxis values on yAxis chartJs?
- Cursor pointer change onhover not working in chartjsv3
- How to create a stacked donut chart in Angular 5
- Custom background limits for Doughnut (Gauge)
- chart.js not getting rendered inside ng-template in angular
- Change dot size individually Scatter Chart -- ChartJS
- Chart Js update legend boxes of graph with graph line style
- Error: "barWithErrorBars" is not a chart type. Vue - chartjs-chart-error-bars
- How can I change the legend label without affecting my tooltip label?
- Adding vertical and horizontal scroll to Chart js Bar graph
- update charjs dataset using react library
- In chart.js, how to know if a yAxes tick is bumping/rendering over/into another
- ng2-Chart not working with newly created angular 10 project
- Referencing locally declared variable into an array for data for chartjs
- How to have chart.js automatically build x-axis labels based on x,y dataset?
- Declare data value dynamicaly to chart js
- How can I get chart.js to automatically add colours for dynamic labels?
- I search additive options on chartsjs
- Hiding spaces with zero values in bar chart with chart.js
- How to get Max Values of a Multidimensional Array for 30 Days
- Chart.js Example Diagramm don't show
- How do I use my chart.js line chart with handlebars?
- Hide/disable tootlip on specific graph values
- Chartjs v2 stroke shadow
- Can i use destroy charts in React.js using Chart.js?
- using gradient colors in angular-chart.js
- How to update the chart dynamically with vue-chartjs?
- ChartJS Update specific bar's background colour
- Charts.Js with Asp.Net Webforms Does Not Work