Sign in to follow this  
Sagar Joshi

Pie chart Fill Color issue while Exporting to PDF

Recommended Posts

Hello,

 

I am using Pie chart version 3.3.1-sr2.19840

 

In that, After Pie chart is rendered,

I get HTML of svg and put it in another simple HTML page.

In that page , it does not show color inside Pie chart.. 

Note :: While checking HTML of pie chart I noticed that , there is some url for fill attribute of Path element , that showes url of http://mysite/#........
 
Both Images are attached herewith.
 
How to solve this issue?

post-31586-0-31833500-1375887561_thumb.png

post-31586-0-49888500-1375887578_thumb.png

Edited by Sagar Joshi

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please try once by using the below line of JavaScript code to get the SVG string of the chart and put in another simple HTML page?

 

Ref. Code:

FusionCharts("myChartId").ref.getSVGString(); //"myChartId" is the chart ID provided in FusionCharts constructor while creating chart object instance

Hope this helps!

Share this post


Link to post
Share on other sites

Hello,

 

Thanks for your reply.

 

I tried your solution.

Before this it was showing url for fill attribute of Path element ,like "url('http://mysite/#3052xr___98_162_150__rgba_0_142_142_0_:0-rgba_0_142_142_0_:100')"

 

After doing your way, it shows "url('#3052xr___98_162_150__rgba_0_142_142_0_:0-rgba_0_142_142_0_:100')"

 

Now let me share exact scenario.

i want html of chart for further processing which not support svg.
so i need to convert svg into base64 image

now when i convert into base64 image, and then image having blank (no color) in pie chart.
if i change fill attribute of path in svg, to specific color

e.g. <path fill="Red">

then it is working fine
to make this change, i want to remove gradient or any effects from pie chart
i tried by set below properties to 0

bgAlpha
borderAlpha
plotFillAlpha
plotBorderAlpha
use3DLighting
showPlotBorder

animation
defaultanimation

but no luck  :(
will you please help me to sort out this

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

It seems the issue could be at the conversion part of SVG to base64 image, if the generated SVG from the suggested JavaScript function "getSVGString()" renders the chart correctly in the browser.

 

As Sagar had mentioned, the issue is with <path fill="Red">, as a quick fix you could modify the SVG string accordingly, before converting to base64 image.

 

Hope this helps!

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