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

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

1 Answer 184 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Deepak
Top achievements
Rank 1
Deepak asked on 21 Jul 2010, 08:29 PM
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.
 

1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 27 Jul 2010, 08:31 AM
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
Tags
Chart (Obsolete)
Asked by
Deepak
Top achievements
Rank 1
Answers by
Velin
Telerik team
Share this question
or