protected void PopulateRotator() { // Get values and populate.. ArrayList rotatorImages = new ArrayList(); String user_territory = Util.GetUserTerritory(); // Iterate offices RadChart rc = GenerateGroupVersusChart(); Bitmap img = new Bitmap(rc.GetBitmap()); img.Save(Util.path + "ZedGraphImages\\groupVersus.png", System.Drawing.Imaging.ImageFormat.Png); rotatorImages.Add("groupVersus.png"); for (int i = 0; i < offices.Rows.Count; i++) { String territory = (String)offices.Rows[i]["office"]; rc = GenerateVersusChart(territory); if (rc != null) { img = new Bitmap(rc.GetBitmap()); img.Save(Util.path + "ZedGraphImages\\" + Util.SanitiseStringForFilename(territory) + "Versus.png", System.Drawing.Imaging.ImageFormat.Png); rotatorImages.Add(territory + "Versus.png"); } } rr_versus.DataSource = rotatorImages; rr_versus.DataBind(); }
protected override Image DoCreateChartImage() { var radChart = new RadChart {Width = Parameters.ChartWidth, Height = Parameters.ChartHeight}; var tmpSeries = new ChartSeries() { Type = ChartSeriesType.Line }; foreach (var point in Parameters.SeriaData) tmpSeries.Items.Add(new ChartSeriesItem(point.Key, point.Value)); radChart.AddChartSeries(tmpSeries); return radChart.GetBitmap(); }
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) { GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn; if (column != null && column.OwnerTemplate.Caption == "Details") { if (column.FieldName == "FirstName") { e.CellElement.Text = "<html><b>Name:</b> " + e.CellElement.RowInfo.Cells["LastName"].Value + ", " + e.CellElement.RowInfo.Cells["FirstName"].Value; } if (column.FieldName == "BirthDate") { e.CellElement.Text = string.Format("<html><b>Birth Date:</b> {0:d}", e.CellElement.RowInfo.Cells["BirthDate"].Value); } if (column.FieldName == "Title") { e.CellElement.Text = "<html><b>Title:</b> " + e.CellElement.RowInfo.Cells["Title"].Value; } if (column.FieldName == "Address") { e.CellElement.Text = "<html><b>Address:</b> " + e.CellElement.RowInfo.Cells["Address"].Value; } if (e.CellElement is GridImageCellElement) { ((GridImageCellElement)e.CellElement).ImageLayout = ImageLayout.Zoom; } } if (column != null && column.OwnerTemplate.Caption == "Performance") { if (e.CellElement.RowInfo.Tag == null) { chart.Series.Clear(); chart.Series.Add(GetRowData((GridViewRowInfo)e.CellElement.RowInfo)); e.CellElement.RowInfo.Tag = chart.GetBitmap(); } e.CellElement.Image = e.CellElement.RowInfo.Tag as Image; e.CellElement.DrawBorder = false; e.CellElement.DrawFill = false; e.CellElement.Text = ""; e.CellElement.Padding = new Padding(10, 0, 0, 0); } }