kennethdavid

Trying to retrieve data from user editable linear gauge

Recommended Posts

Hi I use the following code to try to get the pointer value from an editable linear gauge.

The Jscript:

  <script language="javascript">

  //FC_ChartUpdated method is called when user has changed pointer value.

  function FC_ChartUpdated(DOMId){

alert("in function");

alert(DOMId);

//Check if DOMId is that of the chart we want

if (DOMId=="myChartId"){

 

  alert ("passed check");

  //Get reference to the chart

  var chartRef = getChartFromId(DOMId);

  //Get the changed value

  var pointerValue = chartRef.getData(0);

alert(pointerValue);

}

  }

</script>

Currently the DOMId I pass in is the ID of the Chart object as per:

var myChart = new FusionCharts("fusion/Charts/HLinearGauge.swf", "myChartId", "450", "120", "0", "0");

myChart.setDataURL("Data/Linear3.xml");

This is how I call the function to get the value:

<input type="button" name="test" value="test" onClick="javascript:FC_ChartUpdated(myChartId)">

2 Questions stem from this:

1. Upon clicking the button, I never get the alert "passed check" which means the DOMId isn't getting matched..... what am I doing wrong here?

2. How do I actually take the value and instead of putting it into an alert box, actually add it into the post or put variables when the form submits? is there a way to write it to the value of a hidden field?

Thanks in Advance,

Ken

Thanks,

Share this post


Link to post
Share on other sites
Guest Rajroop

Hello,

 

 

 

Welcome to the forum. :)

 

 

 

To solve your issue, we need a little more information. :ermm: What is the alert message you get when alert(DOMId); is executed after alert("in function");?

 

 

 

 

 

As for your other query, could you please look at the code samples in our download package and at our blueprint applications at :

 

http://www.fusioncharts.com/widgets/download.asp ?

 

 

 

Hope this helps.

Share this post


Link to post
Share on other sites
Guest Rajroop

Hola :),

 

 

 

Could you explain in detail what you issue specifications are?

 

 

 

Another input to my previous post on the previous issue, would be to set the registerWithJS to 1, by making the following changes in the code:

 

 

 

var myChart = new FusionCharts("fusion/Charts/HLinearGauge.swf", "myChartId", "450", "120", "0", "1");

 

 

 

I hope this helps. :hehe:

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