New generated JS

This commit is contained in:
snipe 2016-05-24 16:10:04 -07:00
parent 14dac9b371
commit 84edc9cf25
5 changed files with 111 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
{
"assets/css/app.css": "assets/css/app-060dd24c8f.css",
"assets/js/all.js": "assets/js/all-640cf0ee36.js"
"assets/js/all.js": "assets/js/all-edd914620a.js"
}

View file

@ -16,6 +16,7 @@ if (typeof jQuery === "undefined") {
throw new Error("AdminLTE requires jQuery");
}
/* AdminLTE
*
* @type Object
@ -743,4 +744,12 @@ function _init() {
}
});
};
}(jQuery));
}(jQuery));
//-------------
//- PIE CHART -
//-------------
// Get context with jQuery - using jQuery's .get() method.

View file

@ -4,6 +4,47 @@
* @param {JSON} settings Insulated `window.snipeit.settings` object.
* @return {IIFE} Immediately invoked. Returns self.
*/
var pieOptions = {
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: "#fff",
//Number - The width of each segment stroke
segmentStrokeWidth: 1,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 100,
//String - Animation easing effect
animationEasing: "easeOutBounce",
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false,
//Boolean - whether to make the chart responsive to window resizing
responsive: true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio: false,
//String - A legend template
legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li>" +
"<i class='fa fa-circle-o' style='color: <%=segments[i].fillColor%>'></i>" +
"<%if(segments[i].label){%><%=segments[i].label%><%}%> foo</li><%}%></ul>",
//String - A tooltip template
tooltipTemplate: "<%=value %> <%=label%> "
};
console.dir(pieOptions);
//Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
//pieChart.Doughnut(PieData, pieOptions);
//-----------------
//- END PIE CHART -
//-----------------
(function($, settings) {
var Components = {};
Components.modals = {};
@ -48,3 +89,6 @@
new Components.modals.confirmDelete().render();
});
}(jQuery, window.snipeit.settings));

View file

@ -72,9 +72,10 @@
</div>
<!-- morris bar & donut charts -->
<!-- recent activity -->
<div class="row">
<div class="col-md-12">
<div class="col-md-9">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('general.recent_activity') }}</h3>
@ -167,17 +168,65 @@
</div><!-- ./box-body -->
</div><!-- /.box -->
</div>
<div class="col-md-3">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('general.status') }}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="row">
<div class="col-md-12">
<div class="chart-responsive">
<canvas id="statusPieChart" height="150"></canvas>
</div>
<!-- ./chart-responsive -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
</div>
<!-- /.box -->
</div>
</div>
@section('moar_scripts')
<script src="{{ asset('assets/js/plugins/chartjs/Chart.min.js') }}"></script>
<script>
<!-- AdminLTE for demo purposes -->
<script src="/assets/js/demo.js"></script>
var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d");
var pieChart = new Chart(pieChartCanvas);
var ctx = document.getElementById("statusPieChart");
$.get('{{ route('api.statuslabels.assets') }}', function (data) {
var myPieChart = new Chart(ctx,{
type: 'doughnut',
data: data,
options: pieOptions
});
// document.getElementById('my-doughnut-legend').innerHTML = myPieChart.generateLegend();
});
</script>
@stop
@stop