예제 #1
0
 private void SetGraphConfiguration(FusionChartsMultiSeriesHelper helper)
 {
     helper.AddConfigEntry("caption", string.Format(String.Format("Vehículo - {0} , Desde: {1} {2} , Hasta: {3} {4}", ddlMovil.SelectedItem.Text,
                                                                  dtpDesde.SelectedDate.Value.ToShortDateString(), dtpDesde.SelectedDate.Value.ToShortTimeString(),
                                                                  dtpHasta.SelectedDate.Value.ToShortDateString(), dtpHasta.SelectedDate.Value.ToShortTimeString())));
     helper.AddConfigEntry("xAxisName", XAxisLabel);
     helper.AddConfigEntry("yAxisName", YAxisLabel);
     helper.AddConfigEntry("decimalPrecision", "2");
     helper.AddConfigEntry("numberSuffix", "hs");
     helper.AddConfigEntry("limitsDecimalPrecision", "2");
     helper.AddConfigEntry("hoverCapSepChar", "-");
     helper.AddConfigEntry("showNames", "1");
     helper.AddConfigEntry("showValues", "0");
     helper.AddConfigEntry("rotateNames", "1");
 }
예제 #2
0
        private void SetGraphProperties(FusionChartsMultiSeriesHelper helper)
        {
            helper.AddConfigEntry("caption", string.Format("Utilización del Vehículo {2}: {0} Hasta: {1}",
                                                           dpDesde.SelectedDate.Value.ToShortDateString(), dpHasta.SelectedDate.Value.ToShortDateString(), ddlMovil.SelectedItem.Text));

            helper.AddConfigEntry("xAxisName", XAxisLabel);
            helper.AddConfigEntry("yAxisName", YAxisLabel);
            helper.AddConfigEntry("decimalPrecision", "2");
            helper.AddConfigEntry("thousandSeparator", ",");
            helper.AddConfigEntry("formatNumberScale", "0");
            helper.AddConfigEntry("numberSuffix", "hs");
            helper.AddConfigEntry("showValues", "0");
            helper.AddConfigEntry("showNames", "1");
            helper.AddConfigEntry("rotateNames", "1");
        }
예제 #3
0
 /// <summary>
 /// Sets the graph configuration
 /// </summary>
 /// <param name="helper"></param>
 private void SetGraphProperties(FusionChartsMultiSeriesHelper helper)
 {
     helper.AddConfigEntry("caption", string.Format("Tanque: {0} - Desde: {1} - {2}  Hasta: {3} - {4}",
                                                    ddlTanque.Selected != 0 ? DAOFactory.TanqueDAO.FindById(ddlTanque.Selected).Descripcion : "",
                                                    dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString(), dpDesde.SelectedDate.GetValueOrDefault().ToShortTimeString(),
                                                    dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString(), dpHasta.SelectedDate.GetValueOrDefault().ToShortTimeString()));
     helper.AddConfigEntry("xAxisName", XAxisLabel);
     helper.AddConfigEntry("yAxisName", YAxisLabel);
     helper.AddConfigEntry("decimalPrecision", "0");
     helper.AddConfigEntry("thousandSeparator", ".");
     helper.AddConfigEntry("formatNumberScale", "0");
     helper.AddConfigEntry("numberSuffix", "lt");
     helper.AddConfigEntry("showValues", "0");
     helper.AddConfigEntry("showNames", "1");
     helper.AddConfigEntry("rotateNames", "1");
 }
예제 #4
0
        /// <summary>
        /// Sets the graph configuration
        /// </summary>
        /// <param name="helper"></param>
        private void SetGraphProperties(FusionChartsMultiSeriesHelper helper)
        {
            helper.AddConfigEntry("caption", string.Format("Volumen Consumido Desde: {0} - {1}  Hasta: {2} - {3}",
                                                           dpDesde.SelectedDate.GetValueOrDefault().ToShortDateString(), dpDesde.SelectedDate.GetValueOrDefault().ToShortTimeString(),
                                                           dpHasta.SelectedDate.GetValueOrDefault().ToShortDateString(), dpHasta.SelectedDate.GetValueOrDefault().ToShortTimeString()));

            helper.AddConfigEntry("xAxisName", XAxisLabel);
            helper.AddConfigEntry("yAxisName", YAxisLabel);
            helper.AddConfigEntry("decimalPrecision", "0");
            helper.AddConfigEntry("thousandSeparator", ".");
            helper.AddConfigEntry("formatNumberScale", "0");
            helper.AddConfigEntry("numberSuffix", "lt");
            helper.AddConfigEntry("showValues", "0");
            helper.AddConfigEntry("showNames", "1");
            helper.AddConfigEntry("rotateNames", "1");
        }
