score:4
Use bubble chart to draw chart. Below is the image for the same.
[Sample-code]
var ctx = document.getElementById("myChart");
var data = {
datasets: [
{
label : "Monday",
data: [
{
x: 2,
y: 5,
r: 12
},
{
x: 6,
y: 5,
r: 8
},
{
x: 10,
y: 5,
r: 8
},
{
x: 14,
y: 5,
r: 6
},
{
x: 18,
y: 5,
r: 6
},
{
x: 22,
y: 5,
r: 2
},
{
x: 26,
y: 5,
r: 2
},
{
x: 30,
y: 5,
r: 6
},
{
x: 34,
y: 5,
r: 8
},
{
x: 38,
y: 5,
r: 12
},
{
x: 42,
y: 5,
r: 12
},
{
x: 46,
y: 5,
r: 10
},
{
x: 50,
y: 5,
r: 12
},
{
x: 54,
y: 5,
r: 8
},
{
x: 58,
y: 5,
r: 8
}
],
backgroundColor:"#444",
hoverBackgroundColor: "#FF6384",
},
{
label : "Tuesday",
data: [
{
x: 2,
y: 15,
r: 12
},
{
x: 6,
y: 15,
r: 8
},
{
x: 10,
y: 15,
r: 8
},
{
x: 14,
y: 15,
r: 6
},
{
x: 18,
y: 15,
r: 6
},
{
x: 22,
y: 15,
r: 2
},
{
x: 26,
y: 15,
r: 2
},
{
x: 30,
y: 15,
r: 6
},
{
x: 34,
y: 15,
r: 8
},
{
x: 38,
y: 15,
r: 12
},
{
x: 42,
y: 15,
r: 12
},
{
x: 46,
y: 15,
r: 10
},
{
x: 50,
y: 15,
r: 12
},
{
x: 54,
y: 15,
r: 8
},
{
x: 58,
y: 15,
r: 8
}
],
backgroundColor:"#444",
},
{
label : "Wednesday",
data: [
{
x: 2,
y: 25,
r: 12
},
{
x: 6,
y: 25,
r: 4
},
{
x: 10,
y: 25,
r: 4
},
{
x: 14,
y: 25,
r: 2
},
{
x: 18,
y: 25,
r: 6
},
{
x: 22,
y: 25,
r: 12
},
{
x: 26,
y: 25,
r: 12
},
{
x: 30,
y: 25,
r: 6
},
{
x: 34,
y: 25,
r: 8
},
{
x: 38,
y: 25,
r: 12
},
{
x: 42,
y: 25,
r: 12
},
{
x: 46,
y: 25,
r: 10
},
{
x: 50,
y: 25,
r: 12
},
{
x: 54,
y: 25,
r: 8
},
{
x: 58,
y: 25,
r: 8
}
],
backgroundColor:"#444",
}
]
};
var myBubbleChart = new Chart(ctx,{
type: 'bubble',
data: data,
options: {
scales : {
xAxes : [{
display : false,
ticks : {
beginAtZero : true,
max : 70
}
}],
yAxes : [{
ticks: {
beginAtZero : true,
max : 40,
stepSize : 10
}
}]
}
}
});
Source: stackoverflow.com
Related Query
- create a multi line chart using Chart.js
- How to create stacked bar chart using react-chartjs-2?
- How to create single value Doughnut or Pie chart using Chart.js?
- Create multiple dynamic stacked chart using chart.js in Angular 10?
- How to create a gantt chart using Chart.js and populate dates?
- Create Chart using Reactjs Chartjs and axios
- create Chart using Chartjs and PHP
- How to create Waterfall model chart using QuickChart?
- How to create a Doughnut chart in django admin interface using foreign key field data?
- Using ChartJS to create a multiple grouped bar chart - see picture below
- How do you create a Radar chart using chart.js with a y-axis of 0 to 100?
- Cannot create Chart using Chart.JS @ 2.9.4
- Can't draw pie chart using chartjs - TypeError: Cannot create property '_meta' on number '16'
- Trying to create a custom tooltip in a doughnut chart using chartsjs, but it is not working
- Create multiple pie chart simultaneously using chart.js
- Create a pie chart using an array from a data table in chart.js
- How to create a line on a chart using chartjs-plugin-annotation
- 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
- Create Chart using $getJSON and ChartJS
- Background color does not work when trying to create my data before using scatter chart with chart.js
- Create a line chart using an user input table from a data table in chart.js
- How to take data from an API and create a chart on that using Chart.js and Angular 8?
- how to create line chart using chart.js in angular 2+
- How to run Chart.js samples using source code
- Create a chartjs pie chart using json data
- How to create an animate-on-update Stacked Bar chart using Chart.js(or Chartist)?
- how to create bar chart with group and sam color for each group using chart.js?
- Create chart using one of the given javascript libraries
- How to add text inside the doughnut chart using Chart.js?
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
More Query from same tag
- Chart.js: Combined Line and Bar Data
- Chart.js line split color
- How to get value of defaultdic in JS (Django framework)?
- ChartJS tooltip position / placement
- How to change Y axis labels
- Limit labesl on chart.js bar chart
- Sql Server query that returns prices from each shop on each date and adds a 0 if no data is present for the shopId on a particular date
- Display Doughnut Pie Chart As Circle Progress Chart.js
- line-trace tooltip along x-axis?
- ChartJS custom doughnut chart not showing in version 2.6.0
- How to always show a label in ChartJS in React
- ChartJS - Scale x axis labels from single days to multiple months
- Dynamically Creating Json Array Javascript
- Chart.js timeline
- Custom tooltip on Chart.js is coming undefined
- highlightFill for radar charts in chartJS
- Rest Api data fetching error while using chartjs
- Custom gridLines and Axes Chartjs
- Gradient effect with Chart.js and Angular
- Can I color the first bar in "Bart Char" differently?
- How to set only min and max values in y-axis (chart js)
- Chart.js - Datalabels not showing using formatter
- How can I hide the first Y Axis tick mark on ChartJs?
- Issues with Moment and ChartJS Time Format Parsing
- Chart.js dinamically populate data in Oracle Application Express
- ng2 charts on Angular 9 not responsive
- chart.js php live update
- Multiple Range Highlighting of Background in Chart.js
- Error when changing data after migrating to vue-chartjs 4
- Chart.js with React