WillM

Members
  • Content count

    2
  • Joined

  • Last visited

About WillM

  • Rank
    Forum Newbie
  1. 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.
  2. 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!