How to create a Pie chart at the runtime and show legendLables as well

Thread is closed for posting
2 posts, 0 answers
  1. Deepak
    Deepak avatar
    15 posts
    Member since:
    Jun 2010

    Posted 21 Jul 2010 Link to this post

    my client gave me the screen shot to make a pie chart like it shows in image13.jpg (image on right hand side).
    Just want to clarify that 1,2,3 shown in the chart actually will replace "No status, Evication".

    here is the sample data
         No Status:        10
         Eviction:        20
        Ready to Repair:        30
        Repairs:        40
        Ready to List:        50
        Listed:            60
        Listed-Back On The Market:        70
        Offers In:        80
        Pending Sale:        90
        Closing Documents In:        100
        Closed:        50
        Removed From Market:        33
        Litigation:        44
        TS Sale Rescission:        33


    This is the code which I have written.
       Private Sub BuildChart()
            Dim radChart = New RadChart()
            radChart.ChartTitle.TextBlock.Text = "Active Property by status"
            radChart.Series.Add(BuildChartSeries())
            ChartDiv.Controls.Add(radChart)
        End Sub

        Private Function BuildChartSeries() As ChartSeries
            Dim chartSeries = New ChartSeries()
            Dim result As DataTable

            chartSeries.Type = ChartSeriesType.Pie
            chartSeries.Appearance.LabelAppearance.Visible = False
            chartSeries.Appearance.TextAppearance.Visible = False
            chartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels

            result = WebPartBase.LoadActivePropertyByStatus()
            For i As Integer = 0 To (result.Rows.Count - 1) Step 1
                chartSeries.AddItem(CustomFunctions.HandleDBNULL(result.Rows(i)("count"), 0.0), CustomFunctions.HandleDBNULL(result.Rows(i)("SaleStatus"), ""))
            Next


            Return chartSeries
        End Function


    and the output which is shown 12.jpg, way different then what my clients wants.

    I am new to telerik chart control, so i am just throwing arrows in the dark.

    could any one please help me out here.
     
  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 27 Jul 2010 Link to this post

    Hi Deepak,

    Please, review this thread where a similar scenario is described.

    Hope this will help.

    Best wishes,
    Velin
    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
Back to Top