Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to display a copy of the WebChartControl in the ASPxPopupControl

$
0
0

In this example, you can find a ChartPopupControl.ascx user control. To use this control, attach it to the WebChartControl instance via the ChartPopupControl.CopyFromChart() server-side method. Then, simply call the ChartPopupControl.Show() method on the client side (via the JavaScript) to display a popup. Note that in addition, you can print and export a WebChartControl directly from the popup.

Question Comments

Added By: Mark D Loaney at: 9/25/2014 5:59:31 PM    

I'm wondering if you can apply this to chart controls that are dynamically created. I have a page that creates 36 thumbnails on the fly for a number of sites. These charts are added inside a panel control and laid out on a grid. I want to click any of the charts and then open the pop up control.

I've created the webchartcontrol, and can add in a client side event to the chart on the object selected with

chtTemp.ClientSideEvents.ObjectSelected = "function(s, e) { ChartpopupControl1.Show();}"

but I need to get the actual thumbnail that was clicked in the page load event in this line in code behind

ChartpopupControl1.CopyFromChart(WebChartControl1, 600, 400)

I'm thinking I need to save a variable in javascript, write to a session or hidden control - thoughts?

Added By: Alex (DevExpress Support) at: 9/26/2014 4:33:18 AM    Hi Mark,

In this case you can save the chart layout in a Session variable and apply it to the chart shown in the Popup window. Attached is a small sample project that illustrates this approach in action. I hope this helps.

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>