score:1
Accepted answer
you can get a result close to your example image, but not exactly the same. you would probably need to create a custom axis to align the tick labels to the zero line.
let axisconfig = {
drawborder: false,
gridlines: {
linewidth: 0,
zerolinewidth: 1
},
ticks: {
max: 6,
min: -6
}
};
new chart(document.getelementbyid("chart"), {
type: "scatter",
options: {
scales: {
xaxes: [axisconfig],
yaxes: [axisconfig]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.8.0/chart.min.js"></script>
<canvas id="chart"></canvas>
Source: stackoverflow.com
Related Query
- chart.js: How do I make the radar chart axis labels bigger?
- Chart.js - how to make proportional intervals on X axis on line chart
- Chart.js How to make a sample math axis?
- How to make chart which has both positive and negative value, starts with 0 - x axis
- How can I make two of my lines in Chart JS thicker
- How can I make a stepline or stepped chart in chart.js or D3?
- How do I change the 'months' language displayed on the date axis in Chart JS?
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- how to make a chart.js bar chart scrollable
- how to programmatically make a line chart point active/highlighted
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- How to make Chart JS responsive?
- How to make bar chart animation where all bars grow at the same speed?
- How to make a chart scroll horizontally (when using Chart.js)
- How can I make line on chart thinner?
- How to make a chart with an associative array with chart.js?
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- ChartJS: how to make a bar chart with a horizontal guideline:
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- How to make aspecific API call from within a Line Chart class in ReactJS using react-chartjs-2?
- How to Remove axis Lines from chart in chart js
- how to minimize x axis labels to day hours in chart js
- how to label axis within radar chart with chart.js
- How to stop axis label from being cut off in chart JS?
- Chart JS, ng2-Charts - How to make the label to the right of pie chart instead on top?
- How to make the chart smaller than its container
- How to set custom Y Axis Values (Chart.js v2.8.0) in Chart Bar JS
- How to make dynamic chart using Vue component with chart-js
- How to apply dollar sign in Y- axis in chart js?
- How do i make a new chart by pressing a button (chart.js)?
More Query from same tag
- Show Donut / Pie Chart in bootstrap modal with legends
- Dynamic Chart in PHP using Chart js
- Uncaught TypeError: Cannot read property 'draw' of undefined for object scale
- (Chart.js 3.7.0) change position of x-axis ticks to alternate between each tick?
- Chart.js customization, two Y-Axis overlay, chart area padding, odd tick padding
- Draw Line Chart Using Chart.js
- Chart bundle js is not showing dynamic data
- Chart.js horizontal bar width
- Chartjs unselected lines on render
- How do I align chart.js pie charts?
- Chart.Js - Hightligh an area in the background
- Chartjs - resize an image positioned in a column
- How to plot multiple value for one X-axis chart.js
- return percentage in chart.js (v2+) legend
- Chart.js dynamic dataset and tooltip on stacked bar
- ChartJS set yAxes "ticks"
- Chart.js - x-axis and tooltip label shows "undefined" in Chrome when browser language is NOT English
- charts.js and timestamp as readable date
- Chart js: generate dynamic labels according to the data
- Chartkick-vue bar chart - "horizontalBar" is not a registered controller
- How to add an empty data point to a linechart on Chart.js?
- react-chartjs state update error
- Chart JS display Data Value on the top of the Bar
- Where do I use chartjs's destroy function?
- Plot a multi-line graph from grouped JSON object using Charts.js
- How change all dates in array into date without time - laravel
- How do I access chart.js options dynamically?
- Chart point hover error
- In chartjs, add link text on tooltip
- Chart.js stacked bar chart - sorting values in bar by value