$db_config_file = $_SERVER["DOCUMENT_ROOT"] . "/configuration.php";
$sql="Select title, hits From jos_content Order By hits Desc Limit 10";
$data = rgraph_chart::getDataFromDB ($dbconfig, $sql)
$chart = new rgraph_chart ("cvs", $data[1], "Bar");
$options = new rgraph_options();
$options->set_option("title", "Most Read Articles");
... more options ...
$chart->set_options($options);
$rgraph_json = $chart->toString();
To get more information besides references shown here, have a look at my samples or visit the home of RGraph.