On 04.07.2008 10:07, Sameera Gayan wrote:
> Robert Klemme wrote:
>> On 04.07.2008 07:03, Sameera Gayan wrote:
>>> any reply will greatly appriciated...
>> Can you be more specific about your problem?  What kind of user input do
>> you expect?  How do you want it to be translated into a Hash?  etc.

> In 'gruff' it gets x-axis labels as a hash
> Ex : g.labels = { 0 => 'Mon', 2 => 'Wed', 4 => 'Fri', 6 => 'Sun' }
> 
> So i want to dynamically create this hash map. Inside a loop. (so i can 
> loop the dates and create the x-axis depending on the users date range)
> 
> ultimate hash format should be { 0 => 'Mon', 2 => 'Wed', 4 => 'Fri', 6 
> => 'Sun'}
> 
> so that i can use it as
> 
> g.labels = hash_lables
> 
> hope i make myself clear. thankx for any reply ..

Um, this is pretty basic stuff.  Did you actually use Hashes before? 
You will need this to get your key value pairs defined:

http://www.ruby-doc.org/core/classes/Hash.html#M000161

Cheers

	robert