Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Reporting > Telerik Reporting > When does the Chart Object Become a First Class Control

Not answered When does the Chart Object Become a First Class Control

Feed from this thread
  • Marcus Kellermann avatar

    Posted on Mar 31, 2010 (permalink)

    I have to say, I really like what I see with Telerik Reporting.  The accuracy of the export to Excel and PDF is what has led me to look at it deeper and deeper.  However the Chart Object in the reports simply sucks.  When I was using the RadChart in a standard ASP.NET page I could easily get in and change individual bar colors during the ItemDatabound event.

    The attached image is a chart I created using RadChart and a standard ASP.NET webform.  If the value in the PeakUsages series (Bar) exceeds the value in the LicenseCount series (line) then the color of the chart bar is changed to red.  This is accomplished with the simple code listed below.

    However the chart in reporting (which as I understand it is suppose to be RadChart under the covers) can't do this,  It doesn't appear that you can modify the chart during the databound event.  Why?   

    To make matters worse, attempting to refine the charts visual appearance in Visual Studio is painful at best.  You have to drill into 15 different properties to change the back ground color of the plot area.  Then when you use preview to see how it looks and then switch back to design mode.  Your previous properties context is completely lost.  When you return to design mode your selection is set back to the report not the previous selected object and you lose all of the expansion you had done in the properties pane.  (Note I am using VS2010 RC with Q1 2010).

    The shear fact that I can't duplicate the chart functionality in Telerik Reporing is forcing me to continue to use RadGrid and RadCharts as my reporting solution, which really sucks as I have to spend a lot more time focusing on code to properly export the Grid to Excel and PDF.

    When is the Chart in Telerik reporting going to become a first class object?   
    Things I'd like to see include
    1. Full control over the chart rendering from the code behind.  Allow me to have the same ItemDataBound event logic as RadChart
    2. Context, Context, Context.   Remember where I was when I return from preview, don't force me to reselect the chart, expand properties etc.
    3. Cut and paste a chart definition, or access to the markup for the chart.  
    • I want to be able to paste a chart definition from an asp.net page into a report.  Or allow me to mark it up in the same manor, which would allow me to quickly duplicate the look and feel and refine it without having to mess with the properties pane.

    protected void rowChart_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e) 
        { 
        if(e.SeriesItem.Parent.Name == "PeakUsages"
            { 
            DataRowView drv = (DataRowView)e.DataItem; 
            if(drv["PeakUsages"] != DBNull.Value) 
                { 
                if(Convert.ToInt16(drv["PeakUsages"]) > Convert.ToInt16(drv["LicenseCount"])) 
                    { 
                    e.SeriesItem.ActiveRegion.Tooltip = string.Format("Usage exceeds license: \nDate: {0}\nUsage: {1} \nLicense: {2}"
                                                                       Convert.ToDateTime(drv["UsageDate"]).ToShortDateString(),  
                                                                       drv["PeakUsages"].ToString(),  
                                                                       drv["LicenseCount"].ToString()); 
                    e.SeriesItem.Label.Visible = false
                    e.SeriesItem.PointAppearance.FillStyle.MainColor = Color.DarkRed; 
                    e.SeriesItem.Appearance.FillStyle.MainColor = Color.DarkRed; 
                    e.SeriesItem.Appearance.FillStyle.SecondColor = Color.Red; 
                    e.SeriesItem.PointAppearance.FillStyle.SecondColor = Color.DarkRed; 
                    e.SeriesItem.PointAppearance.Border.Color = Color.DarkRed; 
                    } 
                else 
                    { 
                    e.SeriesItem.Label.Visible = false
                    e.SeriesItem.PointAppearance.Visible = false
                    e.SeriesItem.ActiveRegion.Tooltip = string.Format("Date: {0} \nUsages: {1}", Convert.ToDateTime(drv["UsageDate"]).ToShortDateString(), drv["PeakUsages"].ToString()); 
                    } 
                } 
            else 
                { 
                e.SeriesItem.Visible = false
                e.SeriesItem.Label.Visible = false
                e.SeriesItem.PointAppearance.Visible = false
                } 
            } 
        else 
            e.SeriesItem.Label.Visible = false
        } 

    Attached files

    Reply

  • Chavdar Chavdar admin's avatar

    Posted on Apr 2, 2010 (permalink)

    Hi Marcus Kellermann,

    Indeed, the Chart report item misses some of the functionality of the RadChart control but this is on purpose. Some things, such as the ItemDataBound event, have a different meaning in the context of the Reporting tool and thus cannot be exposed without breaking the reporting model.

    In case the Chart item does not provide enough functionality to suffice your needs you can use another approach. Instead of the Chart item you can use a PictureBox item and set as an image a chart image generated by another charting control. It could be the original RadChart control or any other chart. For reference implementation you can check the "Use asp:chart in Telerik Reports" code library entry.

    Another suggestion I can give is not to preview the chart in the Preview tab. You can simply add fake series and items at design time and apply all the settings that you need. Eventually you can delete the design time series so that they do not interfere with the ones generated at design time.

    Hope this information helps and thank you for the feedback.

    Regards,
    Chavdar
    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Reporting > Telerik Reporting > When does the Chart Object Become a First Class Control
Related resources for "When does the Chart Object Become a First Class Control"

Features  |  Documentation  |  Demos  |  Telerik TV  |  Knowledge Base  |  Code Library  |  Step-by-step Tutorial  |  Blogs  |  Whitepaper  ]