I need Help on pie chart..Please

Thread is closed for posting
2 posts, 0 answers
  1. john
    john avatar
    4 posts
    Member since:
    Aug 2011

    Posted 05 Sep 2011 Link to this post

    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
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 05 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top