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

Passing a Parameter when drilling down a Bar Chart

1 Answer 64 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 03 Jun 2013, 01:57 PM
Hello

I work for a UN organisation, where I am trying to create a dashboard, where a manager can drill into details about staff based on the kind of salary system they are on.

I have attached the chart I have created, for reference.

This chart I populate with a data source created declaratively in the .aspx file. I the chart in crated with a group by base in the salary system.

This creates the chart as is seen in the attachment. it automatically puts in the text codes for the salary system, for each column. cool functionality BTW, thank you! Now, I would like to create the drilldown, so that if a user clicks a column, then he/she gets details information about the distribution, of what is called grades, within each salary system.

For that I have created a second data source, with the same Control parameter that is used for the initial chart, this is a country, selected from a dropdown list, and a additional parameter, that I would like to be the text that is located below each of the columns.

I assumed that I could use the below code, to fill in that parameter:
protected void MyRadChart_Click(object sender, Telerik.Charting.ChartClickEventArgs args)
    {
        if (args.SeriesItem != null)
        {
            staffCountByGrade.SelectParameters[1].DefaultValue = args.SeriesItem.Name;
            MyRadChart.DataSourceID = "staffCountByGrade";
        }
    }
 The SelectParameter[0] comes from the dropdown list.

What I get is text lie Item 1, Item 2, and so on. Is the no way I can get at the text that the chart has automatically put in from the initial data source?

1 Answer, 1 is accepted

Sort by
0
Rosko
Telerik team
answered on 06 Jun 2013, 08:19 AM
Hello Tom,

Thank you for the detailed explanation. You are on the right track.

In the same event before you set the DataSourceID property you need to set MyRadChart.PlotArea.XAxis.DataLabelsColumn property with the name of the property in your business object in the new data source. You can check an online demo with source included regarding this scenario.

Regards,
Rosko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (Obsolete)
Asked by
Tom
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or