Sign in to follow this  
hienduong

Set Chart Attribute

Recommended Posts

Dear, I have some questions:

1.

 

How can I set some attribute like: legendIconScale; showTooltip; showBorder; bgColor; showAboutMenuItem; aboutMenuItemLabel; showAboutMenuItem; aboutMenuItemLink. I look into the documents, however, I cannot find the guide for set chart attribute in java script.

 

I tried some code (below), however it does not work

 

<script type="text/javascript">

var myChart1 = new FusionCharts( "Charts/Line.swf","myChart1", "100%", '100%', "0", "1" );

myChart1.setXMLUrl("DataX.xml");

var chartReference = FusionCharts("myChart1");

chartReference.setChartAttribute("showTooltip",0);

myChart1.render("chartContainer1");

</script>

 

2. How can I configure some attributes to satisfy the requirerment in the image attached below?

post-22501-0-97743700-1321506126_thumb.jpg

post-22501-0-49325300-1321506136_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

How can I set some attribute like: legendIconScale; showTooltip; showBorder; bgColor; showAboutMenuItem; aboutMenuItemLabel; showAboutMenuItem; aboutMenuItemLink

 

You would need to use setChartAttribute() function to set a chart attribute. All you need to do is pass the name of the attribute and its new value to this function. This function is available in all the instances of FusionCharts JavaScript class. If you wish to change more than one chart attributes at one go, you can pass multiple attributes and their respective values as an Object. Each property name of the Object will take the name of the attribute. Value of each property will take the new value of the attribute.

 

For more details and working samples, please visit: http://www.fusioncha...Properties.html

 

For Image 1:

 

Please find a sample zip file attatched for your reference.

 

For image 2:

 

Please try the same by setting <lineColor> attribute inside the <chart> element.

 

Hope this helps.

MSColumn2D.zip

Share this post


Link to post
Share on other sites

Dear Angshu,

 

1. I just follow your example you provide at

http://www.fusioncharts.com/docs/?JavaScript/JS_ChangeChartProperties.html

, however, it does not work. I upload my code (in hienduong_Line.rar) and could you please have a look at this? And if you can, please modify the code to make it work?

 

2. I also attach my test page (hienduong_asksupport.zip)

For the dashboard.php page, as you can see in the attached images:

- In IE9, charts appear as it should.

- In Firefox: the charts do not display, I do not know why?

- In Google Chorme. the charts small.

2a, Please explain my why do the charts behave differently in different browsers like that?

 

2b, Moreover, I do not have any ideas why the charts always appear the same even though I change the width and height of the div tag container? Which parts I do incorrect?

 

Finally, I purchased the license month ago and subcription for 1 year. If this place for technical help, please help me to figure out what problems with page?

hienduong_Line.zip

hienduong_asksupport.zip

post-22501-0-96937400-1321607836_thumb.jpg

post-22501-0-30262600-1321607848_thumb.jpg

post-22501-0-12591500-1321607859_thumb.jpg

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Thanks for your response.

 

1. Please find the zip file attached for your reference.

 

You can check the live sample from : http://www.fusioncha...hart_Theme.html

 

2. When you set percent size to a chart, it tries to get the width/height of its parent container. It seems that the container where you are rendering the chart is not set with a proper height when the chart is rendered into it.

 

For example, if you have a container <div id="chartContainer"> and this DIV is not set with an absolute or relative height, the DIV's height will be zero. When a chart is rendered in this DIV with 100% height, the chart would try to derive the height of the parent DIV which is zero. The chart would render zero pixel as height. Please try once setting absolute height to the chart or the constrainer element and check.

 

An example is given below:

 

<div id="chartContainer" style="width:100%; height:800px;">FusionCharts will load here!</div>
<script type="text/javascript">
   var chart = new FusionCharts("Column2D.swf", "ChartId", "100%", "100%", "0", "1"); 
   chart.setXMLUrl("Data.xml");    
   chart.render("chartdiv"); 		
</script>

 

More details at : http://www.fusioncha...centResize.html

 

You can also drop mail to: support@ fusioncharts.com for any kind of technical help required . Please do mention your orderID along with your mail.

 

Hope this helps.

SetAttribute.zip

Share this post


Link to post
Share on other sites

Dear Angshu,

 

As the support department requires me to put the problem charts online, here it is:

http://giadinhcanhcu...t/dashboard.php

 

The last mail I sent to support deparment 3 days ago but I do not receive any feedback from now. Could you please look at my problem: why the charts can appear in IE9, Chrome and Safari, but cannot display in Firefox?

Edited by hienduong

Share this post


Link to post
Share on other sites

Dear Angshu,

 

As the support department requires me to put the problem charts online, here it is:

http://giadinhcanhcu...t/dashboard.php

 

The last mail I sent to support deparment 3 days ago but I do not receive any feedback from now. Could you please look at my problem: why the charts can appear in IE9, Chrome and Safari, but cannot display in Firefox?

 

Thanks for great support! It works perfectly now

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