Sign in to follow this  
maks

I can't see the any export format when right click the mouse

Recommended Posts

Hi:

I posted it under Miscellanius forum, but I didn't get any reply. So I'm posting it here again.

I have a drilldown chart (Bar2D chart) that I need to save in PDF/JPEG format and I tried it to save the same way as I did for other charts.

When I enabled the chart and right click the mouse on the chart it doesn't show any export formats  - JPEG, PNG or PDF

(Save Image as ... are not appearing).

I did the following things:

1. Added FusionChartsExportComponent.js to my .aspx file -

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

2. Set the registerWithJS attribute as 1 (true)

3. Set attribute exportEnabled='1' like:

xmlData.Append(" exportEnabled='1' exportAtClient='1' exportHandler='fcExporter1' exportFormats='JPEG=Export as JPEG|PDF=Export as PDF|PNG=Export as PNG' exportFileName='14 days detailed chart' ");

xmlData.Append(" exportDialogColor='e1f5ff' exportDialogBorderColor='0372ab' exportDialogFontColor='0372ab' exportDialogPBColor='0372ab' exportDialogMessage='Exporting chart'>"); //these properties are for Configuring export dialog box

 I'm wondering if there is any problem exporting Bar2D chart......

I also have a Grid chart which giving me the same problem.

Would someone please let me know the way I can save Bar2D and Grid Chart as image.

Need your help pls.

Thanking You,

 

Maksuda...

Share this post


Link to post
Share on other sites

Hi Maksuda,

Could you please make sure that you are using latest version of Bar2D chart (To get the version you would need to render the chart in debug mode)?

And I am afraid Grid chart do not support "Exporting as image" feature as of now.

Share this post


Link to post
Share on other sites

Thanks Rahul for the reply. For the latest version of Bar2D it's working. I'm disappointed for the Grid chart though.

I've two more things that I need to fix for exporting chart as image.

First, I have a button for exporting the chart before enabling save button.

When I click the button it exports the chart and enables Save button. After clicking the Save button a popup screen comes up for saving the chart. But the extention of the image is .png which I don't want. Is there any way I can set the image save extention as I want (it could be JPEG or PDF).

Second, when I right click on the chart it gives me the scope for "Exporting as Image" with 3 options - JPEG,PDF and PNG. When I select PDF and export chart, I can save as .PDF by clicking save button. When I select JPEG I can't save as JPEG. It gives .PNG extention. Even I tried avoiding PNG from the "Exporting as Image" options (exportFormats='JPEG=Export as JPEG|PDF=Export as PDF). Still save type gives me .PNG extention when I select JPEG.

I can change .png as .jpeg but it's not logical that I select JPEG image type and it gives me PNG.

Do you have any idea why it's happening please?

Here is my code for importing charts and saving images.

<div id="fcexpDiv" align="center">FusionCharts Export Handler Component</div>
<script type="text/javascript">

var myExportComponent = new FusionChartsExportObject("fcExporter1", "FusionCharts/FCExporter.swf");
myExportComponent.componentAttributes.width = '330';
myExportComponent.componentAttributes.height = '60';
myExportComponent.componentAttributes.bgColor = 'ffffdd';
myExportComponent.componentAttributes.borderThickness = '2';
myExportComponent.componentAttributes.borderColor = '0372AB';
myExportComponent.componentAttributes.fontFace = 'Frutiger LT 45 Light';
myExportComponent.componentAttributes.fontColor = '0372AB';
myExportComponent.componentAttributes.fontSize = '12';
myExportComponent.componentAttributes.showMessage = '1';
myExportComponent.componentAttributes.message = 'Export the chart first, and then click on this button to save';
myExportComponent.componentAttributes.btnWidth = '150';
myExportComponent.componentAttributes.btnHeight= '25';
myExportComponent.componentAttributes.btnColor = 'E1f5ff';
myExportComponent.componentAttributes.btnBorderColor = '0372AB';
myExportComponent.componentAttributes.btnFontFace = 'Frutiger LT 45 Light';
myExportComponent.componentAttributes.btnFontColor = '0372AB';
myExportComponent.componentAttributes.btnFontSize = '15';
myExportComponent.componentAttributes.btnsavetitle = 'Save the chart'
myExportComponent.componentAttributes.btndisabledtitle = 'Waiting for export'; 
myExportComponent.Render("fcexpDiv");
</script>
<script type="text/javascript">
function exportHandler(chartID)
{
var n = document.getElementById('fcExportDiv');
n.innerHTML = " "; 
var chart = getChartFromId(chartID);  

if (chart.hasRendered()==true){
chart.exportChart();
}else{
alert("Please wait for the chart to finish rendering before you can invoke exporting");
}
}
</script>
<div id="fcExportDiv" align="center"> </div>

In my HTML button I called the JS function as :

onclick

