Hey guys,
I'm very new to this so please forgive me.
I have a theme that I am trying to use to display some stats from my minecraft server (Yes I am one of those people :) )
The dashboard theme has a load of charts that are in a <scipt> tag and I am basically wondering how I use some values that I am getting through a json query.
This is what I have and what I thought would work, but obvisly it is not otherwise I would not be here.
<div class="col-md-4 col-sm-4 mb"> <div class="grey-panel pn donut-chart"> <div class="grey-header"> <h5>Online Players</h5> </div> <canvas id="serverstatus01" height="120" width="120"></canvas> <script>
var doughnutData = [
{
value: <?php echo $info['playerCount']; ?>,
color:"#FF6B6B"
},
{
value : <?php echo $info['maxPlayers']; ?>,,
color : "#fdfdfd"
}
];
var myDoughnut = new Chart(document.getElementById("serverstatus01").getContext("2d")).Doughnut(doughnutData);
</script> <div class="row"> <div class="col-sm-6 col-xs-6 goleft"> <p>Usage<br/>Increase:</p> </div> <div class="col-sm-6 col-xs-6"> <h2>21%</h2> </div> </div> </div><! --/grey-panel --> </div><!-- /col-md-4-->
I have this at the top which includes my .php files on the core file.
<?php
include('core/init.inc.php')
$info = fetch_server_info($config['server']['ip'], $config['server']['port'];
?>