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
- Duplicate of legends are Produced in ng2 chart
- Charts.js - How to set custom tooltip text for each dataset
- Remove top horizontal line in a horizontal bar chart (Chart.js 2)
- Chart.js - Pie chart calculate sum of visible values after legend click
- Chartjs tooltip location when enlarged
- Chart.js not showing correctly/install issues
- Placing canvas (chart.js line chart) inside an SVG using d3.js
- Chart.js get array of currently visible points on graph
- Unable to plot JSON to chartJS
- TypeError: this.scale undefinded when using Chart.js and Angularjs
- AngularJS Charts not updating data correctly
- chart.js 2.0 add new property to dataset
- how to change size of point in ChartJS
- how to use chart.js with react Hook?
- How to add Dyamic JSON Dropdown Menu in Angular JS
- ChartJS Datalabels plugin and negative numbers
- Unwanted line chart ''shadow" using chart.js
- Adding line over stacked line chart with ChartJS
- Chartjs-node with canvas-prebuilt is still throwing 'Cairo not found' errors
- How can I get two stacked chart.js charts to be different types?
- chart.js-datalabels-plugins don't work
- Chartjs: How do you toggle the visibility of charts in Ionic 4
- ChartJS changing graphs based upon Drop Down selection
- react-chartjs-2 how to set multiple background levels within a line chart
- Implement ng2-charts in an Angular-Seed
- chart.js break line in a label with a tooltip callback
- Chartjs Add-Ons
- chart.js and asynchronous loading
- Chart JS Tooltip - place it in a fixed location outside the canvas
- How to use chartjs-plugin-annotation in Angular