Nevron .NET Vision

In This Topic
    Injecting Custom Client Side Script
    In This Topic

    Overview

    Up to this point we used the image maps generated by the component which contained script that was automatically generated and cannot be modified. This includes the script generated by the component for tooltips, postback events, browser redirection and cursor change.

    In real world applications however these interactivity features may not be sufficient because there is no ability to integrate the client side script of the image map with the rest of the page and thus to achive higher levels of interactivity. In cases when you need this you must inject custom client side script in the generated image map.

    This is achived with the help of the the CustomMapAreaAttribute property of the NInteractivityStyle object attached to every chart element.

    Examining a Sample Script

    To better understand script injection lets take a look at a simple image map generated by Nevron Chart for .NET:

    [HTML]
    <script LANGUAGE="JScript"> function RedirectBrowser_c91a8ee998ae4a2692b29bc8e26d5852_0() { window.navigate("CarSales.aspx ") } function RedirectBrowser_c91a8ee998ae4a2692b29bc8e26d5852_1() { window.navigate("TrainSales.aspx ") } </script> <MAP NAME="MAP_NChart_aa81608a-0395-435d-84ea-90038b540525"> <AREA SHAPE="poly" COORDS="some poly coordinates" onclick= RedirectBrowser_c91a8ee998ae4a2692b29bc8e26d5852_0() title="Click here to jump to Cars sales page"> <AREA SHAPE="poly" COORDS="some poly coordinates" onclick= RedirectBrowser_c91a8ee998ae4a2692b29bc8e26d5852_1() title="Click here to jump to Trains sales page"> <AREA SHAPE="poly" COORDS="" onmousemove=E0MM()>

     

    As you can see the interactivity is achived by setting the onclick and title attributes applied on each area tag. The onclick attribute actually redirects to a function performing the onclick task. When the CustomMapAreaAttribute property is not an empty string the component does not generate these default attributes and replaces them with the script you specified from the property.