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

When does the Chart Object Become a First Class Control

3 Answers 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marcus Kellermann
Top achievements
Rank 1
Marcus Kellermann asked on 31 Mar 2010, 02:31 PM
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
    } 

3 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 02 Apr 2010, 03:45 PM
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.
0
Andrew
Top achievements
Rank 1
answered on 31 Jan 2014, 05:25 PM
Seriously - I have to convert a date into a double, just to get the x axis to display the labels as dates? 
This is considered intuitive programming? 
I like many of the controls telerik develops, but the radchart is the most frustrating control I have ever worked with.
0
Stef
Telerik team
answered on 05 Feb 2014, 12:57 PM
Hello Andrew,

The old Chart item is obsolete. As of Telerik Reporting Q1 2013 we have introduced a new Graph item, which has better design-time, expressions, interactivity and styling support.

Using a DatetimeScale you can set any axis to display DateTime values. For more details take a look at the How to: Change the Axis Scale help article.

Regards,
Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Marcus Kellermann
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Andrew
Top achievements
Rank 1
Stef
Telerik team
Share this question
or