예제 #5
0
        private void SetGraphConfiguration(FusionChartsMultiSeriesHelper helper)
        {
            var hasta = dtpDate.SelectedDate.GetValueOrDefault().AddHours(23).AddMinutes(59).AddSeconds(59);

            helper.AddConfigEntry("caption", string.Format("{0}: {1}, Desde: {2} {3}, Hasta: {4} {5}", CultureManager.GetEntity("PARENTI02"), GetSelectedBasesDescription(),
                                                           dtpDate.SelectedDate.GetValueOrDefault().ToShortDateString(),
                                                           dtpDate.SelectedDate.GetValueOrDefault().ToShortTimeString(),
                                                           hasta.ToShortDateString(), hasta.ToShortTimeString()));
            helper.AddConfigEntry("xAxisName", XAxisLabel);
            helper.AddConfigEntry("yAxisName", YAxisLabel);
            helper.AddConfigEntry("decimalPrecision", "0");
            helper.AddConfigEntry("numberSuffix", " vehiculos");
            helper.AddConfigEntry("limitsDecimalPrecision", "0");
            helper.AddConfigEntry("hoverCapSepChar", "-");
            helper.AddConfigEntry("showNames", "1");
            helper.AddConfigEntry("showValues", "0");
            helper.AddConfigEntry("rotateNames", "1");
        }
예제 #6
0
        private static string GetGraphXml(IEnumerable <ResumenDeEntregasVo> entregas)
        {
            using (var helper = new FusionChartsMultiSeriesHelper())
            {
                helper.AddConfigEntry("xAxisName", CultureManager.GetLabel("INTERNO"));
                helper.AddConfigEntry("yAxisName", CultureManager.GetLabel("CANTIDAD"));
                helper.AddConfigEntry("decimalPrecision", "0");
                helper.AddConfigEntry("showValues", "0");
                helper.AddConfigEntry("showNames", "1");
                helper.AddConfigEntry("hoverCapSepChar", " - ");

                var completados = new FusionChartsDataset();
                completados.SetPropertyValue("color", "#008000");
                completados.SetPropertyValue("seriesName", CultureManager.GetLabel("COMPLETADOS"));
                var visitados = new FusionChartsDataset();
                visitados.SetPropertyValue("color", "#FFFF00");
                visitados.SetPropertyValue("seriesName", CultureManager.GetLabel("VISITADOS"));
                var enSitio = new FusionChartsDataset();
                enSitio.SetPropertyValue("color", "#00A2E8");
                enSitio.SetPropertyValue("seriesName", CultureManager.GetLabel("EN_SITIO"));
                var enZona = new FusionChartsDataset();
                enZona.SetPropertyValue("color", "#808080");
                enZona.SetPropertyValue("seriesName", CultureManager.GetLabel("EN_ZONA"));
                var noCompletados = new FusionChartsDataset();
                noCompletados.SetPropertyValue("color", "#FF0000");
                noCompletados.SetPropertyValue("seriesName", CultureManager.GetLabel("NO_COMPLETADOS"));
                var noVisitados = new FusionChartsDataset();
                noVisitados.SetPropertyValue("color", "#FF4500");
                noVisitados.SetPropertyValue("seriesName", CultureManager.GetLabel("NO_VISITADOS"));

                foreach (var entrega in entregas)
                {
                    helper.AddCategory(entrega.Vehiculo.Replace('&', 'y'));
                    completados.addValue(entrega.Completados.ToString("#0"));
                    visitados.addValue(entrega.Visitados.ToString("#0"));
                    enSitio.addValue(entrega.EnSitio.ToString("#0"));
                    enZona.addValue(entrega.EnZona.ToString("#0"));
                    noCompletados.addValue(entrega.NoCompletados.ToString("#0"));
                    noVisitados.addValue(entrega.NoVisitados.ToString("#0"));
                }

                helper.AddDataSet(completados);
                helper.AddDataSet(visitados);
                helper.AddDataSet(enSitio);
                helper.AddDataSet(enZona);
                helper.AddDataSet(noCompletados);
                helper.AddDataSet(noVisitados);

                return(helper.BuildXml());
            }
        }
