Sign in to follow this  
FusionCharts Support

How to Use Grid Components with ASP.NET C# HELP

Recommended Posts

Hello, Im trying out Fusion Charts. Im using ASP.net and C#. I want to use the Grid Component with a Pie chart. I'm using the DataURL method. The Grid is setup to use the same dataURL as the Pie chart and it works fine. However, I'm not sure how to pass parameters to the grid. I want to "showPercentValues" but the tutorial only shows the basic java/html example:

 <script type="text/javascript">

var myGrid = new FusionCharts("../FusionCharts/SSGrid.swf", "myGrid1", "300", "200", "0", "0");

myGrid.setDataURL("Data.xml");

//Set Grid specific parameters

myGrid.addVariable('showPercentValues', '1');

myGrid.addVariable('showShadow', '1');

myGrid.render("griddiv");

 </script>

On my aspx page, the chart and grid are in literals as follows:

 

<table cellpadding="4" cellspacing="0" border="1px">

<tr>

  <td bgcolor="#efefef">COMBINATION TYPES: LIFETIME HITS</td>

</tr>

<tr>

  <td><%=GetTypeCountChartHtml()%></td>

</tr>

<tr>

  <td><%=GetTypeCountGridHtml()%></td>

</tr>

</table>

In the .aspx.cs page, I have:

public string GetTypeCountChartHtml()

{

String dataURL = Server.UrlEncode("TypeCount.aspx?animate=1");

//Create the chart - Pie 3D Chart with dataURL as strDataURL

return FusionCharts.RenderChart("../FusionCharts/Pie3D.swf", dataURL, "", "TypeCount", "350", "250", false, false);

}

public string GetTypeCountGridHtml()

{

String dataURL = Server.UrlEncode("TypeCount.aspx");

//Create the Grid For the Pie 3D Chart with dataURL as strDataURL

return FusionCharts.RenderChart("../FusionCharts/SSGrid.swf", dataURL, "", "TypeGrid", "350", "90", false, false);

}

}

How do I pass parameters (like showPercentValues and showShadow) to the grid. I'm new to asp and c#. Any help would be appreciated.

Thanks,

Scott

Edited by Guest

Share this post


Link to post
Share on other sites

Hi there and thanks! I passed the parameters as follows and it works!

public string GetTypeCountGridHtml()

{

String dataURL = Server.UrlEncode("TypeCount.aspx?");

//Create the chart - Pie 3D Chart with dataURL as strDataURL

return FusionCharts.RenderChart("../FusionCharts/SSGrid.swf?showPercentValues=1&showShadow=1", dataURL, "", "TypeGrid", "350", "90", false, false);

}

Thanks again!

Scott

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