Gossamer Forum
Home : Products : DBMan : Customization :

Graphs

Quote Reply
Graphs
Hi guys,

I have DBman working nicely but i would like use it to change a graph/image that i have. I have a field containing a colour status, which is set by the user when they are entering their data in the form, it is a drop down menu so the colour can only be red, green or yellow. I would like to know if it is possible to pull this color status out and change the colour of the box in my graph accordingly. I hope that someone can be of help to me as i am totally stumped at this one.

Elle

Quote Reply
Re: Graphs In reply to
You should be able to do this.

What is saved to the .db file from the select list? Is it "blue," "red" or "green"? Or is it the hexidecimal numbers like you would use in an .html file.

With your graph, how would you normally set the color?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
Hi

Erm my .db file is empty!! But when i do list all on my web-site it comes up with all the forms that i have previously entered?? My graph is also not really a proper graph it is gif file, as it just shows the flow of data

Elle

Quote Reply
Re: Graphs In reply to
You have an empty .db file and you are getting records? Smile

If you were creating a regular, plain old .html file, how would you display the .gif that you are wanting to display?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
It's just included in a blank .html file as a regular image the flow of data doesn't actually change depending on the data in the DB it's just the colour of a box that changes depnding on the colour status and what box is originally clicked on to enter the DB.

Elle

Quote Reply
Re: Graphs In reply to
I don't understand what you're trying to do. Are you wanting to change the background color of a table cell? Or display a different picture? Or what? I don't understand.

Also, what does the select field definition in your .cfg file look like?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
Sorry, i'm usless at explaining things. I have a web-site that takes in all this quality data for different parts of a process i.e the construction of the boards, the building of the memory etc. Each part of the process is represented by box i.e. one for boards, one for memory etc, each box is assigned a colour status depending on how good/bad the data is but the user enters this along with their data and it's either red, yellow or green. I need to be able to take this colour status from the DB and change the colour of the box e.g. the box might have been red before the data is entered but if the new data entered has a colour status of green it need to change the previously red box to green. The box that i am talking about is just a coloured shape within my .gif file. I hope that this help to make it a bit clearer about what i am trying to do.

My select field definition looks like this

'Overall Status' => [19, 'alpha', 0, 6, 1, 'Red', ''],

# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = (
'Customer' => 'LSU,NSU',
'RPM Status' => 'Red*,Yellow,Green',
'DPM Status' => 'Red*,Yellow,Green',
'Functional Test Yield Status' => 'Red*,Yellow,Green',
'Final Inspection Yield Status' => 'Red*,Yellow,Green',
'Overall Status' => 'Red*,Yellow,Green',
'SE Approval' => 'No,Yes'
);

It's only the Overall Status field that i need to pull the colour from though the rest are just for viewers extra information

Elle


Quote Reply
Re: Graphs In reply to
In Reply To:
The box that i am talking about is just a coloured shape within my .gif file.
I don't understand. [weep, weep]

You can't display just part of a .gif, as far as I know.

If I wanted to display a green box on a regular .html file, how would I do that?



JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
At present you wouldn't be able to change the colour of the box without having to produce a totally new .gif i.e. taking the original .gif file loading it in some drawing package and changing the colour manually, then uplaoding it again onto the site. I now realise that i can't do it using a .gif file but i don't know what to use instead.

Quote Reply
Re: Graphs In reply to
Could i have three .gif files a green one, a red one and a yellow one and then just call them according to the colour status? Or would this be to confusing to implement?

Elle

Quote Reply
Re: Graphs In reply to
Oh, that would be a piece o' cake!!! Smile (JP is very happy. She can understand this!!)

You would probably need to change

'Overall Status' => 'Red*,Yellow,Green',

at least so there wasn't an * by the 'Red.'

If you did that, you could create three .gif files -- Red.gif, Yellow.gif and Green.gif.

When you want to display it, you'd just use

<img src="http://url/to/gif/director/$rec{'Overall Status'}.gif">

See? Piece o' cake!!! Smile


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
How would i create a link on the home page so that i could put in the link you mention before. e.g. like view etc but it would link to the .gif file instead. Can i just add it into the sub html_footer or do i have to add it else where aswell?

Elle

Quote Reply
Re: Graphs In reply to
Now I'm confused again.

You want to list all the records that are "green," for example?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
Sorry i seem to be good at confusing you today.Smile I would like to create a link similar to add, delete, modify etc but have it so that it brings up the .gif file for the relevant colour status of the record just added. i.e. once the user has entered their data clicked submit and are now
faced with the "Record Added" page there should be an option on the bottom of the page along with home,add,view etc that allows you to see the .gif file for that record just added. So if the Overall status for the record added is Red it should bring up red.gif
I hope that i have not managed to confuse you again

Elle

Quote Reply
Re: Graphs In reply to
Okay.

print qq!| <A HREF="http://url/to/gif/directory/$in{'Overall Status'}.gif"">View Graphic</A> ! if ($per_view);

Is there a reason you want this to be a separate link and not just display the .gif within the record display?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Graphs In reply to
Ok i've had a think about this and a wee chat with my boss and i think that i am going to investigate using dynamic images. I've found a nice Perl version of gd graphics library. So i am going to see if this will do what i originally wanted to do. I'll let you know how i'm getting on as i may still be back to change it all over again Smile. So thanks for all your help so far

Elle