Sign in to follow this  
ywinston

Help! Charts will not display in asp.net

Recommended Posts

Charts will not display at all and the Samples will not work! Help!  Here is my code

<head runat="server">
<meta http-equiv="Pragma" content="no-cache" /> 
<link href="mainstyles.css" media="screen" rel="stylesheet" type="text/css" />
<link href="../advancement_kpi_styles.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="../FusionCharts.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<form id="advform" name="advdash1" method="post" runat="server"> 
<!--<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" align="left" valign="top" class="select-tab"> -->
<div id="page">
<div id="header">
<div id="logo">
<!-- <img src="images/logo.gif" /> -->
</div>
</div> 
<div id="maincontent"> <b>TCU Fund Raising -- Key Performance Indicators</b> 
<div id="advdash" align="left">
<%=CreateChart()%> 
</div>
</div>
</div>
</form>
</html>
Public Function CreateChart() As String
'strChart will be used to store the entire XML document generated
Dim strChart As String
' Doing Selects for Dials
'Generate the graph element
strChart = ""
strChart = "<chart bgColor='FFFFFF' upperLimit='1500000' lowerLimit='0' baseFontColor='9300ff' majorTMNumber='10' majorTMColor='9300ff' majorTMHeight='10' majorTMThickness='3' minorTMNumber='5' minorTMColor='0c9cef' minorTMHeight='2' minorTMThickness='1' pivotRadius='2' pivotBgColor='000000' pivotBorderColor='FFFFFF' hoverCapBorderColor='FFFFFF' toolTipBgColor='FFFFFF' gaugeOuterRadius='75' gaugeScaleAngle='280' formatnumberScale='1' numberScaleValue='1000,1000,1000' numberScaleUnit='K,M,B' gaugeAlpha='0' decimalPrecision='0' displayValueDistance='15' showColorRange='0' placeValuesInside='1000' pivotFillMix='' showPivotBorder='1' pivotBorderThickness='1' showGaugeBorder='1' BorderColor='FFFFFF' valueBelowPivot='1' showValue='1'> "
strChart = strChart + "<dials> <dial value='250000'"
strChart = strChart + +"'"
strChart = strChart + " toolText='Corporate' bgColor='9300ff' borderColor='FFFFFF' borderAlpha='360' baseWidth='5' topWidth='2' borderThickness='1'/> </dials>"
strChart = strChart + "<annotations><annotationGroup xPos='100' yPos='110'>"
strChart = strChart + "<annotation type='circle' radius='80' startAngle='0' endAngle='360' fillAsGradient='1' fillColor='9300ff, cc99ff' fillAlpha='100,100' fillRatio='95,5'/>"
strChart = strChart + "<annotation type='circle' xPos='0' yPos='0' radius='80' startAngle='0' endAngle='360' showBorder='1' borderColor='cccccc' fillAsGradient='1' fillColor='ffffff,000000' fillAlpha='50,100' fillRatio='1,99'/>"
strChart = strChart + "</annotationGroup><annotationGroup xPos='100' yPos='150' showBelowChart='0'> <annotation type='text' label='Corporate Giving' fontColor='cc99ff' fontSize='10' isBold='1'/></annotationGroup></annotations> </chart>"
Dim strXML As String
strXML = ""
strXML = strXML & "<graph caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' decimalPrecision='0' formatNumberScale='0'>"
strXML = strXML & "<set name='Jan' value='462' color='AFD8F8' />"
strXML = strXML & "<set name='Feb' value='857' color='F6BD0F' />"
strXML = strXML & "<set name='Mar' value='671' color='8BBA00' />"
strXML = strXML & "<set name='Apr' value='494' color='FF8E46'/>"
strXML = strXML & "<set name='May' value='761' color='008E8E'/>"
strXML = strXML & "<set name='Jun' value='960' color='D64646'/>"
strXML = strXML & "<set name='Jul' value='629' color='8E468E'/>"
strXML = strXML & "<set name='Aug' value='622' color='588526'/>"
strXML = strXML & "<set name='Sep' value='376' color='B3AA00'/>"
strXML = strXML & "<set name='Oct' value='494' color='008ED6'/>"
strXML = strXML & "<set name='Nov' value='761' color='9D080D'/>"
strXML = strXML & "<set name='Dec' value='960' color='A186BE'/>"
strXML = strXML & "</graph>"
'Create the chart - Column 3D Chart with data from strXML variable using dataXML method
Return FusionCharts.RenderChartHTML("../FCF_Column3D.swf", "", strXML, "myNext", "600", "300", False)
'Create the chart - Pie 3D Chart with data from strXML
Return FusionCharts.RenderChart("../AngularGauge.swf", "", strChart, "advdash", "200", "220", False, False)
End Function

ywinston

Share this post


Link to post
Share on other sites

Hi,

Thanks for the Snap. It shows that some files are not in proper places. Could you please put the DLL file in Bin folder. You might organize the files in Separate folders for better understanding too. Could you please go through our Online Dcoumentation on the Basic samples that we have created. There we alos talked about waht goes where. DLL files must be in Bin folder. Please give it a try and let us know.

Share this post


Link to post
Share on other sites

Hi,

Could you please send us a snap of what you are getting as output or error in the page when you try to run the application? Note that these samples are for ASP.NET 2.0 and wont work in ASP.NET 1.1

NOTE :

 

Your code shows some probable errors :

1.


<

head runat="server">

<

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

<

script type="text/javascript">

</

script>

</

head>

<

body>

<form id="advform" name="advdash1" method="post" runat="server">

<div id="page">

<div id="header">

<div id="logo">

</div>

</div>

<div id="maincontent"> <b>TCU Fund Raising -- Key Performance Indicators</b>

<div id="advdash" align="left">

<%

=CreateChart()%>

</div>

</div>

</div>

</form>

</body>

</html>

 

2. Are you using the code for the Function in code behind page or in the same page as shown in the first post?

If latter could you please use it inside <script runat="server></script>

3. String Concatination is done using & in VB

strChart = strChart & "'"

 




'Create the chart - Column 3D Chart with data from strXML variable using dataXML method

Return FusionCharts.RenderChartHTML("../FCF_Column3D.swf", "", strXML, "myNext", "600", "300", False)

'Create the chart - Pie 3D Chart with data from strXML

Return FusionCharts.RenderChart("../AngularGauge.swf", "", strChart, "advdash", "200", "220", False, False)

These, except the use of "+ +", though wont much harm the output.

 

 

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