Creating a chart/graph in report

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

    Posted 08 Mar Link to this post

    Hi,

     

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

    http://docs.telerik.com/reporting/buildingprogrammaticcreate

    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.

    Regards,

    Deepak

     

     

  2. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 10 Mar 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.

    Regards,
    Stef
    Telerik
    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
  3. DevCraft banner
Back to Top