CalBroon Report post Posted December 8, 2017 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
Prerana Report post Posted December 11, 2017 Hello, Thanks for the query. Please refer this doc, it will guide you how to create JSON data for the linked chart where data is getting fetched from the database. Share this post Link to post Share on other sites
CalBroon Report post Posted December 11, 2017 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
Prerana Report post Posted December 11, 2017 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
CalBroon Report post Posted December 12, 2017 Hi Prerana, I've tried using this technique but it keeps coming back with "data": null Share this post Link to post Share on other sites
Prerana Report post Posted December 12, 2017 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