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

Radchart click event

4 Answers 281 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
prayag ganoje
Top achievements
Rank 1
prayag ganoje asked on 25 Apr 2011, 04:33 PM
hello,

I have few radcharts (Bar, line) and also have implemented a OnClick events for them. These click events are restricted only to the bar (if exists) or active regions in case of line chart.

I would like to have a click event if I click any where on the chart plotarea and not only the bar or active region in the line chart.

Can you please suggest me how I can achieve the same ?

Protected Sub rc_CSMD_Click(sender As Object, args As Telerik.Charting.ChartClickEventArgs) Handles rc_CSMD.Click
                Response.Redirect("~/Internal/Dashboard/EditReport.aspx)
    End Sub

4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 28 Apr 2011, 11:55 AM
Hello prayag ganoje,

Presently, RadChart does not support a click method only for PlotArea. However you can add a click method to the generated RadChart image. For example, after the image is generated you can get it by javascript code and add a click event in which you can redirect to another page. Please note that this will make the entire RadChart clickable.

Kind regards,
Polina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
prayag ganoje
Top achievements
Rank 1
answered on 01 May 2011, 10:26 PM
Hello,

Can you please provide some code sample for the work around you have suggested ?

Also is there any KB document on the same ?

0
prayag ganoje
Top achievements
Rank 1
answered on 04 May 2011, 05:13 AM
Hello,

can you please redirect me to some KB dock if available for this ? Actually I didnot get what you mentioned in your previous reply.
0
Missing User
answered on 05 May 2011, 12:04 PM
Hello prayag ganoje,

As I mentioned in the previous post this functionality is not supported in the RadChart by default. You can achieve a similar functionality by making the entire RadChart clickable. One possible workaround is to get the RadChart with javascript and after that redirect to another page. For example:
markup code
<script type="text/javascript">
    function MyPageLoaded() {
        var chartDiv = document.getElementById('RadChartId');
        if (chartDiv != null) {
            chartDiv.setAttribute("onclick", "RadChartClick()");
        }
    }
 
    function RadChartClick() {
        location.href = '<%= Page.ResolveUrl("~/MyRedirectPage.aspx") %>';
    }
</script>
and set body onload event to MyPageLoaded()
<body onload="MyPageLoaded()">
You can also wrap the chart with a link which can achieve the same scenario.

Best wishes,
Polina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Chart (Obsolete)
Asked by
prayag ganoje
Top achievements
Rank 1
Answers by
Missing User
prayag ganoje
Top achievements
Rank 1
Share this question
or