pyrite
Members-
Content count
7 -
Joined
-
Last visited
Everything posted by pyrite
-
Hello, I'm trying to update a chart with new JSON data, and also change the chart's subcaption to reflect the new data. This code works, sort of, it changes the subcaption, then refreshes the chart with the new data and puts it back to the old subcaption. What am I doing wrong? <html> <head> <title>On-Time Delivery by Work Area</title> <script type="text/javascript" src="/configurator/js/fc/Charts/FusionCharts.js"></script> </head> <body> <div style="float: right"> <select id="selmonth" onchange="chgmonth();"> <?php $s = ''; for ($i = 1; $i <= 12; $i++) { if ($i <= date("n")) { if ($i == date("n")) { $s = ' selected="selected"'; } echo '<option value="'.$i.'"'.$s.'>'.date("F Y", mktime(0, 0, 0, $i+1, 0, date("Y"), 0)).'</option>'; } } ?> </select> </div> <p> </p> <div id="chartContainer">FusionCharts will load here!</div> <script type="text/javascript"> <!-- var myChart = new FusionCharts( "/configurator/js/fc/Charts/MSColumnLine3D.swf", "otdbyworkareaytdchart", "95%", "95%", "0", "1" ); myChart.setJSONUrl("/configurator/metrics/getotdbyworkareaytd"); myChart.render("chartContainer"); function chgmonth() { chartReference = FusionCharts("otdbyworkareaytdchart"); var action = document.getElementById('selmonth'); chartReference.setChartAttribute( "subcaption" , action.options[action.selectedIndex].text ); chartReference.setJSONUrl("/configurator/metrics/getotdbyworkareaytd/"+action.value); } // --> </script> </body> </html>
-
I solved the problem by just not using setChartAttribute, and setting the subcaption in the JSON everytime the data changes instead.
-
I don't understand what you just said, but: myChart.setJSONUrl("/configurator/metrics/getotdbyworkareaytd"); This returns the chart data in JSON format, with a subcaption set. The code above changes the JSON data, but I am trying to override the subcaption after I call setJSONUrl(). And it works for a second, but then goes back to the subcaption defined in the JSON data instead of the one set by setChartAttribute.
-
Hello, I have a table of data I'm using, and can't decide on the best way to graph/chart the data I have, so there is no real right or wrong answer, but I'd like some ideas if you don't mind. The data I have looks like this: Appreciate any ideas anyone has. Obviously the goal is to convey the data in a manner that is easy for users to understand.
-
I guess my real question is, in a stacked column chart, how to make the second dataseries start at 0, instead of where the previous dataseries left off?
-
I'm sorry, but neither of those charts represent the data very well. In the first one, the 4th column is a percentage, rendered against a Y-axis of numbers, that don't mean anything. In the 2nd chart, the stacked values do not collectively form a whole. What I would like is a stacked chart, and let's pretend we only have goal (number) and goal reached (percent of goal number). Is there a way to make the goal reached portion be stacked and visually identify how much of the goal was reached? So let's say the goal is RED and the goal reached is GREEN. If the two matched, you would just see a solid green bar that goes up to the goal. If they don't match, let's say goal was 100 and goal reached was 80, you would see a red column going up to 100 and a green column over it going up to 80. Can that be done? When I tried this, it took the two values and stacked them so I had one bar going up to 180 instead, like it's adding the value together.
-
Does anyone else have any thoughts, because I kind of think a Gant chart is too complex for this small amount of data. I was thinking about a stacked column chart, where the total goal is the column, and the stacked part is the % of goal reached, but I couldn't get the stacked chart to work like that.