Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to control share vs value. Add option to control brackets display. #15

Open
ericmelse opened this issue Apr 18, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ericmelse
Copy link

ericmelse commented Apr 18, 2023

Dear Asjad, it is really helpful that it is possible to extend the title of the categories by their total, either as nominal values or shares (fractions), like:

sysuse nlsw88.dta, clear
label define racelbl 3 ".    O", modify
fre race
alluvial race married collgrad smsa union, palette(CET C7) labs(*1.4) showtot boxw(*16) shares vals(*1.2) valf(%12.2f) 

which results in:
Alluvial_test_1_20230418
Your command adds the value between bracket, like: Black (0.27), which is fine for most purposes.
However, I suggest an option to be able to control how this is done. For example without brackets but using a comma or en dash or em dash or straight brackets, like
Black, 0.27
Black – 0.27
Black — 0.27
Black [0.27]
To do this in a most generic manner, maybe something like this is possible:

valuesep(str)
Option to set the seperator of the displayed value of the categories, which is defined between "". Default is valuesep(" ") for only a space. 

valuebrace(str)
Option to set the brace characters around the displayed value of the categories, which is defined between "". Default is valuebrace("()") for round brackets. 

Another suggestion is an option to set (toggle) the exclusion of the preceding zero (which I find rather redundant), like:
Black, .27
Black — .27
Black [.27]
to conserve space used in the plot. Possibly set as an option, like:

nosharezero
Option to disable the display of the leading zero of the displayed share values of the categories.
@asjadnaqvi asjadnaqvi added the enhancement New feature or request label Apr 18, 2023
@asjadnaqvi asjadnaqvi self-assigned this Apr 18, 2023
@asjadnaqvi asjadnaqvi changed the title add option to set Add option to control share vs value. Add option to control brackets display. Apr 18, 2023
@asjadnaqvi asjadnaqvi moved this from Low priority to Unassigned in StataViz issue tracker Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Unassigned
Development

No branches or pull requests

2 participants