How to make a 3d horizontal Bar Chart

3 posts, 0 answers
  1. Kelly Hamilton
    Kelly Hamilton avatar
    9 posts
    Member since:
    Nov 2009

    Posted 25 Feb 2011 Link to this post

     

    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. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 02 Mar 2011 Link to this post

    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!
  3. UI for WPF is Visual Studio 2017 Ready
  4. James
    James avatar
    5 posts
    Member since:
    May 2012

    Posted 08 May 2012 Link to this post

Back to Top