setHyperlink(col, hyperlink)
Adds hyperlinks to a chart dataset. Use setParameterField to specify values to pass as parameters in the link and setTargetFrame to specify the link’s target frame. See the example below.
Parameter
- col
-
dataset index, first dataset is
1 - hyperlink
-
String, Array, or inetsoft.report.Hyperlink. For Array syntax:
-
The first argument is the URL or Dashboard name
-
The second argument is an optional parameter array
-
The third argument is
REPORT_LINK,WEB_LINK(default), orMESSAGE_LINKto transmit a message in the hyperlink -
The last argument is the target frame
-
Example 1
var link = new inetsoft.report.Hyperlink("www.google.com", inetsoft.report.Hyperlink.WEB_LINK);
link.setParameterField("test", "Sales");
link.setTargetFrame("_blank");
setHyperlink(1, link);
Alternatively, you can pass all of this information within a single array as the second argument to the function. See the example below. The Boolean item in the array indicates whether the hyperlink targets a Dashboard (true) or a website (false).
Example 2
setHyperlink(1, ["dashboard1", [["param1", "value1"], ["param2", "value2"],...]], true, "_blank")
|
Either syntax below can be used in component script:
For onInit/onRefresh scripts, and for component and property scripts on other components, the second (qualified) form is required. |