Creating a chart/graph in report

2 posts, 0 answers
  1. deepak
    deepak avatar
    3 posts
    Member since:
    Nov 2015

    Posted 08 Mar 2016 Link to this post



    I am trying to create a chart/graph inside a report control. I have following the below link to create the chart.

    ChartSeries chartSeries = new ChartSeries();

    chartSeries.Name = "Sales";

    chartSeries.Type = ChartSeriesType.Bar;

    chartSeries.AddItem(120, "Internet");

    chartSeries.AddItem(140, "Retail");

    chartSeries.AddItem(35, "Wholesale");

    When i used this code the chart is created, but in x axis it is showing as "1",  "2", "3", but i want it to be "Internet" "retail" and "wholesale" (the series name).

    Please set me know how to set the label for the series.





  2. Stef
    Stef avatar
    3611 posts

    Posted 10 Mar 2016 Link to this post

    Hello Deepak,

    The illustrated code snippet will create a Chart item, that is obsolete as of Q2 2013.

    My recommendation is to use the VS Report Designer and create a chart by starting the Graph wizard. It will add a Graph item and you can configure the data source, and how data will be visualized. At the end, you can get and modify the code generated in the report's designer.cs(vb) file.

    Tutorials how to create charts of different types are available in the Chart Types section.

    I hope this information is helpful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top