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

I need Help on pie chart..Please

1 Answer 32 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 05 Sep 2011, 02:17 PM
I need to change the colors on pie chart.code is here.if success then green color, for failure red,for Not applicable fill with gray color.
And I have attached the screen shot.please reply me.

Protected Sub GetLatestBackup()
        Try
            'To bind the Latest Backup Chart
            rcLatestBackup.Series.Clear()
            Dim dbNutBackupModel As New NutBackupModel
            Dim dashlist As List(Of DashBoardList)
 
            dashlist = (From objdashboardlist In dbNutBackupModel.Getbackupstatus _
                       Select New DashBoardlist With {.CntSuccessful = (CInt(objdashboardlist(4))), .CntFailure = (CInt(objdashboardlist(5))), .CntNA = (CInt(objdashboardlist(6)))}).ToList()
            ' Dim intSuccessful As Integer = dashlist.IndexO
            Dim dtList As New DataTable("StatusList")
            dtList.Columns.Add("Count", GetType(Integer))
            dtList.Columns.Add("Status", GetType(String))
            Dim drowSuccess As DataRow = dtList.NewRow()
            Dim drowFailed As DataRow = dtList.NewRow()
            Dim drowNA As DataRow = dtList.NewRow()
            drowSuccess("Count") = dashlist.Item(0).CntSuccessful
            drowSuccess("Status") = "Successful"
            dtList.Rows.Add(drowSuccess)
            dtList.AcceptChanges()
 
 
            drowFailed("Count") = dashlist.Item(0).CntFailure
            drowFailed("Status") = "Failed"
            dtList.Rows.Add(drowFailed)
 
            drowNA("Count") = dashlist.Item(0).CntNA
            drowNA("Status") = "N/A"
            dtList.Rows.Add(drowNA)
            dtList.AcceptChanges()
 
            rcLatestBackup.DataSource = dtList
            rcLatestBackup.IntelligentLabelsEnabled = True
            rcLatestBackup.DataManager.LabelsColumn = "Status"
            rcLatestBackup.DataBind()
            rcLatestBackup.Series(0).Name = "Status"
            rcLatestBackup.Series(0).Appearance.LegendDisplayMode = Telerik.Charting.ChartSeriesLegendDisplayMode.ItemLabels
            rcLatestBackup.Series(0).ActiveRegionToolTip = "#ITEM: #%"
            rcLatestBackup.ChartTitle.TextBlock.Text = " Latest backup status- " & " Success : " & dashlist.Item(0).CntSuccessful & "  " & " Failure : " & dashlist.Item(0).CntFailure
            rcLatestBackup.Series(0).Appearance.LabelAppearance.Visible = True
        Catch ex As Exception
            CommonFunctions.ErrorLog("Dashboard.aspx.vb", "GetLatestBackup", ex)
        End Try
 
    End Sub
<telerik:RadChart ID="rcLatestBackup" runat="server" DefaultType="Pie" AutoTextWrap="true" SeriesOrientation="Vertical">
                                 
                                   <Appearance Dimensions-Width="710px" ImageQuality="HighQuality">
                                 </Appearance>
                                <Series>
                               <telerik:ChartSeries Name="Series 1" Type="Pie" DataYColumn="">
                               <Appearance LegendDisplayMode="SeriesName">
                            </Appearance>
                </telerik:ChartSeries>
            </Series>
                        </telerik:RadChart

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Sep 2011, 05:37 PM
Hello,

http://www.telerik.com/help/aspnet/chart/buildingprogrammaticcreate.html
http://www.telerik.com/help/aspnet/chart/buildingprogrammaticcreate2.html

or

ChartSeries chartSeries = radChart.CreateSeries("Count",
   System.Drawing.Color.RoyalBlue,
   System.Drawing.Color.LightSteelBlue,
   ChartSeriesType.Bar);


Thanks,
Jayesh Goyani
Tags
Chart (Obsolete)
Asked by
john
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or