score:24
Accepted answer
i believe, what you are looking for, is a scatter graph, not line.
var x = new chart(document.getelementbyid("mychart1"), {
type: 'scatter',
data: {
datasets: [{
label: "test",
data: [{
x: 0,
y: 5
}, {
x: 5,
y: 10
}, {
x: 8,
y: 5
}, {
x: 15,
y: 0
}],
}]
},
options: {
responsive: true
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.6.0/chart.min.js"></script>
<canvas id="mychart1"></canvas>
refer here, to learn more about scatter chart.
Source: stackoverflow.com
Related Query
- Chart.js - Plot line graph with X , Y coordinates
- Chart.js - Plot line graph with X , Y coordinates and connected by line
- How to plot a single value with line in line chart graph using charts.js?
- Chart Js update legend boxes of graph with graph line style
- Plot Multiple Line Chart in Ionic 3 with ChartJS
- How to plot a line graph with x and y data
- How to use chart.js to plot line chart with x axis as time stamp in seconds
- How to plot line chart with multiple datas, but only 2 labels?
- Plot a Line chart using Chart.js with CSV Data
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- line chart with {x, y} point data displays only 2 values
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chart.js - line chart with two yAxis: "TypeError: yScale is undefined"
- How to display Line Chart dataset point labels with Chart.js?
- Chart.js Mixed Bar and Line chart with different scales
- chart.js Line chart with different background colors for each section
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- chartjs: How to plot multi-line chart with irregular intervals
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Chart.js: Line chart with partial dashed line
- Line graph with linear timescale in Chart.js
- Obtain max value of y axis of line chart rendered with Chart.js
- ChartJS - Line Chart with different size datasets
- Line chart with large number of labels on X axis
- ChartJS - Line chart issue with only 1 point
- ChartJs line chart - display permanent icon above some data points with text on hover
- Is it possible to revert x-axe values in line chart with chart.js
- Drawing line chart in chart.js with json response
- Chart.js with dual axis on bar and line graph
More Query from same tag
- Loading ViewBag data into a chart.js multichart
- what is `dart.js` in chartjs.dart example
- charts.js fixed y label to 8 decimals
- Javascript: problems with the order of my index
- inject a bar chart into a webpage via content script
- How can I change the legend label without affecting my tooltip label?
- chart js chart bar chart not showing data from 0
- Dynamically created Chart.js chart overpopulating time based x-axis?
- Remove bullet points from chart.js legend
- Loading multiple doughnut chart from chart.JS in a single component of angular 6
- Map JSON for Chartjs with Angular 7
- JavaScript doughnut chart with centered hover label
- Chart.js dynamic dataset and tooltip on stacked bar
- Cannot access variables defined in webpack after build from client
- Display character after y-axis data value in onhover pop up Chart.js
- How to reduce the number of data points displayed in react-chart-js2 (data decimation)
- How can I export data from a csv file or excel file to a javascript object?
- Get data from sql database in chartjs using codeigniter
- Chart.js two categorical scales
- Download Chart.js graph from view
- how to fix this error Array to string conversion in laravel and chartjs?
- Map event position to y axis value in chartjs line chart
- Chart.js doughnut chart isn't showing tooltip when you hover over the left/right of the doughnut
- 'barradius' for Barchart in ChartJS is not working
- Redraw Chart.js with PHP JSON
- Javascript instead of mapping to an array, returning one value at a time instead of a list of data?
- How can I use an array of {x,y} objects to make a chart?
- ChartJS - Custom tooltip with icon
- Chart.js Partly filled in area/line graph
- No rendered annotation line on Line Chart