Prashant Musale

Get DrillDown chart linked data from Ajax

Recommended Posts

Following is the one way to create linked chart in which we provide linked chart data in Json.

{
    "chart": {
        "caption": "Top 3 Juice Flavors",
        "subcaption": "Last year",
        "xaxisName": "Flavor",
        "yaxisName": "Amount (In USD)",
        "numberPrefix": "$",
        "theme": "fint",
        "rotateValues": "0"
    },
    "data": [
        {
            "label": "Apple",
            "value": "810000",
            "link": "newchart-xml-apple"
        },
        {
            "label": "Cranberry",
            "value": "620000",
            "link": "newchart-xml-cranberry"
        },
        {
            "label": "Grapes",
            "value": "350000",
            "link": "newchart-xml-grapes"
        }
    ],
    "linkeddata": [
        {
            "id": "apple",
            "linkedchart": {}
        },
        {
            "id": "cranberry",
            "linkedchart": {}
        },
        {i
            "id": "grapes",
            "linkedchart": {}
        }
    ]
}

I want to pull linked chart data from Ajax whenever linked item is clicked. I tried using ondataplotclick event. From there i am able to pull out chart data from Ajax but i need to rerender same chart and i am not able to get back button.

What i am trying to achieve is following thing. I will provide JSON in following format and on one of the callback i will get the data from Ajax on link basis and i will display ajax data.

{
    "chart": {
        "caption": "Top 3 Juice Flavors",
        "subcaption": "Last year",
        "xaxisName": "Flavor",
        "yaxisName": "Amount (In USD)",
        "numberPrefix": "$",
        "theme": "fint",
        "rotateValues": "0"
    },
    "data": [
        {
            "label": "Apple",
            "value": "810000",
            "link": "ChartID001",


        },
        {
            "label": "Cranberry",
            "value": "620000",
            "link": "ChartID002"
        },
        {
            "label": "Grapes",
            "value": "350000",
            "link": "ChartID003"
        }
    ],
    
}

Is it possible by any events?

 

Share this post


Link to post
Share on other sites

Hi,

Please check your implementation once.

According to your query, you are doing the AJAX call for fetching data for child chart and please check whether you are calling setJSONData FusionCharts API method for appending the linked chart JSON/XML structure with parent chart JSON/XML structure or not.

Yes, you could fetch the child chart JSON/XML structure through AJAX call within dataPlotClick FusionCharts API event but according to your requirement, you need to append the fetched JSON/XML structure for child chart with the parent JSON/XML structure for rendering child chart anyway.

Please note FusionCharts provide beforeDrilldown , beforeLinkedItemOpen API events which may be included according to your requirements.

Please visit http://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events.html#event-beforeDrillDown for further reference regarding FusionCharts beforeDrillDown API event,

Same way also you could visit http://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-events.html#event-beforeLinkedItemOpen regarding beforeLinkedItemOpen FusionCharts API event.

Regarding setJSONData FusionCharts API method please visit http://www.fusioncharts.com/dev/api/fusioncharts/fusioncharts-methods.html#setJSONData

Hope this would help.

 

 

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