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

Creating a chart/graph in report

1 Answer 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
deepak
Top achievements
Rank 1
deepak asked on 08 Mar 2016, 03:36 PM

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

 

 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 10 Mar 2016, 05:26 PM
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
Tags
General Discussions
Asked by
deepak
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or