This is a migrated thread and some comments may be shown as answers.

How to make a 3d horizontal Bar Chart

2 Answers 42 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kelly Hamilton
Top achievements
Rank 1
Kelly Hamilton asked on 25 Feb 2011, 09:21 PM

 

I can't find how to make a 3D horizontal bar chart. Is there a series definition to do this? Or does anyone have instructions on how to make a Custom 3D model that can do this?

I'm using the document at

http://www.telerik.com/help/wpf/radchart-getting-started-create-data-bound-chart.html

to build a test application. I'm also using the code behind, so a piece of my code is:

{
[...]
 SeriesMapping seriesMapping = new SeriesMapping();
 seriesMapping.LegendLabel = "Product Sales";
 Bar3DSeriesDefinition def = new Bar3DSeriesDefinition();
 seriesMapping.SeriesDefinition = new Bar3DSeriesDefinition();//new HorizontalBarSeriesDefinition();//new SplineSeriesDefinition();
 seriesMapping.ItemMappings.Add(new ItemMapping("Month", DataPointMember.XValue));
 seriesMapping.ItemMappings.Add(new ItemMapping("Quantity", DataPointMember.YValue));
 seriesMapping.ItemMappings.Add(new ItemMapping("MonthName", DataPointMember.XCategory));
 radChart1.SeriesMappings.Add(seriesMapping);
 radChart1.ItemsSource = this.CreateData();
}

 
public class ProductSales
{
 public ProductSales(int quantity, int month, string monthName)
 {
  this.Quantity = quantity;
  this.Month = month;
  this.MonthName = monthName;
 }
 public int Quantity
 {
  get;
  set;
 }
 public int Month
 {
  get;
  set;
 }
 public string MonthName
 {
  get;
  set;
 }
}

private List<ProductSales> CreateData()
{
 List<ProductSales> persons = new List<ProductSales>();
 persons.Add(new ProductSales(154, 1, "January"));
 persons.Add(new ProductSales(138, 2, "February"));
 persons.Add(new ProductSales(143, 3, "March"));
 persons.Add(new ProductSales(120, 4, "April"));
 persons.Add(new ProductSales(135, 5, "May"));
 persons.Add(new ProductSales(125, 6, "June"));
 persons.Add(new ProductSales(179, 7, "July"));
 persons.Add(new ProductSales(170, 8, "August"));
 persons.Add(new ProductSales(198, 9, "September"));
 persons.Add(new ProductSales(187, 10, "October"));
 persons.Add(new ProductSales(193, 11, "November"));
 persons.Add(new ProductSales(212, 12, "December"));
 return persons;
}

thanks in advance

 

2 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 02 Mar 2011, 03:05 PM
Hello Kelly Hamilton,

Unfortunately RadChart does not support such kind of customization and it would not be possible to achieve the desired effect. Generally it is possible to customize the 3D model for vertical bars as explained here but unfortunately this approach is inapplicable in your scenario as there is no built-in horizontal 3D series type that can be used as a basis for the modifications.

If your scenario requires horizontal bars, we would suggest you to consider the 2D series type instead.


All the best,
Giuseppe
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
James
Top achievements
Rank 1
answered on 08 May 2012, 05:52 PM
Tags
Chart
Asked by
Kelly Hamilton
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
James
Top achievements
Rank 1
Share this question
or