Sign in to follow this  
Dhruva

Print Chart is nit available in JS File

Recommended Posts

Hi,

I am using the demo version and i didn't found the chartToPrint() method in the fusion charts JS File. And i am using ASP.Net for developing and if any Server Side code available to print it?

Thanks & Regards,

V.U.M.Sastry Sagi

Edited by Guest

Share this post


Link to post
Share on other sites

Hello V.U.M.Sastry Sagi,

Could you please try using var abc = getChartFromId("mychartid1") and then use abc.print and try again?

abc could be any variable name, and mychartid1 should be replaced with the chart id you are using.

Share this post


Link to post
Share on other sites

Hi Dhruva Ghosh,

I tried that but it is not working for me. I am using

/**

 *  @package: FusionCharts Export Component

 *  =======================================

 *

 *  @description:

 *  This JavaScript contains all the relevant codes to make FusionCharts Export Component to function.

 *  Copyright © InfoSoft Global Pvt. Ltd. (http://www.infosoftglobal.com/)

 *

 *  @version: 1.0

 *  @published: 2009-02-20

 * 

 */

and

/**

 * FusionCharts: Flash Player detection and Chart embedding.

 * Version: 1.2.3 (15th September, 2008) - Added fix for % and & characters, fixes to properly handle double quotes and single quotes in setDataXML() function.

 * Version: 1.2.2 (10th July, 2008) - Added fix for % scaled dimensions, fixes in setDataXML() and setDataURL() functions

 * Version: 1.2.1 (21st December, 2007) - Added setting up transparent/opaque mode: setTransparent() function

 * Version: 1.2 (1st November, 2007) - Added FORM fixes for IE

 * Version: 1.1 (29th June, 2007) - Added Player detection, New conditional fixes for IE

 *

 * Morphed from SWFObject (http://blog.deconcept.com/swfobject/) under MIT License:

 * http://www.opensource.org/licenses/mit-license.php

 *

Java Script Files. shall i use any other JS. is there any C# Handelers for server side printing and exporting?

Thanks in Advance.

V.U.M.Sastry Sagi

Share this post


Link to post
Share on other sites

This is slightly silly of me, but in my previous reply, I missed the parenthesis at the end of the print method, so could you please try it with the same? That is, like, abc.print()

Thanks!

Share this post


Link to post
Share on other sites

hey i used the paranthesis. i know javascript. but the problem is the JS files included in the app is not having the print methods. more over when ever i am trying to use the print method i am getting a error message saying tyhat the object doensot support the method.

Thanks&Regards,

V.U.M.Sastry Sagi

Share this post


Link to post
Share on other sites

The .print() method is an external API method of the chart itself, it is not a part of the FusionCharts.js file.

So could you please try enabling the register with JS parameter and try again?

It should look something like:

var myChart = new FusionCharts("../FusionCharts/Column3D.swf", "myChartId", "900", "300", "0", "1");

 

I hope this helps! :)

Share this post


Link to post
Share on other sites

hi I used the sample code

given below and find the attachment with error message

<html>
<head>
 <title>
 FusionCharts Client-side Export Sample
 </title>
 <script language="JavaScript" src="../../FusionCharts/FusionCharts.js"></script>
 <script language="JavaScript" src="../../FusionCharts/FusionChartsExportComponent.js"></script>
 <script type="text/javascript">
 function startExport(){
 //Get reference to chart.
 
    var chart = getChartFromId("myChartId");
 //Now, we proceed with exporting only if chart has finished rendering.
 //We do not check rendering of export component, as FusionCharts Export Object JS
 //has a built-in queue that stacks up the export request until the component is ready.
 if (chart.hasRendered()==true){
  //chart.exportChart();
   chart.print();
 }else{
  alert("Please wait for the chart to finish rendering, before you can invoke exporting");
 }
 }
 </script>
</head>
<body bgcolor="#ffffff">
<div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div>
  <script type="text/javascript">
   //Create the chart.
 //Note that you necessarily need to set the registerWithJS attribute as 1, as JavaScript is used for client-
 //side communication between the chart and FusionCharts Exporter Component.
 var myChart = new FusionCharts("../../FusionCharts/Column2D.swf", "myChartId", "500", "300", "0", "1");
 myChart.setDataURL("ClientSideSimple.xml");
 myChart.render("chartdiv");
  </script>
 <!-- We also create a DIV to contain the FusionCharts client-side exporter component -->
 <div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div>
 <script type="text/javascript">
   //Render the export component in this
 //Note: fcExporter1 is the DOM ID of the DIV and should be specified as value of exportHandler
 //attribute of chart XML.
 
   var myExportComponent = new FusionChartsExportObject("fcExporter1", "../../FusionCharts/FCExporter.swf");
 
    //Render the exporter SWF in our DIV fcexpDiv
   myExportComponent.Render("fcexpDiv");
  </script>
  
  <center><input type='button' value='Begin Chart Export' onClick="javascript:startExport();">
</body>
</html>

Please let me know why i am unable to get the print. this is what i get in the ExportChartSamples under code section under Fusion Chrats site bundle 3.1 version.

Thanks in advance.

V.U.M.Sastry Sagi

post-4728-128441571409_thumb.png

Share this post


Link to post
Share on other sites

Hello again,

We tried various browsers and platforms, and so far we could not reconstruct the problem at our lab. The code seems to run properly.

Could you please try adjusting the settings of Flash and try again? Could you please see the following link for the same? http://www.fusioncharts.com/forum/Topic5009-47-1.aspx#bm8077

Thanks!

Let's hope this works. :)

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