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

Pie Chart Issues

8 Answers 264 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 19 Sep 2010, 01:37 PM
Hi,

I'm trying to build a pie chart, but really have no idea how this is accomplished.  I've look at the tutorials and really don't give me enough information.

I created a SQL Source for percentages:
1. Budget Spent
2. Remaining Budget

I just want to plot the pie chart to show this distribution, for example budget spent 25% remaining budget 75%.   This is fairly straightforward.  I've used Crystal and Infragistics and it wasn't very hard to do.  Can someone assist with this please.

Thank You,

8 Answers, 1 is accepted

Sort by
0
David Silveria
Top achievements
Rank 1
answered on 20 Sep 2010, 01:42 PM
From your explanation I get that you have two columns in your database with the spent and remaining budget numbers. In a Pie Chart each column is represented by a separate pie i.e. effectively each serie is a separate pie. This is due to the fact that a pie chart is used to display the contribution of fractional parts to a whole and usually the whole is contained within a single column. So in this line of thoughts your data is not structured conveniently for your task and you would have to manually (with code) get the first row of each column to create the desired chart, as this scenario cannot be handled out of the box.

Cheers!
0
Dan
Top achievements
Rank 1
answered on 21 Mar 2011, 04:43 PM
Hello.  I also need help with this as the documentation and examples do an inadequate job of explaining it.

Lets pretend Joe had worded his question a little differently.  He has a table like this:

Title               Budget
-------           ----------
Spent             300.00
Remaining         100.00


Now he wants to generate a pie chart in the designer.  If he already has a SQL datasource (conveniently called "sqlDatasource1") and a Chart object on the designer (called "chart1") how does he generate the pie chart using the data.

(Note: The reason this is so confusing is that the documentation inexplicably hardcodes labels and values (http://www.telerik.com/help/reporting/gettingstartedstaticpopulatechartdata.html).  I can't imagine how this is useful.)
0
Yavor
Telerik team
answered on 24 Mar 2011, 08:37 AM
Hi Dan,

In this case, you can directly preset the datasource, to get data from the table in question. Let us assume that we have a table called "Products", which is part of the Nwind database. We can select a single column from the table, which would thus represent your layout. In the example below, the chart is bound to an AccessDataSource, but the same approach is valid for an sql connection as well:

<telerik:RadChart ID="RadChart2" runat="server" Skin="LightGreen" Width="450" Height="300" DataSourceID="AccessDataSource1" DefaultType="Pie">
</telerik:RadChart>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/Nwind.mdb"
SelectCommand="SELECT TOP 4 [UnitsInStock] FROM [Products]">
</asp:AccessDataSource>

I hope this gets you started properly.

All the best,
Yavor
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Dan
Top achievements
Rank 1
answered on 24 Mar 2011, 02:04 PM
Thanks for the response.

No, it doesn't help at all.  I specifically bolded the words "in the designer" in an attempt to get an explanation of how to use the tools in the report designer to achieve what should be an extremely simple graph.

Fortunately, I've since figured out how to do it myself.  I wasted many hours on something that only took 3 properties values to resolve. Your answer should have been like this:

1) In the Datasource property of chart1 control select sqlDatasource1 (both mentioned in my example).  Be sure you do not use the datasource in the report's Datasource... just the chart1.

2) Open chart1's Series collection property and add a new series.

3) In the new series, the DataYColumn needs the column "Budget".

4) Also in the new series, the DataLabelsColumn should have the column "Title".

The above steps will produce the desired pie chart.

0
Michael
Top achievements
Rank 1
answered on 25 Oct 2011, 05:32 PM
Dan,

Thank you - your response has helped me greatly.  I too was struggling with getting just a very simple pie chart to display and your explanation was just what I needed.  I agree that there is a complete lack of usable documentation on charting functionality.  The charting options are clearly very varied and highly complex, so some basic documentation that would get us started on how to use it would be really useful. 

Mike
0
Todd
Top achievements
Rank 1
answered on 06 Dec 2011, 10:16 PM
This does not work for me at all using the designer. I just get one series. I have a pie I need by Question and  a numeric answer.
THe questions are the legend and the answers the pie!  I do not get the 8 questions in the legend.....
Very frustrating.
0
Steve
Telerik team
answered on 07 Dec 2011, 02:24 PM
Hello Todd,

A pie chart uses a single series of data and multiple series can be displayed in separate pie charts. You can review the Dashboard demo report that has several pie charts using the steps described by Dan and work as expected.

Regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Michael
Top achievements
Rank 1
answered on 30 Apr 2015, 11:12 AM

Dan,

 Bingo!!!

Thank you very much for posting your solution!

Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
David Silveria
Top achievements
Rank 1
Dan
Top achievements
Rank 1
Yavor
Telerik team
Michael
Top achievements
Rank 1
Todd
Top achievements
Rank 1
Steve
Telerik team
Michael
Top achievements
Rank 1
Share this question
or