score:0
Accepted answer
You can make use of the tick callback for your K at the end (https://www.chartjs.org/docs/latest/axes/labelling.html#creating-custom-tick-formats)
var ctx2 = document.getElementById("stack-chart");
var stackChart1 = new Chart(ctx2, {
type: 'bar',
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
callback: (val) => (val + 'k')
}
}]
},
legend: {
display: false,
labels: {
fontSize: 20,
fontColor: '#595d6e',
}
},
tooltips: {
enabled: false
}
},
data: {
labels: ['1', '2', '3', '4', '5'],
datasets: [{
backgroundColor: "#5e63b4",
data: [20, 30, 40, 50, 60]
}]
},
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
<canvas id="stack-chart" width="1360" height="450"></canvas>
Source: stackoverflow.com
Related Articles
- chart js showing different width of bar
- chart js 2 how to set bar width
- Chartjs Bar Chart showing old data when hovering
- Chart.js Mixed Bar and Line chart with different scales
- chart.js Line chart with different background colors for each section
- Chart.js ng2-charts colors in pie chart not showing
- How to use PrimeNg Chart of Width and Height?
- Chart.JS Mixed Chart - Bars Not Showing
- Different color for each column in angular-chartjs bar chart
- ChartJs bar chart - keep bars left instead of equally spread across the width
- Can I specify a different font size for each row of text in Chart Title?
- ChartJS - Line Chart with different size datasets
- Line chart is showing under bar in combochart in chartjs
- Chart.js: width and height of a pie chart not respected
- Chart js - Get bar width after render
- Showing Percentage and Total In stacked Bar Chart of chart.js
- Chart js different background for y axis
- Chart.js, dashed line, full width chart
- Series Details Not Showing in Angular Chart with Charts.js
- Chart.js pie chart not showing in Google Chrome canvas
- chart js - Apply different color for each x-axes label
- Chart JS, Choose different Y-axis for different datasets
- How to dynamically set ChartJs line chart width based on dataset size?
- Different gridline steps on chart js line chart
- Chart.js different scaleLine color of radar chart (angular)
- How to get the actual chart width and height in chart.js
- Chart JS custom tooltip not showing
- ChartJS bar chart fixed width for dynamic data sets
- Changing width of chart.js chart without changing height
- Customize different tooltips of bar chart
- How to generate chartjs charts to pdf using laravel?
- Why do literal arrays work, but not coded arrays?
- Chart.js showing x-axis ticks even though set to false
- Chart.js chart appears and disappears on form submit
- How to render default values from Django Serializer for charting purposes?
- Split assoc array by keys
- Inline plugin doesn't work
- ChartJS - can't display all the items in the array
- wrong rendered bar chart Chart.js
- react-chartjs-2 tooltip callback not working
- Chart.js is not rendered until zoom in in angular 8
- How can i loop some specific key in each index json data and put it in dataset: data ? (chart.js)
- Insert value into a ChartJS with different data label
- Update ChartJS with MySQL Data
- On click event to show name of pie chart slice in chartsJS
- Add percentage to label badge - doughnut chart.js
- Draw data in graphics generated by Chart JS
- Angular charts is not displayed
- Datasets in Chart.js stacked barchart appear overlaid instead of stacked
- Chart.JS fixing maximum and minumum to a location on screen