|
Use this to experiment with the three attributes that control the animation:
- Animation: types
- Delay: seconds, before anything happens
- Cascade: seconds. The difference between when the left and right items start to animate
Try:
- Red [drop, delay:0, cascade:1] with Blue [drop, 0.5, cascade:1]
- Red [drop, delay:0.5, cascade:2.5] (3 seconds until finished) with Blue [drop, delay:0, cascade:1]
- Red [drop, delay:0.2, cascade:0] with Blue [drop, delay:0, cascade:0]
"The blue bar" is a pub near my house. It just struck me as amusing.
Documentation: bar glass,
inherits from bar_base,
on-show animation properties.
The interesting actionscript: charts/series/bars/base.as
Note how we foward the $_POST variables from this page along to the
chart .php page as $_GET variables in the URL. Don't
forget to urlencode your URL!!
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",
"550", "200", "9.0.0", "expressInstall.swf",
{"data-file":"gallery/bar-chart-on-show.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/bar-chart-on-show.php
<?php
include '../php-ofc-library/open-flash-chart.php';
$animation_1= isset($_GET['animation_1'])?$_GET['animation_1']:'pop'; $delay_1 = isset($_GET['delay_1'])?$_GET['delay_1']:0.5; $cascade_1 = isset($_GET['cascade_1'])?$_GET['cascade_1']:1; $animation_2= isset($_GET['animation_2'])?$_GET['animation_2']:'fade-in'; $delay_2 = isset($_GET['delay_2'])?$_GET['delay_2']:1; $cascade_2 = isset($_GET['cascade_2'])?$_GET['cascade_2']:1;
$title = new title( date("D M d Y") );
$bar = new bar_glass(); $bar->set_values( array(3,4,5,6,5,7,3,4) ); $bar->set_colour('#ff0000'); $bar->set_on_show(new bar_on_show($animation_1, $cascade_1, $delay_1));
$bar2 = new bar_glass(); $bar2->set_values( array(5,6,5,7,3,4,3,5) ); $bar2->set_on_show(new bar_on_show($animation_2, $cascade_2, $delay_2));
$chart = new open_flash_chart(); $chart->set_title( $title ); $chart->add_element( $bar ); $chart->add_element( $bar2 );
echo $chart->toString();
|
Adverts:
|