Sign in to follow this  
thoth

How do I make Pie Chart links pass parameters to a GridView - HELP

Recommended Posts

Hello all,

I've been racking my brain for three days trying to find a solution to this problem. I hope someone here can help me.

I have a pie chart and a GridView on the same page. I want to make each slice of the pie chart act as a parameter that changes the GridView. I've thoroughly read the documentation and toyed with the examples. Ive even downloaded and examined the blueprint application, but I cannot find a working example of this scenario to learn from.

As a temporary work around, I am passing parameters from the pie chart as a query string in a url to another page via the charts link element. This target page contains a gridview and it's loaded into an iframe below the pie chart.  While this work around does its job, its not really what I want to do.

How can I pass parameters from the chart to a gridview that resides on the same page so I can make the gridview change using an ajax partial page refresh?

Any help would greatly be appreciated.

Share this post


Link to post
Share on other sites

Hi,

Here i am attaching a new update panel sample to fir your need. I have modified the sample2.aspx of the UpdatePanel samples we have provided in the Code folder and also Documented. I have modified it to put a chart(pie). When a pie slice is clicked, a gridview that shows data related to that slice will be generated on the left on the chart.

UpdatePanel_chartToGridView.zip

Share this post


Link to post
Share on other sites

Hi thanks so much! Your example works great but when I try to implement it into my own page I have a problem. When I click on the pie chart, the grid changes but its a full page refresh and the progress template doesn't fire. Im not sure as to why this is. I have other charts on the page and another update panel and a few controls...could these be interfering with the __doPostBack function somehow?

Here is the code to the page:

<%@ Page Language="C#" MasterPageFile="~/Ohio/OhioMaster.master" AutoEventWireup="true" CodeFile="Frequencies2.aspx.cs" Inherits="Ohio_Straights_Frequencies2" Title="Untitled Page" %>

<

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<

script language="javascript" type="text/javascript" src="../../FusionCharts/FusionCharts.js"></script>

<

div class="CommonBreadCrumbArea">

<

asp:SiteMapPath ID="SiteMapPath1" PathSeparator="

Share this post


Link to post
Share on other sites

Ok your par is an int so you can just pass it but how do I pass a string? I'm having a problem formatting the XML because of all the ' and " needed to build the link.

Share this post


Link to post
Share on other sites

I need this example using VB.NET and two seperate variables.

I know where the problem is in the following code I just don't know where to fix it.

Here is the XML generated:

<Chart Caption='CC/CCA Regional Report - 12/01/2008 to 12/05/2008' Palette='2' ShowNames='1' ShowValues='1' NumPrefix='' ShowSum='0' Decimals='1' UseRoundEdges='1' xAxisName='Regions' yAxisName='Number of Lines'>

<Categories>

<Category label='EAST' />

<Category label='WEST' />

</Categories>

<dataset seriesname='CLOSED'>

<set value='3098' link='javascript:updateChart('2:EAST')'/>

<set value='5075' link='javascript:updateChart('2:WEST')' />

</dataset>

 

<dataset seriesname='VALIDATED'>

<set value='3418' link='javascript:updateChart('2:EAST')'/>

<set value='5693' link='javascript:updateChart('2:WEST')' />

</dataset>

 

</Chart>

I'm using the same code posted above, the only difference being i'm throwing two single quotes around the highlighted areas in order for javascript to except my colon (:) which i am using on the backend as a delimeter.

Any help would be much appreciated.

Share this post


Link to post
Share on other sites

Hi,

Could you please try the following code?

<Chart Caption='CC/CCA Regional Report - 12/01/2008 to 12/05/2008' Palette='2' ShowNames='1' ShowValues='1' NumPrefix='' ShowSum='0' Decimals='1' UseRoundEdges='1' xAxisName='Regions' yAxisName='Number of Lines'>

<Categories>

<Category label='EAST' />

<Category label='WEST' />

</Categories>

<dataset seriesname='CLOSED'>

<set value='3098' link='updateChart("2:EAST" )'/>

<set value='5075' link='updateChart("2:WEST" )' />

</dataset>

<dataset seriesname='VALIDATED'>

<set value='3418' link='updateChart("2:EAST" )'/>

<set value='5693' link='updateChart("2:WEST" )' />

</dataset>

</Chart>

You would need to use " for single quote (') character.

Edited by Guest

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this