Topic: Double/multiple datasets in a bar chart using only mdb-data attributes
Igor priority asked 8 months ago
Is is possible to create a bar chart with multiple datasets without additional JS code. So instead of:
const dataChartBarDoubleDatasetsExample = {
type: 'bar',
data: {
labels: ['Desktop', 'Mobile', 'Tablet'],
datasets: [
{
label: 'Users',
data: [510, 653, 255],
},
{
label: 'Page views',
data: [1251, 1553, 1355],
},
],
},
};
If should be something like
<canvas
data-mdb-chart-init
data-mdb-chart="bar"
data-mdb-dataset-label='["Mon","Tue","Wed","Thu","Fri"]'
data-mdb-dataset-data="[ [1,2,3,4,5], [5,4,3,2,1] ]"
></canvas>
or maybe even better with appropriate labels like
<canvas
data-mdb-chart-init
data-mdb-chart="bar"
data-mdb-dataset-label='["Mon","Tue","Wed","Thu","Fri"]'
data-mdb-dataset-data='[ ["Hapiness":[1,2,3,4,5]], ["Productivity":[5,4,3,2,1]] ]'
></canvas>
Add comment
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 7.1.0
- Device: Any
- Browser: Any
- OS: Any
- Provided sample code: No
- Provided link: No