-
Notifications
You must be signed in to change notification settings - Fork 62
[UIK-4704][d3-chart] added showPercentValueInTooltip prop for Area/Bar/Cigarette/Histogram/Line charts + updated types #2684
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
base: release/v16
Are you sure you want to change the base?
Conversation
…r/Cigarette/Histogram/Line charts + updated types
|
@ilyabrower I've updated chart component's types which doesn't have any logic related to |
Co-authored-by: ilyabrower <ilia.brauer@semrush.com> Signed-off-by: slizhevskyv-semrush <uladzislau.slizheuski@semrush.com>
Co-authored-by: ilyabrower <ilia.brauer@semrush.com> Signed-off-by: slizhevskyv-semrush <uladzislau.slizheuski@semrush.com>
|
@sheila-semrush Could you please review the visual of tooltip with percent. You can check them on the website (we've added new props here http://localhost:5173/intergalactic/data-display/stacked-area-chart/stacked-area-chart) Also, should we add this props for the Cigarrete example, what do you think? |
sheila-semrush
left a comment
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.
@slizhevskyv-semrush I added a playground for Cigarette chart, can you review it?
|
@Valeria-Zimnitskaya I added |
| function getJSX(props: CigaretteChartJSXProps) { | ||
| const { ...legendProps } = props.legendProps ?? {}; | ||
| return ( | ||
| <Chart.Cigarette |
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.
@slizhevskyv-semrush I have a concern about the display name, isn't "Cigarette.Bar" invalid here?

| plotHeight={props.cigaretteProps.layout === 'horizontal' ? 28 : 200} | ||
| aria-label='Cigarette chart' | ||
| tooltipViewType={props.cigaretteProps.tooltipViewType} | ||
| invertAxis={props.cigaretteProps.layout !== 'vertical'} |
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.
@slizhevskyv-semrush there's also an issue with invertAxis={false}, I guess we hide it, but in this case the default value is true and we should show it explicitly when it's false
Also would be nice if undefined hid properties, now it's printed in the snippet as is. In this case I'm expecting:
layout="horizontal"=>invertAxis={undefined}(hidden from snipped, default value),layout="vertical"=>invertAxis={false}(printed in snippet)
In general, I wouldn't hide false, but instead would hide undefined.



Changelog
@semcore/d3-chart
Added
showPercentValueInTooltipprop for Area/Bar/Cigarette/Histogram/Line charts.Fixed
showTotalInTooltipprop from certain chart components.Motivation and Context
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist: