Open ghost opened 4 months ago
Thanks for the issue @samuelhafsteinsson . It seems like the (d: DataRecord)
is indeed wrong for the case of [Line.selectors.line]
. Here's a reproduction showcasing that both callback return different value
Edit: Also checked Area
component with the tooltip, seems like it return all the data, instead of d: DataRecord
@samuelhafsteinsson Thanks for pointing this out, we'll have to make a correction in our docs. However, the behavior is correct because the line is represented by the entire data array, not a single element.
If you want to have a tooltip for a single element, you can combine it with Crosshair https://unovis.dev/docs/auxiliary/Crosshair#adding-a-tooltip
@samuelhafsteinsson Thanks for pointing this out, we'll have to make a correction in our docs. However, the behavior is correct because the line is represented by the entire data array, not a single element.
If you want to have a tooltip for a single element, you can combine it with Crosshair https://unovis.dev/docs/auxiliary/Crosshair#adding-a-tooltip
I figured, did exactly that and worked well, thank you
As by the documentation, you can define a
Tooltip
onto a line like so:This suggests that the
Line.selectors.line
uses the providedDataRecord
. However that does not seem to be the case, assume theDataRecord
is typed as the following:The expected data from the line selector would then be
{date: <some_date>, votes: <some_number>}
. But the actual data is in the form of{x: <some_number>, y: <some_number>}
. This seems to be either a bug or the documentation has an error in it.Note: The data for the StackedBar is correct i.e. on the form of
{date: <some_date>, votes: <some_number>}
.Versions: