Topic: mdbootstrap chart with json data - how to import

Klaudia free asked 3 years ago

I would really appreciate if somebody could help me with figured out how to import data from external json file into the bootsrap chart.

I have already tried to write something based on the line chart but it doesn't show any data on the chart.

Here is the part of the full code:

$(document).ready(function() { var data = []; $.getJSON("", function(result) { for (var i = 0; i <= result.dataPoints.length - 1; i++) { data.push({ labels:result.dataPoints[i].label, datasets:({

    data: parseInt(result.dataPoints[i].y)

var ctxL = document.getElementById("BBBB").getContext('2d'); var myLineChart = new Chart(ctxL, { type: 'line', data: data



Magdalena Dembna staff commented 3 years ago

Hi, can you create a code snippet here: It would be much easier to reproduce your case and find a solution.

Klaudia free commented 3 years ago - here is the link

id= chartContainer - it is an example which I found (It works in CHROME on my comp) id=lineChartA1 - mdbootsrap chart id=BBBB - mdbootrap chart into which I would like to upload the data from json

Magdalena Dembna staff commented 3 years ago

I have created a code snippet with the call to your API:

Klaudia free commented 3 years ago

Thank you very much! That is exactly what I was looking for :)

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: DELL
  • Browser: CHROME
  • OS: Windows 7
  • Provided sample code: No
  • Provided link: Yes