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.

Also please note the child chart data source needs to be within the parent chart data source for performing the drill down operation.

Kindly check by performing the AJAX call and modify the parent chart data source with the child chart data source and check.

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