Template talk:Bar box

(Redirected from Template talk:Bar box/doc)
Latest comment: 3 months ago by Rjjiii in topic Dark mode

Margins

edit

I have deployed the fix of tright to skins other than monobook now. White borders are no longer used for the margins, and true margins have been added, fixing this template for uses in skins other than Monobook. —TheDJ (talkcontribs) 20:22, 17 January 2010 (UTC)Reply

Problems with Chrome

edit

This template seems to have graphical issues with Google Chrome. It does not show bars smaller than 1% (other browsers do) and words are closer to its margins. --95.236.227.241 (talk) 12:48, 3 June 2012 (UTC)Reply

How to insert vertical gap?

edit

Sometimes the items have a inherent grouping (spring/summer/... smoker/non-smoker whatever). A small vertical space would make the structure obvious to the viewer. Bar box does not seem to support this feature (empty line(s), br token, empty items - none of these seem to work). How can it be done? --HeWhoMowedTheLawn (talk) 19:14, 21 August 2012 (UTC)Reply

is this what you want? Frietjes (talk) 21:04, 21 August 2012 (UTC)Reply
Quantity of stuff
kinds of stuff pcs.
Foobar
33,213
Barfoo
123,123
Bazbar
210,121
Barfoobaz
12,854
Some stuff displayed by quantity.

or this

Quantity of stuff
kinds of stuff pcs.
Foobar
33,213
Barfoo
123,123

Bazbar
210,121
Barfoobaz
12,854
Some stuff displayed by quantity.
Yes! Great!) Thanks. I'd likely prefer the first (to my taste height=8 seems enough for a clear separation) --HeWhoMowedTheLawn (talk) 17:59, 22 August 2012 (UTC)Reply

How to add values to the "right1" column ?

edit

Is there any way to add values to the "right1" column without using two "percent bars" like in the "election results" example ? I have tried everything I can to make it show as I want it to show (that being showing percent in the "right1" and additional info in the "right2"), but for some reason it will simply not display any information in the "right1" no matter what and where I place the data, it just defaults to the "right2" and will not add anything to the "right1"... or maybe I'm doing something wrong here :/
Also, is there a way to increase the "width" of the bars themselves, since at the moment even with 100% they are too short, I have tried adding "width=<value>" but it doesn't seem to do anything...

just random title
names percent additional info
Foobar
33% note 1
Barfoo
65% note 2
Bazbar
100% note 3
Barfoobaz
13% note 4
Some stuff displayed by quantity.
you can set the bar width using |barwidth=. Frietjes (talk) 20:32, 9 September 2015 (UTC)Reply
PYX-340, updated your example with the new |note=. Frietjes (talk) 20:47, 9 September 2015 (UTC)Reply
Thank you very much good sir ! PYX-340 (talk) 22:58, 9 September 2015 (UTC)Reply


How to use comma as decimal divider?

edit

How to use comma as decimal divider not dot? Softy (talk) 15:09, 26 November 2015 (UTC)Reply

see MOS:DECIMAL. Frietjes (talk) 17:15, 30 November 2015 (UTC)Reply

Narrow color bar mobile version wrap issue

edit

On mobile version when the color bar effective width value is small enough, the color bar appears to be twice higher. —Mykhal (talk) 17:18, 22 October 2017 (UTC)Reply

A fix: Template_talk:Bar_percent#Edit_request_2Mykhal (talk) 17:32, 22 October 2017 (UTC)Reply

Does this template accepting stacking?

edit

Like { { Graph:Chart | type=stackedrect } }, but horizontal. — Guarapiranga (talk) 08:23, 30 September 2019 (UTC)Reply

Found what I wanted, here. — Guarapiranga (talk) 02:25, 1 October 2019 (UTC)Reply
@Guarapiranga: You could also use {{bar stacked}}. Alexiscoutinho (talk) 20:41, 3 March 2020 (UTC)Reply

Consensus about paddings and alignments

edit

Every bar template has a different way of adding padding and aligning the 1st, 2nd, 4th and 5th columns. We need to reach a consensus. Which padding scheme do you prefer?

