Jump to content
Software FX Community

Posting values from interactive chart with javascript


Mohamed

Recommended Posts

Hi all,

Using chartfx 6.2 for .net with Vs 2005 I am designing an interactive bar chart. while clicking on the interactive chart ,I want to open up new Asp window(belongs to other reporting application) by posting values from my form to Asp form.So please let me know how to openup new window by posting values(javascript) and also how to set the tooltip for each bar with the xaxis labels.

I would appreciate your help on this. 

Thanks

Mohamed 

 

Link to comment
Share on other sites

You need to set the Url property for the chart to a javascript function. For example:

chart.Link.Url = "javascript:MyFunction(%S,'%l')";

In this example, the function is receiving 2 parameters: the series index and the X-Axis label (assuming you have one).

You can use any "%" macro available in TipMask and PointLabelMask.

Your JavaScript will look something like this:

<

script language="javascript" type="text/javascript">

<!--

function MyFunction(seriesIndex, xAxisLabel)

{

  alert(seriesIndex.toString() + xAxisLabel);

}

// -->

</

script>

 

Link to comment
Share on other sites

 

 Chrt_LREvsWPA.Link.Url =

"BLOCKED SCRIPTMyFunction('%l')"

 JavaScript:

<script language="javascript" type="text/javascript">

function MyFunction(d)

{

alert(d);

}

</script>

I tried as you told.

My chart page URL is http://localhost/EIA(LRE)Website/LRE/LREvsWPA.aspx  (FYI - attached the chart page)

When I click on one of the interactive bar of the chart. Logically it should give javascript alert, Instead it redirects or takes you to:(unavailable page)

http://localhost/EIA(LRE)Website/LRE/BLOCKED%20SCRIPTMyFunction('D1')

you can clearly see in above url that (pls Compare and see above two URLS)

 Chrt_LREvsWPA.Link.Url = "BLOCKED SCRIPTMyFunction('%l')" 

 This  "BLOCKED SCRIPTMyFunction('%l')"  is called as a Page by  Chrt_LREvsWPA.Link.Url property .

Please let me know where I am going wrong.

 

Thanks

Mohamed

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...