Sha256: c86a917611fa3690e02143dc37a0e72efdcbdec20fabba37f59b23015a482145

Contents?: true

Size: 943 Bytes

Versions: 48

Compression:

Stored size: 943 Bytes

Contents

-if serie.empty?
  == empty_alert({ :title => "Sin datos suficientes", :message => "No hay suficientes datos para mostrar esta informaciĆ³n."})
-else
  .ct-chart.pie id="#{id}"

  .table-responsive.chart-table
    table.table.table-striped
      tbody
        tr
          -for label in labels
            th #{label}
        tr
          -for element in serie
            td #{element}
        tr
          -total = [1,serie.reduce(:+)].max
          -for element in serie
            td #{(element.to_f*100/total).round(0)}%

  javascript:
    var labels = #{{labels}};
    var serie = #{{serie}};

    new Chartist.Pie("##{id}", {
        labels: labels,
        series: serie
      }, {
        fullWidth: true,
        showLabel: false,
        height: '300px',
        plugins: [
          Chartist.plugins.legend()
        ]
      }
    );

  css:
    .pie .ct-legend.ct-legend-inside {
      position: absolute;
      top: 60px;
    }

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
sinatra-hexacta-1.7.20 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.19 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.18 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.17 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.16 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.15 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.14 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.13 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.12 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.11 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.10 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.9 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.8 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.7 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.6 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.5 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.4 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.3 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.2 lib/sinatra/views/charts/pie.slim
sinatra-hexacta-1.7.0 lib/sinatra/views/charts/pie.slim