Change font size
It is currently Fri May 24, 2019 1:52 pm

Forum rules


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Charts on prims using google chart API
PostPosted: Sat Aug 01, 2009 8:38 am 
User avatar

Joined: Sun Jul 19, 2009 5:11 pm
Posts: 8
Google chart API ( may be used to draw charts on prims by combining it with osSetDynamicTextureURL function
Various chart types may be drawn by changing the parmeters supplied in the url.

googleometer.jpg [ 43.67 KiB | Viewed 3119 times ]

Just place the following script in a prim and tweak the values and captions to meet you requirements

//Anakin Lohner,1 Aug 2009

// This script demonstrates a method for drawing chart on a prim
// by using the google chart api:
// The script uses opensim specific functions.
// By modifying the parameters in the url different chart types may be drawn

//Function to draw google-o-meter chart as a texture on a prim
//function parameters:
// value  - value of the meter in percents
// legend - caption drawn above the value
// title    - chart Title
// width  - chaat width in pixels
// height - chart height in pixels

drawGoogleOMeter(integer value, string legend,string title,integer width,integer height)
        //compose google api url
        string url = ""
        + "?chs="+(string)width+"x"+(string)height
        + "&chd=t:"+(string)value
        + "&cht=gom"
        + "&chtt="+title
        + "&chl="+legend;     
        //create texture from url           

       drawGoogleOMeter(25,"25 %","Google-O-Meter Demo",440,220);

This script is inspired by a sample code published in the LSL Wikki.

Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of