Barcharts

Anyone knows how to make barcharts in Servoy??

Here’s an example I made in Filemaker (is that an ugly word in here??) :oops:

Filemaker certainly isn’t an ugly word.
Depends on what you want to achieve :wink:

I’ve attached a small example solution using HTML
to simulate your barchart.
Another way to go is using a bean.
(I’ll do another post in a short while)

I wanna maken bars for an agenda for appointments.
The bars have diffrent colors for every kind of appointment.

For example:
outdoor appointment: red
not available:yellow
indoor appointment: blue

And I want nice bars…not the html thingie you made (hope ya don’t mind). Question though…does this means…you have to open Explorer to see you appointment…or do you stay in Servoy

In Filemaker I made this with a textfont (wingdings or webdings)…it’s quite fast for Filemaker :shock: since it’s text (though it looks quite graphically)

You can also assign just a backgoundcolor to the example of Maarten instead of an image. You then resize the table fields and voila the result is there…

But, you can also use the font you suggest to do the same thing like you did in fm.

And you can use another image than the example.

In short: there are may ways to do this in Servoy :D

Hi everyone,

I created this example because there was an issue with bean storage (so I couldn’t use the JProgress Bean - which is a MUCH better solution!)…

So, here’s a little tip on creating a “fake” progress bar. I hope it inspires.

Cheers,

Bob Cusick

==================================================

Pseudo Servoy “Progress Bar”

On forms that you want a progress bar you need to create a field and a label. The field MUST be named “progress” and the label MUST be named “caption”. Set the “displayType” of the “progress” field to HTML_AREA and the dataProvider to gt_progress, set the scrollbars of this field to “never” and “never”. Set the dataprovider of “caption” to gt_progressCaption.

media requried:

blue_dot.gif (or your own single color gif)

globals required:

gi_progressMax (int);
gi_progressValue (int);
gn_progressIncrement (num);
gt_progress (text);
gt_progressCaption(text);

/****************************************
METHODS
****************************************/

/************************
Progress Bar Init

Suggested global method name: progressInit

arguments[0] = maxValue

useage: progressInit(50)

************************/

var theForm = currentcontroller.getName()

globals.gt_progressCaption = ‘’;
globals.gt_progress = ‘’;
var width = eval(‘(forms.’ + theForm + ‘.elements.progress.getWidth() - 8 ).toFixed(0)’);

eval(‘forms.’ + theForm + ‘.elements.progress.visible=true’);
eval(‘forms.’ + theForm + ‘.elements.caption.visible=true’);

if(!globals.gi_progressMax || arguments[0] == 0 || arguments[0] == null) {
globals.gi_progressMax = 100;
}
else {
globals.gi_progressMax = arguments[0];
}

globals.gn_progressIncrement = width/globals.gi_progressMax;

globals.gi_progressValue = 0;

return;

/************************
Progress Bar Increment

Suggested global method name: progressIncrement

arguments[0] = updateString

useage: progressIncrement(‘Processing ?’)

In the string you pass - include the “?” character
somewhere in there - and the routine will replace
it with the current count. For example:

progressIncrement(‘Downloading record ?..’) will
return “Downloading record 5…”

************************/

var height = 17;

var topHTML=“

var bottomHTML = “

globals.gt_progress = topHTML + “” + bottomHTML;

globals.gt_progressCaption = utils.stringReplace(arguments[0], ‘?’, Math.round(globals.gi_progressValue)+‘’);
application.updateUI();

globals.gi_progressValue += 1;

return;

/************************
Progress Bar Dispose

Suggested global method name: progressDispose

useage: progressDispose()

************************/

var theForm = currentcontroller.getName();

globals.gt_progressCaption = “Complete”;
application.sleep(500);
application.updateUI();

globals.gt_progressCaption = “”;
globals.gt_progress = ‘’;
application.updateUI();
eval(‘forms.’ + theForm + ‘.elements.progress.visible=false’);
eval(‘forms.’ + theForm + ‘.elements.caption.visible=false’);

/***************************
EXAMPLE
***************************/

var max = 100

progressInit(max);

for(var i = 1; i < max; i++)
{
progressIncrement(‘Processing ?’)
}

progressDispose();

Since I’m new at this…I’m gonna rumble a little bit with these examples