Faire un Statistique en ASP MVC pour le mois

Signaler
Messages postés
24
Date d'inscription
mercredi 8 janvier 2020
Statut
Membre
Dernière intervention
22 juin 2021
-
je veux afficher les donner de la BD pour faire les statistique du mois qui évolue a chaque foi qu'on passe au mois suivant.


<div class="row">
<div class="col-lg-12">
<div id="panel-1" class="panel">
<div class="panel-hdr">
<h2>
Statistique des données
</h2>
</div>
<div class="panel-container show">
<div class="panel-content bg-subtlelight-fade">
<div id="js-checkbox-toggles" class="d-flex mb-3">
<div class="custom-control custom-switch mr-2">
<input type="checkbox" class="custom-control-input" name="gra-0" id="gra-0" checked="checked">
<label class="custom-control-label" for="gra-0"> Dépar effectuer</label>
</div>
</div>
<div id="flot-toggles" class="w-100 mt-4" style="height: 300px"></div>
</div>
</div>
</div>
</div>
</div>

@section ScriptsBlock {
<script type="text/javascript">
/* Activate smart panels */
$('#js-page-content').smartPanel();</script>
<script src="~/js/statistics/peity/peity.bundle.js"></script>
<script src="~/js/statistics/flot/flot.bundle.js"></script>
<script src="~/js/statistics/easypiechart/easypiechart.bundle.js"></script>
<script src="~/js/datagrid/datatables/datatables.bundle.js"></script>
<script>
/* defined datas */
var dataTargetProfit = [
[1354586000000, 153],
[1364587000000, 658],
[1374588000000, 198],
[1384589000000, 663],
[1394590000000, 801],
[1404591000000, 1080],
[1414592000000, 353],
[1424593000000, 749],
[1434594000000, 523],
[1444595000000, 258],
[1454596000000, 688],
[1464597000000, 364]
]
$(document).ready(function (){
/* flot toggle example */
var flot_toggle = function (){
var data = [{
label: "Dépar effectuer",
data: dataTargetProfit,
color: color.info._400,
bars: {
show: true,
align: "center",
barWidth: 30 * 30 * 60 * 1000 * 80,
lineWidth: 0,
/*fillColor: {
colors: [color.primary._500, color.primary._900]
},*/
fillColor: {
colors: [{
opacity: 0.9
}, {
opacity: 0.1
}]
}
},
highlightColor: 'rgba(255,255,255,0.3)',
shadowSize: 0
}]
var options = {
grid: {
hoverable: true,
clickable: true,
tickColor: 'rgba(0,0,0,0.05)',
borderWidth: 1,
borderColor: 'rgba(0,0,0,0.05)'
},
tooltip: true,
tooltipOpts: {
cssClass: 'tooltip-inner',
defaultTheme: false
},
xaxis: {
mode: "time",
tickColor: 'rgba(0,0,0,0.05)',
},
yaxes: {
tickColor: 'rgba(0,0,0,0.05)',
tickFormatter: function (val, axis) {
return "$" + val;
},
max: 1200
}
};
var plot2 = null;
function plotNow(){
var d = [];
$("#js-checkbox-toggles").find(':checkbox').each(function (){
if ($(this).is(':checked')) {
d.push(data[$(this).attr("name").substr(4, 1)]);
}
});
if (d.length > 0) {
if (plot2) {
plot2.setData(d);
plot2.draw();
} else {
plot2 = $.plot($("#flot-toggles"), d, options);
}
}
};
$("#js-checkbox-toggles").find(':checkbox').on('change', function (){
plotNow();
});
plotNow()
}
flot_toggle();
});
</script>
}