Jump to content
Software FX Community

Access Chart From Javascript


kalyan_nani

Recommended Posts

 Hi,

I have a chart  with 6 series and six checkboxes for each series.

whenever user checks/unchecks the checkboxes the relevent series should hide/unhide.

I want to achieve this one using javascript.

i am using chartfx for VS2005. 

I am rendering the chart in "AUTO" mode.

I tried  getting the chart inside javascript function  using getElementById. But i am getting an error "object doesn't support".

I am using the following code  the get the chart inside javascript function.

var ch = document.getElemnetById('ChartCustom');
ch.Series.Item(0).Visible = false; 

can you please provide a piece of code, how to access chartfx object inside javascript. 

Thanks in Advance

kalyan.P 

Link to comment
Share on other sites

A few observations:

1) Auto will generate either a .NET control or an image depending on the client browser's capabilities. The code in your script will only work for .NET control. To work with the image you will need to make some AJAX calls. See the following KB article for details:

Q7651001. Chart FX for VS 2005 and AJAXURL: http://support.softwarefx.com/ShowArticleSep.aspx?Type=KB&Product=CfxNet70&Source=http://support.softwarefx.com/kb/765/1/001.htm?_r=1

2) If the UseClientLoader property is set to true, the control in your page is a wrapper control. To get to the actual chart you need to get the Cart property from this control. For example:

var ch = document.getElemnetById('ChartCustom'); 

ch.Chart.Series.Item(0).Visible = false;

3) The client box needs to be running Chart FX in full trust mode in order for JavaScript to be able to access the control's API. Go to the .NET Framework Configuration tool in the Control Panel (Administrative tools) and make sure this is the case. For more on Trust Settings:

Q6141001. Security settings required by the .NET client controlURL: http://support.softwarefx.com/ShowArticleSep.aspx?Type=KB&Product=CfxNet62&Source=http://support.softwarefx.com/kb/614/1/001.htm?_r=1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...