gameon
Posts: 10
|
Posted: 09/25/2013, 2:13 PM |
|
having trouble passing variable array from CCS to jqPlot (via jquery). Using jqPlot as we need a log line chart. Can get jqPlot to work if variable is not used. in the we page Before Show event use this code:
$db = new clsDBdbname();
$db->query("SELECT field1,field2 FROM table");
$var1 = array();
while ($db->next_record())
{
$a = array();
$a["field1"] = $db->f("field1");
$a["field2"] = $db->f("field2");
$var1[] = $a;
}
And this code directly in the HTML file:
<script class="code" type="text/javascript">
$(document).ready(function(){
var plot1 =$.jqplot('chart1', [$var1]);
});
</script>
If I replace $var1 with [number1, number 2] it will plot. Thoughts?
|
|
|
|