memo.xight.org

日々のメモ

chalow XML/SWF Charts Plug-in

Summary

  chalow から XML/SWF Charts[2005-03-10-6] を呼び出す Plug-in.

Plug-in

### XML/SWF Charts Plug-in
# usage: {{chart('XML File','width','height','bgcolor')}}
sub chart {
	my ($xml,$width,$height,$bgcolor) = @_;
	my $charts = q(http://example.com/path/to/charts.swf);
	
	$ret = << "__CHARTHTML__"
<object
  classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
  width="$width"
  height="$height"
  id="charts"
  align=""
>
<param name=movie value="$charts?xml_source=$xml">
<param name=quality value="high">
<param name=bgcolor value="$bgcolor">
<embed
  src="$charts?xml_source=$xml"
  quality="high"
  bgcolor="$bgcolor"
  width="$width"
  height="$height"
  name="charts"
  align=""
  type="application/x-shockwave-flash" 
  pluginspage="http://www.macromedia.com/go/getflashplayer"
>
</embed>
</object>
__CHARTHTML__
;
	return qq($ret);
}


Test (XML)