예제 #7
0
        protected void CreateGraphic(List <Pedido> list)
        {
            try
            {
                using (var helper = new FusionChartsMultiSeriesHelper())
                {
                    var carga = GetCarga(null);
                    var bocas = cbBocaDeCarga.Selected > 0
                        ? new List <BocaDeCarga> {
                        DAOFactory.BocaDeCargaDAO.FindById(cbBocaDeCarga.Selected)
                    }
                        : DAOFactory.BocaDeCargaDAO.GetList(new[] { cbEmpresa.Selected }, new[] { cbLinea.Selected });

                    var inicio      = bocas.Min(boca => GetInicioActividad(boca));
                    var fin         = bocas.Max(boca => GetFinActividad(boca));
                    var rendimiento = bocas.Sum(boca => boca.Rendimiento);

                    var    tiempoPromedio = Convert.ToInt32(_tiempoCiclos.Sum() / CantidadTotal);
                    var    prev           = 0;
                    double maxValue       = rendimiento;
                    var    maxMixers      = CantidadMixers;

                    #region DataSet Rendimiento (Trendline)
                    var dataSetTrendLineRendimiento = new FusionChartsDataset();
                    dataSetTrendLineRendimiento.SetPropertyValue("seriesName", CultureManager.GetLabel("RENDIMIENTO"));
                    dataSetTrendLineRendimiento.SetPropertyValue("color", "c30000");
                    dataSetTrendLineRendimiento.SetPropertyValue("parentYAxis", "S");
                    dataSetTrendLineRendimiento.SetPropertyValue("showAnchors", "0");
                    dataSetTrendLineRendimiento.SetPropertyValue("alpha", "60");
                    dataSetTrendLineRendimiento.SetPropertyValue("lineThickness", "2");
                    helper.AddDataSet(dataSetTrendLineRendimiento);
                    #endregion

                    #region DataSet Volumen por Hora (Barras)
                    var dataSetVolumen = new FusionChartsDataset();
                    dataSetVolumen.SetPropertyValue("seriesName", CultureManager.GetLabel("PROGRAMACION_VOLUMEN_HORA"));
                    dataSetVolumen.SetPropertyValue("color", "6868c3");
                    dataSetVolumen.SetPropertyValue("parentYAxis", "P");
                    helper.AddDataSet(dataSetVolumen);
                    #endregion

                    #region DataSet Mixers Disponibles (Trendline)
                    var dataSetTrendLineMixers = new FusionChartsDataset();
                    dataSetTrendLineMixers.SetPropertyValue("seriesName", CultureManager.GetLabel("AVAILABLE_VEHICLES"));
                    dataSetTrendLineMixers.SetPropertyValue("color", "c39600");
                    dataSetTrendLineMixers.SetPropertyValue("parentYAxis", "S");
                    dataSetTrendLineMixers.SetPropertyValue("showAnchors", "0");
                    dataSetTrendLineMixers.SetPropertyValue("alpha", "60");
                    dataSetTrendLineMixers.SetPropertyValue("lineThickness", "2");
                    helper.AddDataSet(dataSetTrendLineMixers);
                    #endregion

                    #region DataSet Mixers Equivalentes (Linea)
                    var dataSetMixers = new FusionChartsDataset();
                    dataSetMixers.SetPropertyValue("seriesName", CultureManager.GetLabel("PROGRAMACION_MIXERS_EQUIVALENTES"));
                    dataSetMixers.SetPropertyValue("color", "009900");
                    dataSetMixers.SetPropertyValue("parentYAxis", "S");
                    dataSetMixers.SetPropertyValue("anchorSides", "10");
                    dataSetMixers.SetPropertyValue("anchorRadius", "3");
                    dataSetMixers.SetPropertyValue("anchorBorderColor", "009900");
                    helper.AddDataSet(dataSetMixers);
                    #endregion

                    #region Llenado de Categorias y Valores
                    for (var i = inicio; i <= fin; i = i.Add(TimeSpan.FromHours(1)))
                    {
                        var hora = Convert.ToInt32(i.Hours);
                        var val  = _volumenPorHora.ContainsKey(hora) ? _volumenPorHora[hora] : 0;
                        var mix  = (int)Math.Ceiling(1.0 * val / carga);
                        var equi = (int)Math.Round((prev + mix) * tiempoPromedio / TiempoReferencia);


                        helper.AddCategory(FormatTimeSpan(i));
                        dataSetVolumen.addValue(val.ToString().Replace(',', '.'));
                        dataSetMixers.addValue(equi.ToString());

                        if (val > maxValue)
                        {
                            maxValue = val;
                        }
                        if (equi > maxMixers)
                        {
                            maxMixers = equi;
                        }

                        prev = mix;
                    }
                    #endregion

                    #region Calculo proporcional de maximos y trendlines
                    maxMixers++;
                    maxValue++;
                    int divlines;
                    if (maxValue > maxMixers)
                    {
                        while (Math.Round(maxValue) % maxMixers != 0)
                        {
                            maxValue++;
                        }
                        divlines = Convert.ToInt32(maxValue / maxMixers);
                    }
                    else
                    {
                        while (maxMixers % Math.Round(maxValue) != 0)
                        {
                            maxMixers++;
                        }
                        divlines = Convert.ToInt32(maxMixers / maxValue);
                    }

                    var rend = rendimiento * maxMixers * 1.0 / maxValue;

                    for (var i = inicio; i <= fin; i = i.Add(TimeSpan.FromHours(1)))
                    {
                        dataSetTrendLineRendimiento.addValue(rend.ToString(CultureInfo.InvariantCulture));
                        dataSetTrendLineMixers.addValue(CantidadMixers.ToString());
                    }
                    #endregion

                    #region Valores de Cabecera
                    helper.AddConfigEntry("caption", "");
                    helper.AddConfigEntry("xAxisName", CultureManager.GetLabel("HORA"));
                    helper.AddConfigEntry("PyAxisName", CultureManager.GetLabel("VOLUMEN"));
                    helper.AddConfigEntry("SyAxisName", CultureManager.GetLabel("VEHICULOS"));
                    helper.AddConfigEntry("decimalPrecision", "0");
                    helper.AddConfigEntry("showValues", "0");
                    helper.AddConfigEntry("numberSuffix", "");
                    helper.AddConfigEntry("rotateNames", "1");
                    helper.AddConfigEntry("limitsDecimalPrecision", "0");
                    helper.AddConfigEntry("hoverCapSepChar", "-");
                    helper.AddConfigEntry("divLineAlpha", "60");
                    helper.AddConfigEntry("showAlternateHGridColor", "1");
                    helper.AddConfigEntry("alternateHGridColor", "d8d8d8");
                    helper.AddConfigEntry("alternateHGridAlpha", "60");
                    helper.AddConfigEntry("zeroPlaneThickness", "20");

                    helper.AddConfigEntry("numDivLines", (divlines - 1).ToString());
                    helper.AddConfigEntry("SyAxisMaxValue", maxMixers.ToString());
                    helper.AddConfigEntry("PyAxisMaxValue", Math.Round(maxValue).ToString());
                    #endregion


                    litGraph.Text = FusionCharts.RenderChartHTML("../FusionCharts/FCF_MSColumn2DLineDY.swf", "", helper.BuildXml(), "Report", (sizeField.Width).ToString(), (sizeField.Heigth).ToString(), false);
                }
            }
            catch (Exception ex) { ShowError(ex); }
        }