Jump to content
We've recently updated our Privacy Statement, available here ×
  • How do I set up chart hyperlinks in HTML5 charts?


    stasp
    • Features: Charts Product: iReport Designer

    Issue Description:

    With new Highcahrts lib (often referred to as HTML5 charts) added to JR adding hyperlink to a chart is pretty much the same as to JFreeCharts (regular Charts) and Fusion charts (Charts Pro). You just open chart properties, go to Hyperlink tab and add whatever you want. However you may also notice that there is no way to add hyperlinks to HTML5 chart items (like bar sections or pie slices), at least not the way it is for other chart libs.


    Resolution:

    Creating this kind of hyperlinks in HTML5 charts is a little more tricky than in Charts or Charts Pro. Here is a summary of the process:

    1. Identify the series you want to use for your link

    2. Create a bucket property for that series (i.e. if you are using a pie chart, the category bucket may have a property called myUrl which contains your url built with the category value). This can be done in Edit Chart Properties->Chart Data->Data Axes->Categories

      bucketproperty.png.2aab7c688be0f0866a8fb1b3621a03c8.png

      Keep in mind that bucket level properties are the only place where you can create expressions to be used with your link. Otherwise you'll have to either use static values or reference a bucket level property

    3. Identify the measure to which you need to add a link (Edit Chart Properties->Chart Data->Data Axes->Measures)

    4. In the advanced properties of your measure click on "Hyperlink". This will create for you a couple of properties, just edit them by assigning the proper value (again, here you'll have to either use static values or reference a bucket level property)

      itemhyeprlink.png.761a5f7acf4db44b7b33589f8b9704d1.png

    Report execution hyperlinks:

    If you want a ReportExecution hyperlink, you'll need to rename one of the measure advanced properties (see item 4. above) to _report and enter the corresponding value, and if you need to pass parameter values you'll need to add them as measure properties too.

    reportexecutionhyperlink.png.6d305be5c02a81d88405c51368703667.png

    Attached is a sample report that has chart item ReportExecution hyperlinks. It runs on the JasperReports Server sample database.


    Ref. Case #00031817

    See also: HTML5 Charts in iReport

    bucketproperty.png.af694706f883e1e134bc9926f01dc609.png

    itemhyeprlink.png.64317d0727e2e6738e0b11f36559508c.png

    reportexecutionhyperlink.png.03a07af275f4479ed2bfb15120a66b76.png

    hclinks_0.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...