Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: chart.js - what version is in MDB Pro 4.12?

cdenby pro asked 4 years ago


I'm trying to get a bar chart built with multiple datasets (grouped bars) and the documentation that is available is all pointing to chart.js 2.x. What version is in MDB? Do you have examples of the syntax to build group bars?


Mateusz Łubianka staff answered 4 years ago


Hi @cdenby,

In MDB is 2.7.3 vesrion of Chart.js. If you want to create chart with grouped bars, you should to use datasets. For example:

var data = {
labels: ["zzz", "yyy", "zzz"],
datasets: [
{
label: "Green",
backgroundColor: "green",
data: [8,7,6]
}
{
label: "Blue",
backgroundColor: "blue",
data: [2,3,9]
},
{
label: "Orange",
backgroundColor: "orange",
data: [10,5,7]
}
You can see examples in MDB snippets:

https://mdbootstrap.com/snippets/jquery/pjoter-2-0/1047503 https://mdbootstrap.com/snippets/jquery/marta-szymanska/666684

Best,



Please insert min. 20 characters.

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: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.12.0
  • Device: PC
  • Browser: Chrome
  • OS: W10
  • Provided sample code: No
  • Provided link: No