E172 Rep Indicador gráfica barras ventas x productos top 10 y resto

This commit is contained in:
MLopez
2022-12-08 19:44:40 -07:00
parent 093320ebdb
commit 2c66e906e0
2 changed files with 54 additions and 13 deletions

View File

@@ -80,8 +80,9 @@
<ajax:MaskedEditExtender ID="MEEFechaF" runat="server" TargetControlID="TxtFechaF" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
<ajax:CalendarExtender runat="server" ID="CalendarExtender1" TargetControlID="TxtFechaF" PopupButtonID="ImgFechaF" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div>
<div class="col-md-1 truncate" style="text-align: right!important; margin-left: 20px">SubProyecto</div>
<div class="col-md-1 truncate" style="text-align: right!important; margin-left: 20px">
<asp:Label runat="server" ID="lblSubProyecto">SubProyecto:</asp:Label>
</div>
<div class="col-md-1">
<asp:DropDownList ID="DdlSubProyecto" CssClass="form-control input-sm select2me" runat="server" Width="150px" DataTextField="SubProyecto" DataValueField="CveSubProyecto">
</asp:DropDownList>
@@ -434,7 +435,7 @@
// AmCharts.makeChart(chartdiv, chartconfig);
// });
AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, dataProvider: json["VxP"] }); // Ventas x Producto
//AmCharts.makeChart("chartdiv_vxp", { ...chartconfig, type: "serial", dataProvider: json["VxP"] }); // Ventas x Producto
AmCharts.makeChart("chartdiv_cxp", { ...chartconfig, dataProvider: json["CxP"] }); // Compras x Producto TipoProveedor 1
AmCharts.makeChart("chartdiv_cxp192", { ...chartconfig, dataProvider: json["CxP192"] }); // Compras x Producto ProveedorClasificacion 192
AmCharts.makeChart("chartdiv_ccxc", { ...chartconfig, dataProvider: json["CCxC"] }); // Cuentas por Cobrar x Cliente
@@ -443,13 +444,14 @@
document.getElementById('amChartsAttribution').style.visibility = 'visible';
}
/*
function CargaGraficasBarras(json) {
var chart = AmCharts.makeChart("chartdiv2", {
var chart = AmCharts.makeChart("chartdiv_vxp", {
"hideCredits": true,
"type": "serial",
"theme": "light",
"dataProvider": json,
"dataProvider": json["VxP"],
"startDuration": 2,
"valueAxes": [{
"position": "left",
@@ -472,14 +474,41 @@
},
"categoryField": "Texto",
"categoryAxis": {
"gridPosition": "start",
"labelRotation": 90
"labelsEnabled": false,
"forceShowField": false,
//"labelFunction": trimLabel
//"gridPosition": "start"
//"labelRotation": 90
},
"export": {
"enabled": true
}
});
}*/
var legend = new AmCharts.AmLegend();
legend.fontSize = 9;
legend.labelWidth = 50;
legend.enabled = false;
chart.addLegend(legend);
chart.addListener('dataUpdated', function (e) {
var legendDataItems; //used to store the legend's custom data array.
legendDataItems = e.chart.dataProvider.map(function (dataElement) {
return {
'title': dataElement.Texto.length >= 7 ? dataElement.Texto.substr(0, 6) : dataElement.Texto,
'color': dataElement.Color
}
});
// update the legend custom data and redraw the chart
e.chart.legend.data = legendDataItems;
e.chart.legend.enabled = true;
e.chart.validateNow();
});
}
</script>
</asp:Content>