Sign in to follow this  
olslewfoot

Legend Colors Incorrect

Recommended Posts

Hi

 

 

 

As a FusionCharts newbie, I've just registered the system and am getting mostly great results with my charts.

 

The exception is that my legend color is not using the color I have "set".

 

 

 

When building the xml string for a MSCombi2Y2D chart I am setting the color and anchorBorderColor each time I set a dataset value. The colors on the resultant chart are exactly as I want them.

 

 

 

However the legend does not pick up my specified colors and uses other colors which I have been unable to control. Coincidentally, it is using the legend colors of the examples shown in the documentation. I am not specifying a pallette at all.

 

Can anyone please tell me what I'm missing?

 

 

 

John

Share this post


Link to post
Share on other sites

Hi John,

 

 

 

Welcome to FusionCharts' world of Charting! :)

 

 

 

Can you please post your xml as attachment here, as this would help me find the cause of the problem?

 

 

 

Thanks.

 

 

 

Srividya

Share this post


Link to post
Share on other sites

Hi Srividya

 

 

 

The function I am using to write the xml string is in the attached php file xml_functions.

 

 

 

Specifically the function is is G2YM_xml. I've zipped the php file for transmission.

 

 

 

Thanks for your help.

 

 

 

John

xml_functions.zip

Share this post


Link to post
Share on other sites

Hi Srividya

 

 

 

I wonder if you have had any success with this issue - I have not made any progress and still have the incorrect colors presented in the legend.

 

 

 

John

Share this post


Link to post
Share on other sites

Hi  Olslewfoot,

To customize the legend you have to set the particular legend-attribute with it's value in the chart tag of your xml.

to know the list of legend-attribute you may refer to the link http://www.fusioncharts.com/Docs/Contents/ChartSS/Combi2DDY.html  [Legend Properties]

e.g.

<chart .... legendBgColor="FFFFFF" ... >

But the legend key's color are inherited from the corresponding dataset color. so to define color for any legend key you have to set the color for the corresponding dataset.

e.g.

<dataset .... color="FF00FF" ..>

To check these in your xml you may print the returned xml[string] of your G2YM_xml() function.

If still the problem exist please send the generated xml as a zip file.

Share this post


Link to post
Share on other sites

Hi Ayan Pal

 

 

 

Originally I have done all the things you suggest, but I have am still having a problem with the correct Legend colors being picked up.

 

 

 

I would be very grateful if you could look at the attached data to see where the problem may lie.

 

 

 

In the attached zip file (legend_colors_problem.zip) is

 

1. an xml file containing a written version of my xml string.

 

2. the php function which creates the xml file (and string) - you'll see that I've just repeated the commands to write them to file as well as create an xmlstring which is plotted by FusionCharts.

 

3. An exported jpeg of an example file - showing the incorrect colors on the legend.

 

 

 

I hope you can help.

 

 

 

Regards

 

John

legend_colors_problem.zip.zip

Share this post


Link to post
Share on other sites

Hi John,

In your xml you did not set the color at dataset.

as i told previously.

please define color at dataset to define color for corrosponding legend key. other wise the default color will be shown.

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi John,

Glad that its working fine now.

Happy FusionCharting. :)

Share this post


Link to post
Share on other sites

Hi,

 

I have the same problem depicted here, I set the color in the dataset element, but when the chart is displayed, the legend colors do not match the bar colors.

I only have this bug in FF v 3.6.13, however it is working fine in IE 6.0.2900.

 

I am using the free version of FusionCharts. You will find the XML file and the chart image in the attachments.

 

Thank you in advance

legend_bug.zip

Share this post


Link to post
Share on other sites

Hi,

 

I am afraid, I am unable to replicate the issue after testing the XML. :)

 

The Legend color is same as the plot color when tested. Please check with the attached screenshot of the rendered chart for your reference.

 

Hope this helps. :)

 

post-8144-077540400 1297420250_thumb.jpg

Share this post


Link to post
Share on other sites

Hi Sanjukta,

 

Thank you for your response.

 

Currently, I am using PHP to generate the chart, by default I include the PHP file FusionCharts.php and the JavaScript file FusionCharts.js (attached in this post). I wonder if I need to update the flash object swflash.cab version in FusionCharts.php, the specified version is 8,0,0,0. I hope you could reproduce the error using this files.

 

Is there any chance of some of my Stylesheet files (.css) are causing the issue?, because I have many .css files including some being used by the JQuery library.

 

Thank you.

FusionCharts_lib.zip

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