Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how would you show the progress bar greater than 100%

i want to use the jquery ui progress bar to show pct of daily total. In my case, you can actually go over the total allocated. (as i am showing pct complete of a certain distance, and you could actually go above the required distance. Does this tool support having a value of greater than 100% or are there any other gui tools to do this sort of thing?

like image 818
leora Avatar asked May 01 '10 12:05

leora


People also ask

How do I show percentage in progress bar?

You can display the percentage value in the ProgressBarAdv by using the TextStyle property.

What is used to set the maximum value of the progress bar?

The maximum value of progress bar can be set by using max property value. Property Values: level: It returns the list of progress bar. max: It is used to set or return the progress bar value of max attribute.

What are the different types of progress bars?

There are 2 types of progress bars: determinate and indeterminate. The former is used when the amount of information that needs to be loaded is detectable. The latter is used when the system is unsure how much needs to be loaded or how long it will take.


4 Answers

You might be better off positioning two progress bars side by side, colour the first one green and the second one red, and have the left progress bar 0-100% and the red one 100-whatever %

You'll get a nice effect then.

like image 174
NibblyPig Avatar answered Sep 30 '22 16:09

NibblyPig


Depending on the number involved, what about changing the scale to not be linear, and making it for example, logarithmic? You then end up with a bar that moves at different speeds depending on the size of the value... If you define whatever is 100% as 2/3rds of the bar you can see an overrun, but still be within the confines of the progress bar. If you exceed the dimensions of the progress bar, then it makes the UI difficult to design and maintain...

like image 23
JohnnyJP Avatar answered Sep 30 '22 16:09

JohnnyJP


Personally, I would just roll my own... this one is entirely CSS based and I am only using the jQuery UI slider for the demo.

HTML (Note: classes added to match jquery ui classes, but there is no ui-progressbar-text class, that I know of).

<div id="progressbar" class="ui-progressbar ui-widget ui-widget-content ui-corner-all">
 <div class="ui-progressbar-value ui-widget-header ui-corner-left">
  <span class="ui-progressbar-text">10%</span>
 </div>
</div>

CSS

.ui-progressbar {
 height: 20px;
 width: 50%;
 border: silver 4px solid;
 margin: 0;
 padding: 0;
}
.ui-progressbar-value {
 height: 20px;
 margin: 0;
 padding: 0;
 text-align: right;
 background: #080;
 width: 10%;
}
.ui-progressbar-text {
 position: relative;
 top: -3px;
 left: 0;
 padding: 0 5px;
 font-size: 14px;
 font-weight: bold;
 color: #000;
}
like image 24
Mottie Avatar answered Sep 30 '22 16:09

Mottie


I haven't tested this, but the bar itself has its own class, ui-progressbar-value. So if you put the progress bar into a div myDiv you could probably set the width manually like this:

$('#myDiv .ui-progressbar-value').width('120%')

or if you wanted to animate it:

$('#myDiv .ui-progressbar-value').animate({width:'120%'}, 'fast')

In the example here: http://jqueryui.com/demos/progressbar/#theming, the width is at 37%, so I think that would work.

like image 22
colinmarc Avatar answered Sep 30 '22 18:09

colinmarc