Pie Chart Issues

9 posts, 0 answers
  1. Joe
    Joe avatar
    48 posts
    Member since:
    Mar 2009

    Posted 19 Sep 2010 Link to this post

    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,
  2. David Silveria
    David Silveria avatar
    234 posts
    Member since:
    May 2006

    Posted 20 Sep 2010 Link to this post

    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!
  3. Dan
    Dan avatar
    4 posts
    Member since:
    Jan 2011

    Posted 21 Mar 2011 Link to this post

    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.)
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 24 Mar 2011 Link to this post

    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
  5. Dan
    Dan avatar
    4 posts
    Member since:
    Jan 2011

    Posted 24 Mar 2011 Link to this post

    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.

  6. Michael
    Michael avatar
    20 posts
    Member since:
    Jul 2010

    Posted 25 Oct 2011 Link to this post

    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
  7. Todd
    Todd avatar
    1 posts
    Member since:
    Apr 2011

    Posted 06 Dec 2011 Link to this post

    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.
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 07 Dec 2011 Link to this post

    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!

  9. Michael
    Michael avatar
    1 posts
    Member since:
    Dec 2014

    Posted 30 Apr 2015 in reply to Dan Link to this post

    Dan,

     Bingo!!!

    Thank you very much for posting your solution!

Back to Top