-
Notifications
You must be signed in to change notification settings - Fork 604
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 “Unit” so we automatically append units to axis & legend title. #817
Comments
@kanitw is this what you want to? |
We already use a similar syntax for aggregation functions. I think there are two options here. One is to write "Year in years" and the other is to show the unit with the data on the axis (acceptable for short units such as $). |
Good question! Here is what I think:
@domoritz -- what do you think? |
Sounds reasonable.
|
Cool. To summarize,
|
I am a little confused why we have the "encoding": {
"y": {
"field": "b2",
"type": "quantitative",
"unit": "$",
"axis": {"showUnit": "label-prefix"}
},
"x": {"field": "a","type": "ordinal"}
} it seems a little weird to define that the "encoding": {
"y": {
"field": "b2",
"type": "quantitative",
"unit": "Pounds",
"axis": {"showUnit": "title"}
},
"x": {"field": "a","type": "ordinal"}
} How about this "encoding": {
"y": {
"field": "b2",
"type": "quantitative",
"showUnit": {
"unit": "Pounds",
"position": "title"
}
},
"x": {"field": "a","type": "ordinal"}
} |
If we plan to procced as @kanitw suggested, I am having some trouble accessing |
Instead of calling |
Note: An early attempt of this was in #1301. |
It's easy enough to use title/format to do this, so let's close this. |
In an attempt to make axis title nicer, maybe we add
fieldDef.unit
or allow describing unit in the schema once we support it (#512).For example, if
fieldDef.unit
is’$’
for mean of’cost
’, the axis title could be’MEAN(cost) (in $)’
.The text was updated successfully, but these errors were encountered: