<?PHP
include ("conexion/SecurityAccess.php");
?>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>Highcharts Example</title>

		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
		<style type="text/css">
${demo.css}
		</style>
		<script type="text/javascript">
$(function () {
    $('#container').highcharts({
        chart: {
            type: 'bar'
        },
        title: {
            text: 'TOP 10 - Tablas con mayor peso (Mb)'
        },
        subtitle: {
            text: 'Datos recabados de servidor MySQL - [Base de Datos]'
        },
        xAxis: {
            categories: [
			
			<?php
			$FechaHoy=date("Y/m/d");
			$sql=mysql_query("SELECT table_name Tabla,(data_length+index_length) Tamano FROM information_schema.tables WHERE table_schema='wms_ibermex' Order By Tamano DESC Limit 0,10");
			while($res=mysql_fetch_array($sql)){
			?>
			
			['<?php echo $res['Tabla'] ?>'],
			
			<?php
			}
			?>
			
			],
            title: {
                text: null
            }
        },
        yAxis: {
            min: 0,
            title: {
                text: 'Top 10',
                align: 'high'
            },
            labels: {
                overflow: 'justify'
            }
        },
        tooltip: {
            valueSuffix: ' Mb'
        },
        plotOptions: {
            bar: {
                dataLabels: {
                    enabled: true
                }
            }
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'top',
            x: -40,
            y: 100,
            floating: true,
            borderWidth: 1,
            backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
            shadow: true
        },
        credits: {
            enabled: false
        },
        series: [{
            name: 'Tamaño',
            data: [
			
			<?php
			$FechaHoy=date("Y/m/d");
			$sql=mysql_query("SELECT table_name Tabla,(data_length+index_length) Tamano FROM information_schema.tables WHERE table_schema='wms_ibermex' Order By Tamano DESC Limit 0,10");
			while($res=mysql_fetch_array($sql)){
			?>
			
			[<?php echo $res['Tamano'] ?>],
			
			<?php
			}
			?>
			
			]
        }]
    });
});
		</script>
	</head>
	<body>
<script src="Highcharts-4.1.5/js/highcharts.js"></script>
<script src="Highcharts-4.1.5/js/modules/exporting.js"></script>

<div id="container" style="min-width: 310px; max-width: 600px; height: 300px; margin: 0 auto"></div>

	</body>
</html>