English on the botton.

Pessoal,

Estou tentando colocar na mesma página 2 gráficos e 1 Mapa, como posso 
executar?

Abaixo, segue o código:

<script type="text/javascript">

    // Load the Visualization API and the piechart package.
    //google.load('visualization', '1.0', {'packages':['corechart']});
    google.charts.load('current', {'packages':['corechart']});
    //google.charts.load('upcoming', { 'packages': ['map'] });


    // Set a callback to run when the Google Visualization API is loaded.
    //google.setOnLoadCallback(drawChart);
    google.charts.setOnLoadCallback(drawChart);

    // Callback that creates and populates a data table,
    // instantiates the pie chart, passes in the data and
    // draws it.
    function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Status');
        data.addColumn('number', 'Qtd');
        data.addRows([
            ['Aguardando Início', 6],
            ['Em andamento', 11],
            ['Concluídas', 8],
            ['Canceladas', 2]

        ]);

        // Set chart options
        var options = {
            title:'Status das Viagens - Mês',
            colors: ['#1c91c0', '#f1ca3a', '#6f9654', '#e0440e'],
            titleTextStyle: {
                fontSize:18,
                fontName: 'Lato'
            },
            chartArea:{
                left:50,
                top:30,
                width:'65%',
                height:'75%'
            },
            legend: { alignment:'center' },
            pieHole: 0.4
            //,is3D: true
            //,width:100
            //,height:300
        };

        // Create the data table.
        var data2 = new google.visualization.DataTable();
        data2.addColumn('string', 'Status');
        data2.addColumn('number', 'Abertura');
        data2.addColumn('number', 'Em andamento');
        data2.addColumn('number', 'Conclusão');
        data2.addColumn('number', 'Cancelamento');
        data2.addRows([
            ['28/01', 8, 4, 6, 9],
            ['29/01', 5, 8, 1, 6],
            ['30/01', 10, 3, 7, 20],
            ['31/01', 7, 2, 8, 11]
        ]);

        // Set chart options
        var options2 = {
            title:'Viagens diárias por status',
            colors: ['#1c91c0', '#f1ca3a', '#6f9654', '#e0440e'],
            titleTextStyle: {
                fontSize:18,
                fontName: 'Lato'
            },
            vAxes: {
                // Adds titles to each axis.
                0: {title: 'Qtde. Viagens',
                    minValue: 0
                }
            },
            chartArea:{
                left:50,
                top:30,
                width:'65%',
                height:'75%'
            },
            legend: { alignment:'center' }
        };

        var data3 = google.visualization.arrayToDataTable([
            ['Lat', 'Long', 'Local'],
            [-21.3809029, -47.7045149, 'Local 1'],
            [-23.1520142, -46.9393065, 'Local 2'],
            [-23.0524649, -47.0494738, 'Local 3']
        ]);

        var options3 = {
            title:'Localização',
            showTooltip: true,
            showInfoWindow: true
        };

        // Instantiate and draw our chart, passing in some options.
        var chart = new 
google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
        var chart2 = new 
google.visualization.LineChart(document.getElementById('chart_div2'));
        chart2.draw(data2, options2);
        var chart3 = new 
google.visualization.Map(document.getElementById('chart_div3'));
        chart3.draw(data3, options3);
    }

    $(window).resize(function(){
        drawChart();
    });
</script>


<div class="container">
    <div class="row">
        <section>
            <form role="form">
                <div class="row mar_ned col-md-12 col-xs-12 col-sm-12 
col-lg-12">
                    <p>Bem vindo ao sistema de gestão de produtos 
Ciltronics!</p>

                    <hr>

                    <div class="row mar_ned">

                    </div>

                    <div class="row mar_ned col-sm-12 col-md-12 col-lg-12 
col-xs-12 ">
                        <div class="col-sm-6 col-md-6 col-lg-6">
                            <div id="chart_div" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>

                        <div class="col-sm-6 col-md-6 col-lg-6">
                            <div id="chart_div2" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>
                    </div>

                    <div class="row mar_ned col-sm-12 col-md-12 col-lg-12 
col-xs-12 ">
                        <div class="col-sm-12 col-md-12 col-lg-12">
                            <div id="chart_div3" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>
                    </div>

                    <div class="row mar_ned">

                    </div>

                </div>
            </form>
        </section>
    </div>
</div>

Desde já agradeço a ajuda.

-

Folks,

I'm trying to put on the same page 2 charts and 1 Map, how can I execute?

