WillM Report post Posted July 11, 2017 Hello, I have the following column chart that is designed to show the four most popular books in the last month taken out of a library. As you can see the labels of each column are $bookPos1-4. These variables are from an array that checks to see which books are the most popular. The variables will need updating every time the page is loaded. Using the following code to wire up the chart, I have no luck. If the variables are unquoted it simply reverts to the previous labels/blank. The code used is copied from the example and adapted slightly. $bookChart = new FusionCharts("column2d", "book", "100%", 150, "topFourChartBox", "json", '{ "chart":{ "caption":"Top Four Titles", "subCaption":"The most popular books in the last month.", "numberPrefix":"", "theme":"carbon" }, "data":[ { "label":"$bookPos1", "value":"100" }, { "label":"$bookPos2", "value":"90" }, { "label":"$bookPos3", "value":"50" }, { "label":"$bookPos4", "value":"20" } ] }'); // Render the chart $bookChart->render(); Thanks for the help! Share this post Link to post Share on other sites
WillM Report post Posted July 12, 2017 SOLVED $bookChart = new FusionCharts("column2d", "book", "100%", 150, "topFourChartBox", "json", '{ "chart":{ "caption":"Top Four Titles", "subCaption":"The most popular books in the last month.", "numberPrefix":"", "theme":"carbon" }, "data":[ { "label":"'.$bookPos1.'", "value":"100" }, { "label":"'.$bookPos2.'", "value":"90" }, { "label":"'.$bookPos3.'", "value":"50" }, { "label":"'.$bookPos4.'", "value":"20" } ] }'); // Render the chart $bookChart->render(); Broke the string and used the '.' operate to connect in my variables. Share this post Link to post Share on other sites
Ayan Bhadury Report post Posted July 13, 2017 Good to know, that the problem was solved. Feel free to revert back if you are facing any problem. Share this post Link to post Share on other sites