lukesb free asked 7 years ago


Hi, I'm having trouble fining where I would set the height of a chart. Can anyone help please?

lukesb free answered 7 years ago


Last post didn't work for some reason I used your example and it now works great. Thanks so much for helping me with this :D

Magdalena Obalska free answered 7 years ago


Here's some example of working Chart code - try it with changing a value of a given height. Take a look at http://www.chartjs.org/docs/, it can be helpful too. <canvas id="myChart" height="50"></canvas> <script> $(function () { var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; var option = { responsive: true, }; // Get the context of the canvas element we want to select var ctx = document.getElementById("myChart").getContext('2d'); var myLineChart = new Chart(ctx).Line(data, option); //'Line' defines type of the chart. }); </script>

Julius Ssemakula free commented 4 years ago

Thank Magdalena. I used this post and it has helped me


lukesb free answered 7 years ago


Thanks Madgalena. I orginally had style="height:350px", which didn't work I tried your method and that too is not working :(

Magdalena Obalska free answered 7 years ago


Hey, here's an example how to create a Chart: <canvas id="myChart" height="200"></canvas>.

IngoJust pro commented 4 years ago

This solution worked for me, too.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags