score:1
Accepted answer
If you use a scatter plot, it can be done.
See example below:
var scatterChart = new Chart(
document.getElementById('c').getContext('2d'),
{
type: 'scatter',
data: {
datasets: [{
label: 'Scatter Dataset',
data: [{
x: 0,
y: 0
}, {
x: 1,
y: 1
}, {
x: 2,
y: 2
}, {
x: 2,
y: 1
}, {
x: 3,
y: 1
}
],
tension: 0,
showLine: true,
fill:false
}]
},
options: {
scales: {
xAxes: [{
type: 'linear',
position: 'top'
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>
<canvas id="c" width="200" height="200"></canvas>
Source: stackoverflow.com
Related Query
- Is it possible to change chartjs line value in one column ? No transition
- ChartJS Line Graph - Multiple Lines, Show one Value on Tooltip
- In ChartJS is it possible to change the line style between different points?
- how to change Y axis value dynamically based on user input in Chartjs for Line chart?
- ChartJS fails to render one of the lines in cartesian chart following update after change to max Y axis label value
- Chartjs change grid line color
- How to display value of only one datapoint in line chart
- How to change the color of legend in chartjs and be able to add one more legend?
- chartjs - Drawing vertical line on integer x axis value
- Map event position to y axis value in chartjs line chart
- How to change grid line width for one specific line
- chartjs Line chart: scale respect value on x-axis
- Chartjs change horizontal axis value
- How can I change color of only one column in Barchart using Chart.js
- Is it possible to change pointStyle for elements of a ChartJS bubble chart per dataset?
- How to change line segment color based on label value in chart.js?
- ChartJS datasets with one data value
- ChartJs - Is is possible to show only tooltip in one dataset?
- Change color of one value in the x-axis charts.js
- Is it possible to merge duplicate labels (and their datas) into one column in Chart Js?
- Why i only get one value after executing "for loop" to display "datasets.data" in ChartJS
- Chartjs 3 how to draw a horizontal line starting at a specific yAxis value
- chartjs display data in one bar line with 3 different data sets in 3 different colors
- VueJS + Chartjs - Chart only renders after code change
- ChartJS with ChartJS DataLabels: Change Color per Dataset for Value Labels
- How to change bar color acording to label value in chartjs
- How to change the Y-axis value in chartjs
- How to limit chart JS hover to take only one value from each line chart when zoomed out?
- Cannot change the color of column chart according to its value
- ChartJS with React: Only one value showing on time chart
More Query from same tag
- Charts.js tooltip overlapping text on chart
- ChartJS – is there any way to remove blank space around pie charts?
- How to make pie chart from array values?
- Chartjs - onAnimationComplete fires before the animation actually completes
- Styling the middle text of Chart.js's doughnut chart
- Is there a way to export chartjs-chart-treemap?
- chart.js pie chart - how to update dataset with smooth transition
- Different amount of label and data in Chart.js
- Stepped Line with angular-chart.js
- How to export/import modules between component files in Javascript
- Chart.js data background color is overwriting point background color
- Set DataSource Of Chart.JS To Array
- Calling chart JS with PHP Data (file structure)
- Draw multiple chart in one page with Chart.js
- Resizable/Expendable box annotation in ChartJs
- Chart.js (Stacked Bar chart) How to calculate total sum of labels in tooltips?
- How to create a histogram in charts.js with MYSQL data
- How to add an array to my line data?
- How to set 3 axis in google chart (V-Axis Left as Qty, V-Axis Right as Series Column and H-Axis as TimeOrder)?
- subset stacked bars chart
- How to draw multiple color bar in a bar chart using chart.js
- Parse an object to chart.js instead of arrays?
- Chart.js xaxis formatter changes the value shown in the chart
- chart js showing different width of bar
- using library without 'require' when using CDN
- Chart.js bezier curve discontinuity
- Horizontal stacked angular bar charts
- Two different x-axes using charts.js and react
- How do you output the correct value for Chart.js Radar graph on label?
- How to sum the array value in javascript like chartjs data array and input value sum