不需要的Json出现在html中

I have a problem in my code which I can not see where the problem comes. When I get the JSON data in JS, shows the structure of the array on the Web page, as shown in the picture below. enter image description here

This is an excerpt from my JS code

var proj = document.getElementById('ProjetosSelect').value;
$.ajax({
    url: 'CRM files/TSread.php',
    type: "POST",
    data: ({ProjetosSelect: proj}),
    dataType: "json",
    complete:function(data) 
    {
        ProjetoHoras = data.responseJSON.total;
        ProjetoGastas = data.responseJSON.gastas;
        var PorGastar = ProjetoHoras - ProjetoGastas;
        $('#graficos').highcharts({
            chart: {
                type: 'column',
                margin: 75,
                options3d: {
                    enabled: true,
                    alpha: 10,
                    beta: 25,
                    depth: 70
                }
            },
            title: {
                text: 'Horas Contratadas'
            },
            plotOptions: {
                column: {
                    depth: 25
                }
            },
            xAxis: {
                categories: 
                 ['Horas Totails','Horas Gastas','Horas por Gastar']   

            },
            yAxis: {
                title: {
                    text: null
                }
            },
            series: [{
                name: 'Horas',
                data: [ProjetoHoras, ProjetoGastas, PorGastar]
            }]
        });

    }

});

and this is an excerpt from my PHP code

$output = array('total'=>(float)$BHoras[1], 'gastas'=>(float)$BHoras[2]);
echo json_encode($output);

it is possible to eliminate " {"total":0,"gastas":0} " from web page?

Content is echoed for both the web page and the ajax.

Each of them should have a distinct url. The PHP page which echos the array JSON should be in a different url from the webpage itself.

Otherwise, you can use a parameter to distinguish them like so:

In Javascript add:

data: ({ProjetosSelect: proj,action:'json'}),

In php:

    if( ! empty($_POST['action']) && $_POST['action] == 'json'){
      $output = array('total'=>(float)$BHoras[1], 'gastas'=>  (float)$BHoras[2]);
      echo json_encode($output);
   }