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
Feat: Allow Normalized Theta Tooltip #8302
Conversation
Add
|
@@ -67,6 +67,10 @@ You can also add a text layer to add labels to a pie chart. | |||
|
|||
**Note:** For now, [you need to add `stack: true`](https://github.com/vega/vega-lite/issues/5078) to theta to force the text to apply the same polar stacking layout. | |||
|
|||
Alternatively, setting `stack: "normalize"` allows for tooltips that display the percentage of the pie taken up by a each slice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this section read smoothly, I wonder if it's worth adding arc_pie_tooltip
to say
{:#tooltip}
### Pie Charts with Tooltips
To add tooltip, you can set `tooltip: true` in `mark`
<span class="vl-example" data-name="arc_pie_tooltip"></span>
By default, the tooltip will show actual value of the theta field.
Alternatively, ...
(The tooltip anchor is for the suggested link in the stack doc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this replace the note text on line 68 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this replace the note text on line 68
I don't think so. That's about labeling. (That said, we can add
### Pie Charts with Labels
above that part too so the doc looks like having more structure
@@ -463,7 +463,7 @@ export interface PositionBaseMixins { | |||
* | |||
* `stack` can be one of the following values: | |||
* - `"zero"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart). | |||
* - `"normalize"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized). <br/> | |||
* - `"normalize"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized)). <br/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding "and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)
" in the parentheses for
"normalize"
- stacking with normalized domain (for creating normalized stacked bar and area charts)
Closed in favor of #8308 |
Handles #8301, allows for the use of normalized percentage tooltips in
theta
encodings.