Support richer axis & legend title text layout.
See original GitHub issueThe titleAlign
property does not seem to work as expected in v3.0.0-rc12. With the following spec that tries to right-align all the titles:
{
"$schema": "https://vega.github.io/schema/vega-lite/v3.json",
"data": {"url": "data/barley.json"},
"mark": "bar",
"encoding": {
"x": {"aggregate": "sum", "field": "yield", "type": "quantitative", "axis": { "titleAlign": "right"}},
"y": {"field": "variety", "type": "nominal", "axis": { "titleAlign": "right"}},
"color": {"field": "site", "type": "nominal", "legend": { "titleAlign": "right"}}
}
}
the output has the titles pushed leftward. They should (presumably) be aligned against the right edge of the legend/axis.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Format text in a legend—ArcGIS Pro | Documentation
Learn how to format and change text in a legend. ... For example, the title of the legend can be bold and a...
Read more >Legend Title | WinForms Controls - DevExpress Documentation
To display a legend title at design time, click on the required legend within the chart to select it. Then, in the Properties...
Read more >Title and Separator | Legend | Common Settings
The legend title is disabled by default. To enable and configure it, combine the legend() method of the chart with title() and methods...
Read more >GGPlot Legend Title, Position and Labels - Datanovia
Change legend title; Change legend position; Reverse the order of legend items; Remove legend; Change the legend font size, color and face ...
Read more >Customizing the Kaplan-Meier Survival Plot - SAS Support
have an increment of 0.25 and also change the Y-axis label to 'Survival': ... information about text and label attribute options, see SAS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
titleAlign
field maps to thealign
encoding channel for a text mark. It determines only how the text is oriented relative to its x/y anchor point, it does not change that anchor point.If you change the title position (set the title x-coordinate to the width of the legend) you can get the desired effect!
What I meant is a way to get all the parameters (data backing) the legend from Vega view API so custom legends (and perhaps “plugins”) can be implemented in javascript (similar to Vega’s support for tooltip). For example: view.data(“mylegend”)