Elements - Tags Menu - Tags Example
Documentation: tag,
tags,
ofc_arrow.
This goes into the <head> of the page:
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF(
"open-flash-chart.swf", "my_chart",
"650", "200", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/tags-line.php"} );
</script>
This writes the chart into a div with id="my_chart",
right click and view source to see it in action,
[the tutorials have more details]
gallery/tags-line.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$title = new title( date("D M d Y") );
$data = array();
for( $i=0; $i<6.2; $i+=0.2 ) { $data[] = (sin($i) * 1.9) + 7; }
$s = new star($data[7]); $data[7] = $s->colour('#ff0000');
$d = new hollow_dot(); $d->size(4)->halo_size(1)->colour('#3D5C56');
$line = new line(); $line->set_default_dot_style($d); $line->set_values( $data ); $line->set_width(1); $line->set_colour('#3D5C56');
// // THE MAIN EVENT // set up the tags //
$tags = new ofc_tags(); $tags->font("Verdana", 10) ->colour("#000000") ->align_x_right(); $t = new ofc_tag(8, 4); $t->text('Look, a surprising result,'); $tags->append_tag($t);
$t = new ofc_tag(8, 3); $t->text('<a href="javascript:alert(\'hello\')">more details...</a>') ->style(false, true, true, 1.0 ) ->colour("#0000F0"); $tags->append_tag($t);
$a = new ofc_arrow(8.2, 4.8, 7.2, 8.2, '#ff00ff');
$x = new x_axis();
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $line ); $chart->add_element( $tags ); $chart->add_element( $a ); $chart->set_x_axis( $x );
echo $chart->toString();
|
|