Using the Chart widget

The TweetMeme API allows for you to access a Google chart displaying the number of the tweets over in the last 24 hours.

image

The Code

To display the chart, simply enter this Javascript on your page where you would like the chart to be displayed.

<script type="text/javascript" src="http://tweetmeme.com/i/scripts/chart.js"></script>

This will display the default chart with the URL being the current location of the webpage.

Options

Setting the URL

You can change or set the URL for which you want to display the chart for using this code. Replace http://www.example.com with the URL of your page.

<script type="text/javascript">    
tweetmeme_chart_url = 'http://www.example.com';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/chart.js"></script>

Chart Size

You can set the size of the chart using the tweetmeme_chart_chs parameter. The value is in the format “<width>x<height>“, being measured in pixels.

<script type="text/javascript">   
tweetmeme_chart_chs = '100x200';
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/chart.js"></script>

Note: The tweetmeme_chart_chs is smaller than the iframe by 30 pixels. For example if you set the height of the chart to be 500 pixels, the height of the iframe would be 530 pixels.

Chart Colour

You can set the colour of the line of the chart, with the tweetmeme_chart_chco parameter. Its value should be a hexidecimal colour string, without the leading #.

<script type="text/javascript">   
tweetmeme_chart_chco = 'FF0000'; // red
</script>
<script type="text/javascript" src="http://tweetmeme.com/i/scripts/chart.js"></script>

Notes

There are no limits to the number of times this widget appears on a page.

http://help.tweetmeme.com/2009/07/15/feed-buttons/
1 Star2 Stars3 Stars4 Stars5 Stars (19 votes, average: 4.16 out of 5)