Sign in to follow this  
codingMadMan11

X Axis Labels as Links using JSON

Recommended Posts

Hello,

I am trying to have each data label on the x-axis be a link that links to another page.

Example: data labels are months, so the label 'Jan' should be a clickable link that goes to a new page.

 

Currently I am trying to do something in JSON like this:

 styles: {
            definition: [
              {
                name: "labelLinks",
                isHTML:"1",
                type: "font",
                font: "Arial",
                size: "24",
                color: "666666",
                link: "www.google.com"  // CAN I DO THIS????
              }
 
            ],
            application: [
              {
                toobject: "DataLabels",
                styles: "labelLinks"
              }
            ]
          }
 
I have read you can add an anchor tag in XML to make it a link but how would I do this using JSON?
Thank You :)

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

Providing link or making the x-axis label as a hot-spot is currently not possible.  :(
 
You can only define simple links for data plots or you can make the entire chart as a hot-spot.

Share this post


Link to post
Share on other sites

Hi,

 

Apologies for delay.

 

The support for HTML tags like font/anchor tags defined within labels/trendline/ vline labels was not feature supported but was a workaround provided which used to work with previous versions of FusionCharts. Due to some security constraints, the support has been dropped and thus, doesnot work with the current version anymore.

 

Hence, you will not be able to specify x-axis label as a link.  But you can have links specified on data plots (eg. column,bar etc) that link to another page like you intend to achieve. 

 

Eg.  { "label" : "week1", "value" : "196","link" : "www.google.com" }

 

As specified above, link can be provided to the data plot instead of x-axis label. 

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

As already said, the current version of FusionCharts v3.3.1 SR2 does not allow you to define links on x-axis labels.This is irrespective of whether you are using XML or JSON data format, which means that the workaround that you are talking about does not work anymore using XML as well.

 

I have still translated the XML data that you are talking about in the forum link that you have referred above, to JSON format and attached here. This will work only if you are using very old version of FusionCharts.

 

Hope this helps.

Data.zip

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
Sign in to follow this