Can you do this with JScharts?

Posted by Nikolia 
Can you do this with JScharts?
May 31, 2009 05:39AM
Hi guys, I'm looking all over the net for an application which is fairly easy to use. My knowledge of php & myqsl is fairly minimal but what I would like to do is this. I would like to have a website using JScharts (if possible) and a line graph which will have form data the form data will say "Monday" "Tuesday" "Wednesday" etc and then the variable you will be able to edit is the number so 5 for monday 2 for tuesday 0 for wednesday as an example but I want the users to be able to input the data fields on a website rather then me having script files and in those script files having the stored data which will remain static. If anyone can lead me to any tutorials on php/mysql which will help me to do this. This would be very much appreciated or if anyone could link me to someone whos already done this and has the files for download that would also be very much appreciated. Here is a simple example of what I'm talking about. The graph isnt so cool but it does the job that I'm talking about - [www.hscripts.com] and I havent seen any other graph tools out there which can do the same (yet)
Re: Can you do this with JScharts?
June 17, 2009 05:34AM
function msfBarChart($nameTitle,$XaxisName,$YaxisName,$arrayBarNameAndValue)
{
echo '<div id="chart_container">Loading chart...</div>';
echo '<script type="text/javascript">';
echo " var myChart = new JSChart('chart_container', 'bar', '', '');";


$aBNAV = $arrayBarNameAndValue;
$numBar = count($aBNAV)/2;

//echo "myChart.setDataArray([['x1', 1],['x2', 2],['x3', 3]]);";
echo 'myChart.setDataArray([';
for($iBar=0;$iBar<$numBar;$iBar++)
{
echo '["'.$aBNAV[2*$iBar].'",'.$aBNAV[2*$iBar+1].']';
if($iBar<$numBar-1) echo ',';
}
echo ']);';

//echo "myChart.colorize(['#D3D3D3','#D3D3D3','#D3D3D3']); ";
echo 'myChart.colorize([';
for($iBar=0;$iBar<$numBar;$iBar++)
{
echo "'#D3D3D3'";
if($iBar<$numBar-1) echo ',';
}
echo ']);';

echo 'myChart.setTitle("'.$nameTitle.'"winking smiley;';

echo 'myChart.setTitleColor("#000000"winking smiley;';
echo 'myChart.setTitleFontSize(12.5);';

echo 'myChart.setAxisNamehot smiley"'.$XaxisName.'"winking smiley;';
echo 'myChart.setAxisNameY("'.$YaxisName.'"winking smiley;';

echo 'myChart.setAxisNameColor("#000000"winking smiley;';
echo 'myChart.setAxisValuesColor("#000000"winking smiley;';

echo 'myChart.setBarValuesColor("#000000"winking smiley;';
echo 'myChart.setBarBorderColor("#000000"winking smiley;';

echo 'myChart.draw();';
echo '</script>';
echo 'Powered by www.jscharts.com. <br>';
}
Sorry, you do not have permission to post/reply in this forum.