A) | 0.4+0.4em 1st-col 0.4+0.4em 2nd-col 0.4    em | BAR |     0.4em 4th-col 0.4+0.4em 5th-col 0.4+0.4em |
B) | 0.4+0.4em 1st-col 0.2+0.2em 2nd-col 0.4    em | BAR |     0.4em 4th-col 0.2+0.2em 5th-col 0.4+0.4em |
C) | 0.4    em 1st-col     0.4em 2nd-col 0.4    em | BAR |     0.4em 4th-col 0.4    em 5th-col     0.4em |
D) | 0.4+0.4em 1st-col 0.4+0.4em 2nd-col 0.8    em | BAR |     0.8em 4th-col 0.4+0.4em 5th-col 0.4+0.4em |
N) | 0.4+0.4em 1st-col 0.4+0.4em 2nd-col 0.4+0.4em | BAR | 0.4+0.4em 4th-col 0.4+0.4em 5th-col 0.4+0.4em |

Which text-align scheme do you prefer?

A) |  left  right  | BAR |  left  right  |
B) |  left   left  | BAR |  left   left  |
C) | right  right  | BAR | right  right  |
D) | center center | BAR | center center |

Alexiscoutinho (talk) 21:18, 3 March 2020 (UTC)Reply

@Alexiscountinho: Not sure what either look like – could examples be given for each option please? WT79 The Engineer (talk) 14:59, 19 April 2020 (UTC)Reply
@WT79 The Engineer:
1st-col
2nd-col
4th-col
5th-col
1st-col
2nd-col
4th-col
5th-col
1st-col
2nd-col
4th-col
5th-col
1st-col
2nd-col
4th-col
5th-col
1st-col
2nd-col
4th-col
5th-col

Looking this way, I think padding scheme N is the best because it leaves the columns symmetrical and the spaces between info constant! I wonder if its third <td> can be merged with the child <div>... Using this scheme to compare the text-align schemes:

1st-col 2nd-col
4th-col 5th-col
1st-col 2nd-col
4th-col 5th-col
1st-col 2nd-col
4th-col 5th-col
1st-col 2nd-col
4th-col 5th-col
I personally like scheme D, but, as a default, I think A would be more appropriate. Opinions? Alexiscoutinho (talk) 20:13, 23 September 2020 (UTC)Reply
Thanks. I think I have the same opinion about padding (N), but I think I prefer A for the text alignment – it looks weird having the bar different to the rest of the column, but in most graphs this is how you would want it. WT79 (speak to me | editing patterns | what I been doing) 06:54, 24 September 2020 (UTC)Reply

Template-protected edit request on 3 March 2020

edit

Make left1, left2, right1 and right2 have dynamic colspan to match the bar templates. See Bar stacked's lines 2 and 3, for example. This is important because, without it, it's impossible to centralize a single left column header (as seen in this template at the "Date"). Furthermore, the current implementation creates a dummy space if the column is not used (as seen in here on the right side of "# of cases (including C.D.)"). Alexiscoutinho (talk) 22:15, 3 March 2020 (UTC)Reply

  Not done: please make your requested changes to the template's sandbox first; see WP:TESTCASES. Izno (talk) 03:28, 5 March 2020 (UTC)Reply
@Izno: Updated the sandbox to contain the edit request + an include tag improvement. The test cases don't actually test the column headers which I changed, thus all comparisons looked the same. Alexiscoutinho (talk) 06:14, 5 March 2020 (UTC)Reply
@Izno: So... Alexiscoutinho (talk) 04:28, 10 March 2020 (UTC)Reply
To editor Alexiscoutinho:   done with /includeonly and noinclude tags in accord with WP:INCLUDEONLY. P.I. Ellsworth  ed. put'r there 02:00, 13 March 2020 (UTC)Reply

Dark mode

edit

This template displays the same in light mode and dark mode. This means the text is still readable, but it is intensely bright on an otherwise dark screen. Is there any way to make the template more compatible with dark mode, without potentially making a darkly-colored bar unreadable? (see Template:Bar box/testcases in dark mode) Ping for Jdlrobson who recently fixed accessibility in dark mode on this template, Rjjiii (talk) 00:11, 1 August 2024 (UTC)Reply

I am not the ping you are looking for :) Right now thr project focus should be on making content readable/accessible in dark mode across all Wikimedia projects even if the shortest path is making it look the same as in light theme. Making all templates themeable as you are requesting is likely a multiyear project and best done by the people that build and know the templates (I am not familiar with this one).
Template editors are pretty oversubscribed as is, so any suggested amendments to the template to make them work better in dark mode would likely be appreciated. See Template:Edit fully-protected. 🐸 Jdlrobson (talk) 00:48, 1 August 2024 (UTC)Reply
Gotcha, thanks for the explanation, Rjjiii (talk) 00:28, 2 August 2024 (UTC)Reply