Below is the code:

<script type="text/javascript">

    // Load the Visualization API and the piechart package.
    //google.load('visualization', '1.0', {'packages':['corechart']});
    google.charts.load('current', {'packages':['corechart']});
    //google.charts.load('upcoming', { 'packages': ['map'] });


    // Set a callback to run when the Google Visualization API is loaded.
    //google.setOnLoadCallback(drawChart);
    google.charts.setOnLoadCallback(drawChart);

    // Callback that creates and populates a data table,
    // instantiates the pie chart, passes in the data and
    // draws it.
    function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Status');
        data.addColumn('number', 'Qtd');
        data.addRows([
            ['Aguardando Início', 6],
            ['Em andamento', 11],
            ['Concluídas', 8],
            ['Canceladas', 2]

        ]);

        // Set chart options
        var options = {
            title:'Status das Viagens - Mês',
            colors: ['#1c91c0', '#f1ca3a', '#6f9654', '#e0440e'],
            titleTextStyle: {
                fontSize:18,
                fontName: 'Lato'
            },
            chartArea:{
                left:50,
                top:30,
                width:'65%',
                height:'75%'
            },
            legend: { alignment:'center' },
            pieHole: 0.4
            //,is3D: true
            //,width:100
            //,height:300
        };

        // Create the data table.
        var data2 = new google.visualization.DataTable();
        data2.addColumn('string', 'Status');
        data2.addColumn('number', 'Abertura');
        data2.addColumn('number', 'Em andamento');
        data2.addColumn('number', 'Conclusão');
        data2.addColumn('number', 'Cancelamento');
        data2.addRows([
            ['28/01', 8, 4, 6, 9],
            ['29/01', 5, 8, 1, 6],
            ['30/01', 10, 3, 7, 20],
            ['31/01', 7, 2, 8, 11]
        ]);

        // Set chart options
        var options2 = {
            title:'Viagens diárias por status',
            colors: ['#1c91c0', '#f1ca3a', '#6f9654', '#e0440e'],
            titleTextStyle: {
                fontSize:18,
                fontName: 'Lato'
            },
            vAxes: {
                // Adds titles to each axis.
                0: {title: 'Qtde. Viagens',
                    minValue: 0
                }
            },
            chartArea:{
                left:50,
                top:30,
                width:'65%',
                height:'75%'
            },
            legend: { alignment:'center' }
        };

        var data3 = google.visualization.arrayToDataTable([
            ['Lat', 'Long', 'Local'],
            [-21.3809029, -47.7045149, 'Local 1'],
            [-23.1520142, -46.9393065, 'Local 2'],
            [-23.0524649, -47.0494738, 'Local 3']
        ]);

        var options3 = {
            title:'Localização',
            showTooltip: true,
            showInfoWindow: true
        };

        // Instantiate and draw our chart, passing in some options.
        var chart = new 
google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
        var chart2 = new 
google.visualization.LineChart(document.getElementById('chart_div2'));
        chart2.draw(data2, options2);
        var chart3 = new 
google.visualization.Map(document.getElementById('chart_div3'));
        chart3.draw(data3, options3);
    }

    $(window).resize(function(){
        drawChart();
    });
</script>


<div class="container">
    <div class="row">
        <section>
            <form role="form">
                <div class="row mar_ned col-md-12 col-xs-12 col-sm-12 
col-lg-12">
                    <p>Bem vindo ao sistema de gestão de produtos 
Ciltronics!</p>

                    <hr>

                    <div class="row mar_ned">

                    </div>

                    <div class="row mar_ned col-sm-12 col-md-12 col-lg-12 
col-xs-12 ">
                        <div class="col-sm-6 col-md-6 col-lg-6">
                            <div id="chart_div" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>

                        <div class="col-sm-6 col-md-6 col-lg-6">
                            <div id="chart_div2" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>
                    </div>

                    <div class="row mar_ned col-sm-12 col-md-12 col-lg-12 
col-xs-12 ">
                        <div class="col-sm-12 col-md-12 col-lg-12">
                            <div id="chart_div3" style="width: 100%; 
max-width: 550px; min-height: 250px; border: 1px outset #cfcfcf;"></div>
                        </div>
                    </div>

                    <div class="row mar_ned">

                    </div>

                </div>
            </form>
        </section>
    </div>
</div>

tks to help

Att,

Lindolfo Junior
61 9 99771425

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/6571b0ea-55f9-4846-849e-87b7ead7f362%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to