CalBroon

PHP While loop for linked chart data

Recommended Posts

Hi,

I need some help with the data within a linked chart, I'm trying to use a while loop to populate the data within the linked chart, I thought I had it figured out but it doesn't seem to work, any help would be appreciated. Here's the code I have for the while loop.

        array_push($arrData["linkeddata"], array(
            "id" => "2016",
            "linkedchart" => array(
            "chart" => array(
            "caption" => "Yearly spend",
            "xAxisName" => "Year",
            "yAxisName" => "Spend (In GBP)",
            "formatNumber" => "1",
            "yFormatNumber" => "1",
            "formatNumberScale" => "0",
            "decimalSeparator" => ".",
            "thousandSeparator" => ",",
            "numberPrefix" => "£",
            "rotateValues" => "0",
            "placeValuesInside" => "0",
            "rotateValues" => "1",
            "decimals" => "2",
            "valueFont" => "Arial",
            "valueFontColor" => "#000",
            "valueFontSize" => "12",
            "valueFontBold" => "0",
            "valueFontItalic" => "0",
            "theme" => "fint"),
                            "data" => array(
                                while ($Spend = $SpendData->fetch(PDO::FETCH_ASSOC)) {
                                    array(
                                    "label" => $Spend['Year'],
                                    "value" => $Spend['SpendValue']
                                ),
                                }
                            )
                        )
                                    ));

 

Share this post


Link to post
Share on other sites

But in that document, the drill down data is on another page, so when I click the bar chart to drill down, it navigates to another page.

Is there any way to have it stay on the same page, as shown in the doc example?

 

Share this post


Link to post
Share on other sites
38 minutes ago, CalBroon said:

But in that document, the drill down data is on another page, so when I click the bar chart to drill down, it navigates to another page.

Is there any way to have it stay on the same page, as shown in the doc example?

 

Please refer the sample link given below.

https://www.dropbox.com/s/g3va4j9nrjhaubd/php-mysql-multilevel-drill-down.zip?dl=0

Share this post


Link to post
Share on other sites
1 minute ago, CalBroon said:

Hi Prerana,

I've tried using this technique but it keeps coming back with "data": null

 

 

Please check the sample shared in my earlier response. That sample is working as expected.

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