Flot is a JavaScript plotting library for jQuery. While Dupal Flot is a module that provides an API to render "flots" in Drupal.
This is an example of how to plot a sinusoidal curve using Drupal Flot:
$j=0;
$d=array();
for($i=0; $i < M_PI * 6; $i+=0.25) {
        $x=$i;
        $y=cos($i);
        $d[$j]=array($x,$y);
        $j++;
}
$fd=new flotData($d);
$fd->label=t('cos(x)');
$options = new flotStyle();
$options->series->points->show=TRUE;
$options->series->lines->show=TRUE;
$variables = array(
                'data'=>array($fd),
                'element'=>array('style'=> "width:100%;height:400px"),
                'zoom'=>TRUE,
                'legend'=>TRUE,
                'options'=>$options
                );
print theme('flot_graph', $variables);
I've included this code in a custom module function. Then I execute the function in the node body using the php filtering.
Tags: