[Javascript] Grafico ajax non funziona

max1974

Utente Attivo
7 Mar 2013
107
0
16
sto utilizzando http://lobianijs.com/site/lobiadmin
e cercando di creare un grafico ma non mi funziona .....
sapreste darmi qualche suggerimento per favore ???
i dati che tornano indietro dal file "ajax_stat.php" sono corretti
Codice:
<div id="chartjs">
    <div class="row">
      <div class="col-lg-12">
          <div id="doughnut-chart" class="panel panel-light">
              <div class="panel-heading">
                  <div class="panel-title">
                      <h4>TEST</h4>
                  </div>
                  <select class="Tipo_Sel_Avanz" title="Project Menager" style="margin-left:10px;">
                    <option value="PM-AVANZ">Project Menager</option>
                    <option value="ST-AVANZ">Soggetto Tecnico</option>
                    <option value="SPEC-AVANZ">Specializzazione</option>
                  </select>
              </div>
              <div class="panel-body">
                <div id="avanz_pm1">
                </div>
              </div>
          </div>
      </div>
    </div>
    <script type="text/javascript">


        (function(){
            LobiAdmin.loadScript([
                'js/plugin/highlight/highlight.pack.js'
            ], function(){
                LobiAdmin.highlightCode();
            });
           
            LobiAdmin.loadScript('js/plugin/easypiechart/jquery.easypiechart.min.js', initPage);
            function initPage(){
              $('.panel').lobiPanel({
                  reload: false,
                  editTitle: false,
                  sortable: true
              });
//------------------------------------------------------------------------------
              $('.Tipo_Sel_Avanz').change(function() {
                  $Sel=this.value;
                  $.ajax({
                      url:'php/ajax_stat.php',
                      data: {Tipo_Sel: $Sel},
                      type: 'POST',
                      dataType: 'json',
                      success: function(response){
                        $('#avanz_pm1').html("");
                        $.each(response,function(key,val){
                          //$('#avanz_pm').append('<div class="col-sm-3 col-md-2 col-lg-1" style="padding-bottom: 40px"><div class="progress-bar1" data-percent="'+val.avanz+'" data-duration="2000" data-color="#ccc,'+COLOR5+'"><span class="lbl_nome">'+val.descrizione+'</span></div></div>');
                          $('#avanz_pm1').append(''
                              +'<div class="easy-pie-chart-wrapper">'
                              +'<div class="easy-pie-chart" data-percent="'+val.avanz+'" data-size="170" data-line-width="35" data-bar-color="#1e6199" data-line-cap="butt">'
                              +    '<span class="percentage"></span>'
                              +'</div>'
                              +'<div class="label">'+val.descrizione+'</div>'
                              +'</div>');
                          })
                        }
                  });
                });
//---------------------------- STATUS INIZIALE --------------------------------
                $('.Tipo_Sel_Avanz')
                    .val('PM-AVANZ')
                    .trigger('change');

                $('.easy-pie-chart').easyPieChart({
                    animate: 1000,
                    onStep: function ($el, maxValue, curValue) {
                        $(this.el).find('.percentage').text(Math.round(curValue) + '%');
                    }
                });
            }
          })

    </script>
</div>