09/11/2007, 07:34
|
| | Fecha de Ingreso: noviembre-2004 Ubicación: Asuncion - Paraguay
Mensajes: 155
Antigüedad: 20 años, 1 mes Puntos: 0 | |
Re: Grafico de Lineas Asp.Net Por fin me salio aca esta.
Código:
ChartSpaceClass chtModel = new ChartSpaceClass();
ChChart chart = chtModel.Charts.Add(0);
chart.Type = ChartChartTypeEnum.chChartTypeLine;
chart.Axes[ChartAxisPositionEnum.chAxisPositionCategory].GroupingType = ChartAxisGroupingEnum.chAxisGroupingNone;
//Compra
ChSeries serie = chart.SeriesCollection.Add(0);
serie.Marker.Style = ChartMarkerStyleEnum.chMarkerStyleNone;
//serie.Line.DashStyle = ChartLineDashStyleEnum.chLineSquareDot;
serie.Caption = "Compra";
serie.SetData(ChartDimensionsEnum.chDimCategories, Convert.ToInt32(ChartSpecialDataSourcesEnum.chDataLiteral),
string.Join("\t", xValues));
serie.SetData(ChartDimensionsEnum.chDimValues, Convert.ToInt32(ChartSpecialDataSourcesEnum.chDataLiteral),
string.Join("\t", y1Values));
//Venta
serie = chart.SeriesCollection.Add(1);
serie.Marker.Style = ChartMarkerStyleEnum.chMarkerStyleNone;
serie.Caption = "Venta";
serie.SetData(ChartDimensionsEnum.chDimCategories, Convert.ToInt32(ChartSpecialDataSourcesEnum.chDataLiteral),
string.Join("\t", xValues));
serie.SetData(ChartDimensionsEnum.chDimValues, Convert.ToInt32(ChartSpecialDataSourcesEnum.chDataLiteral),
string.Join("\t", y2Values));
chart.HasTitle = true;
chart.Title.Caption = "Cotizacion de Moneda Periodo: " + fechaDesde.ToString("dd/MM/yyyy") + " al " + fechaHasta.ToString("dd/MM/yyyy");
chart.HasLegend = true;
chart.Legend.Position = ChartLegendPositionEnum.chLegendPositionBottom;
chart.HasAutoAspectRatio = true;
chart.HasAutoChartDepth = true;
chart.Border.Color = "#FFFBF0";
chart.PlotArea.Interior.Color = "#FFFBF0";
chart.SeriesCollection[0].DataLabelsCollection.Add();
chart.SeriesCollection[0].DataLabelsCollection[0].HasValue = false;
chart.SeriesCollection[0].DataLabelsCollection[0].NumberFormat = "#,###";
chart.SeriesCollection[0].DataLabelsCollection[0].Font.Color = "Blue";
chart.SeriesCollection[0].DataLabelsCollection[0].Font.Size = 7;
chart.SeriesCollection[1].DataLabelsCollection.Add();
chart.SeriesCollection[1].DataLabelsCollection[0].HasValue = false;
chart.SeriesCollection[1].DataLabelsCollection[0].NumberFormat = "#,###";
chart.SeriesCollection[1].DataLabelsCollection[0].Font.Color = "Red";
chart.SeriesCollection[1].DataLabelsCollection[0].Font.Size = 7;
chtModel.Charts[0].Axes[1].NumberFormat = "##,###";
|