="exportHandler('14DaysEventTotal');"

I configured XML for client-side export as :

xmlData.Append("<chart......");
xmlData.Append(" exportEnabled='1' exportShowMenuItem='1' exportAtClient='1' exportHandler='fcExporter1' exportFormats='JPEG=Export as JPEG|PDF=Export as PDF|PNG=Export as PNG' exportFileName='14 days detailed for ' "); 
xmlData.Append(" exportDialogColor='e1f5ff' exportDialogBorderColor='0372ab' exportDialogFontColor='0372ab' exportDialogPBColor='0372ab' exportDialogMessage='Exporting chart'>"); 

 

Thanking you,

Maksuda...

Share this post


Link to post
Share on other sites
Guest Madhumita

Hi,

Could you please try once passing the format while calling chart.exportChart()?

e.g.

chart.exportChart({exportFormat:'PNG'});

or

chart.exportChart({exportFormat:'JPG'});

or

chart.exportChart({exportFormat:'PDF'});

Share this post


Link to post
Share on other sites

Thanks Madhumita for the reply.

Yes I tried with no luck.

Still getting the same problem.........

Pls any idea .........

Thanking You,

Maksuda

Share this post


Link to post
Share on other sites

Actually for this case if I use

chart

.exportChart({exportFormat:'JPG}); ........

it doesn't work. It gives me .png extention to save image. Only

chart

.exportChart({exportFormat:'PDF'});

 is working. How can I make .jpg format working , pls........

Thanking You,

Maksuda

Share this post


Link to post
Share on other sites
Guest Rajroop

Hi,

 

 

 

You are using:

 

 

 

chart.exportChart({exportFormat:'JPG});

 

 

 

You should be using:

 

 

 

chart.exportChart({exportFormat:'JPG'});

 

 

 

Could you please check whether this might be causing the issue?

 

 

 

Looking forward to your feedback on this. :)

Share this post


Link to post
Share on other sites

Thanks Rajroop,

Actually I tried

chart.exportChart({exportFormat:'JPG'});

It was my typing mistake before when I post it on the forum.

It's not working...........

Any other suggesion pls......

Thanking You,

Maksuda

Share this post


Link to post
Share on other sites

well....

 

 

 

my bad! (eyes at times tend to ignore little details :) )

 

 

 

sorry for the inconvenience caused!

 

 

 

please use:

 

exportFormats='JPG=Export as JPEG|PDF=Export as PDF|PNG=Export as PNG'

 

 

 

instead of

 

 

 

exportFormats='JPEG=Export as JPEG|PDF=Export as PDF|PNG=Export as PNG'

 

 

 

The required format name is 'JPG'.

Share this post


Link to post
Share on other sites

Hi

 

 

 

I just started using fusion charts. I am using a pie2d chart but when I right click it i dont see any export or save as options. A snippet from my code:

 

 

 

StringBuilder xmlData = new StringBuilder();

 

 

 

//Start creating XML

 

xmlData.AppendFormat("");

 

 

 

//query the db

 

SqlDataManager sqlDM = new SqlDataManager();

 

SqlConnection conObj = sqlDM.createConnection();

 

SqlDataReader dataReader = null;

 

SqlCommand command = new SqlCommand("BLevel1", conObj);

 

command.CommandType = CommandType.StoredProcedure;

 

dataReader = command.ExecuteReader();

 

 

 

//loop through result set

 

while (dataReader.Read())

 

{

 

//build the xml

 

xmlData.AppendFormat("", dataReader["group_name"].ToString(), dataReader["asset_value"].ToString(), HttpUtility.UrlDecode("/BusinessLevelTwo.aspx?group_name=" + dataReader["group_name"].ToString()));

 

}

 

 

 

//finish the xml

 

xmlData.Append("");

 

 

 

//render the chart

 

return FusionCharts.RenderChart("Charts/Pie2D.swf", "fcExporter1", xmlData.ToString(), "BLevel1", "800", "500", true, true);

 

 

 

============================

 

 

 

FusionCharts Export Handler Component

 

 

//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', '../Charts/FCExporter.swf');

 

 

 

 

 

//Render the exporter SWF in our DIV fcexpDiv

 

myExportComponent.Render("fcexpDiv");

 

 

 

 

=================

 

 

 

Please help!

 

 

 

Thank you!

Share this post


Link to post
Share on other sites

Hello Pawan,

Please check the version of FusionCharts you are using. The export functionality is applicable for all the charts of FusionCharts latest version(version 3.1.1).

To check the version of the chart, please drag and drop the file in IE and append ?debugMode=1 to the adddress bar.

The debugMode will show the version of the chart.

To upgrade:

All you have to do is go to http://www.fusioncharts.com/puc/ and log-in with the Login name and Password provided by us to you / your company while selling the license.

Hope this helps. :)

Srividya

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