how to put together two fixes in php and show the result in a graph

1

I have a question I am doing a php file with a swich case of different ways of representing graphs of some data but I have a problem with the linear graph my idea was to make two arrays one where the names are found and another where the data are found

case 5:
        //lineal
        $consulta= $obj->getQueryConsulta();
        $result = $catalogo->obtenerLista($consulta);
    $columnas = array();
    $series = array();
    while ($row = mysql_fetch_array($result)) {
        array_push($columnas, $row['datos']);
        array_push($series, $row['series']);
    }

When I print the two arrays, this comes out

Array ( [0] => Dirección [1] => Sistemas [2] => Comunicación Social [3] => Desarrollo Institucional [4] => S. Técnica [5] => Indicadores [6] => Exhibición [7] => Registro [8] => Fotografía [9] => Comunicación [10] => Difusión [11] => Electrónicos [12] => Prensa [13] => Mediación [14] => Académicos [15] => Editorial [16] => Arquitectura [17] => Museografía [18] => Administración [19] => Presupuesto [20] => R. Humanos [21] => R. Materiales [22] => R. Financieros [23] => Jurídico [24] => Custodios [25] => Amigos P. [26] => Seguridad [27] => Amigos D. E. [28] => Amigos S. [29] => Contabilidad P. [30] => Tienda [31] => Cultura [32] => INBA [33] => Taquilla [34] => Archivo [35] => Servicios al Público [36] => Servicio Social [37] => Diseño [38] => Proyectos Especiales [39] => Personal de Museo )
Array ( [0] => 1 [1] => 25 [2] => 0 [3] => 0 [4] => 3 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 1 [10] => 1 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 0 [17] => 0 [18] => 0 [19] => 0 [20] => 0 [21] => 0 [22] => 0 [23] => 0 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => 0 [29] => 0 [30] => 0 [31] => 0 [32] => 0 [33] => 0 [34] => 0 [35] => 0 [36] => 0 [37] => 0 [38] => 0 [39] => 0 )

My question is how can I join those two into one and then go through that new arrangement and show it on a linear chart of higtcharts

    
asked by carlos becerra 31.10.2018 в 00:02
source

1 answer

1

You could create a single array in the following way:

case 5:
    //lineal
    $consulta= $obj->getQueryConsulta();
    $result = $catalogo->obtenerLista($consulta);
    $datos = array();
    while ($row = mysql_fetch_array($result)) {
        $datos[$row['datos']] = $row['series'];
    }
    
answered by 31.10.2018 / 00:08
source