score:0
you can use floating bars for this:
var options = {
type: 'bar',
data: {
labels: ["red", "blue", "yellow", "green", "purple", "orange"],
datasets: [{
label: '# of votes',
data: [
[2, 3],
[1, 6],
[4, 8],
[6, 9],
[1, 5],
[0, 3]
],
backgroundcolor: 'orange'
}, ]
},
options: {}
}
var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
new chart(ctx, options);
<body>
<canvas id="chartjscontainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/3.6.0/chart.js"></script>
</body>
Source: stackoverflow.com
Related Query
- Chart.js HiLo chart example
- what is wrong with my code ? java script chart position
- How to print a chart rendered by code
- VueJS + Chartjs - Chart only renders after code change
- How do I destroy/update Chart Data in this chart.js code example?
- getting additional value fields from data source for dx.chartjs doughnut chart
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Getting the HTML code of a chart created by chart.js
- How to run Chart.js samples using source code
- ChartJs doesn't work on a local downloaded page of Circular Gauge chart example
- Chart.js Example Code not working
- how to not repeat code while creating multiple charts in chart js
- Set height of chart in Chart.js
- Dynamically update values of a chartjs chart
- How to add text inside the doughnut chart using Chart.js?
- How to clear a chart from a canvas so that hover events cannot be triggered?
- In Chart.js set chart title, name of x axis and y axis?
- Limit labels number on Chart.js line chart
- Chart.js - How to set a line chart dataset as disabled on load
- chart js 2 how to set bar width
- How can labels/legends be added for all chart types in chart.js (chartjs.org)?
- Chartjs Bar Chart showing old data when hovering
- Chart.js Show labels on Pie chart
- Chart Js Change Label orientation on x-Axis for Line Charts
- Chart area background color chartjs
- Chart.js - Increase spacing between legend and chart
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- Draw horizontal line on chart in chart.js on v2
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- Remove the vertical line in the chart js line chart
More Query from same tag
- Skip x labels on line chart
- How to know which bar is clicked on chart.js bar chart with multiple data?
- ReactJs: componentWillReceiveProps doesn't get called for component whose redux action gets dispatched last
- Change tooltip positioning in doughnut chart using Chart.js
- Line is rendering only vertical line instead of sloped line
- Hide x-Axis from angularjs-chartjs
- ChartJs - Footer color dynamically
- Charts.js : How to remove the Vertical Black lines in Bar Chart
- hide labels and 0 values in chart.js?
- How to display date instead of year in morris line chart in js
- Want only line not area under it in chart js
- Chartjs: how to show only max and min values on y-axis
- PHP Date and Time, getting the 1st, 2nd, 3rd, and 4th week in a month
- Blazor server-side Chartjs
- Set different color for each bars using ChartJS in Angular 4
- Angular ChartJS 2.9.4 issue updating chart
- How to build dynamic charts with Chart.js
- Can I bind an onclick event and edit a point in chartjs
- Type check for getElementById only works with optional chaining, not with type check
- Changing Legend Label Position in VueChartjs
- Chart.js have the y-axis step from 20 to 1 (instead of 1 to 20)
- Pass variable from function js to other function js
- How to show bar labels in legend in Chart.js 2.1.6?
- How could I implement chartjs-plugin-datalabels in chartjs-node-canvas?
- Dotted lines using Chart.js
- Why prettier put a comma ',' at the last element of the object
- Using Chart.js with Pyramid Web Framework
- how to integrate the Material UI slider with chart js
- Ionic/Chart.js - Cannot read property 'nativeElement' of undefined
- How to achive Chart JS weather chart of 5 day / 3 hour forecast data