Skip to content
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

bug: Plot tooltip display additional fields that are not present in the data #1836

Closed
dulajra opened this issue Feb 14, 2023 · 3 comments · Fixed by #1841
Closed

bug: Plot tooltip display additional fields that are not present in the data #1836

dulajra opened this issue Feb 14, 2023 · 3 comments · Fixed by #1841
Labels
bug Bug in code plot Related to plotting

Comments

@dulajra
Copy link
Contributor

dulajra commented Feb 14, 2023

via #1832

Wave SDK Version, OS

0.24.2

Actual behavior

There are 2 issues on the tooltip.

  1. When the plot type is interval the ranged data (x_min - x_max) is included in the plot tooltip. But only x_min, x_max and y are present in data.

plot tooltip

  1. Both x1 and x2 have the timestamp and are in the same format. Here are some sample data.
09 = {tuple: 3} ('2023-02-14T07:24', '2023-02-14T07:30', 50000)
10 = {tuple: 3} ('2023-02-14T07:30', '2023-02-14T07:35', 50000)

But on the tooltip, the time part is not visible only for x1.

Expected behavior

  1. Only the fields in data should be visible in the plot tooltip.
  2. Both x1 and x2 in the tooltip should display both the date and time as in the data.

Steps To Reproduce

Sample code

ui.visualization(
        plot=ui.plot(
            [
                ui.mark(
                    type="interval",
                    x='={{intl x_min type="time" dateStyle="short" timeStyle="short" }}',
                    x1='={{intl x_min type="time" dateStyle="short" timeStyle="short" }}',
                    x2='={{intl x_max type="time" dateStyle="short" timeStyle="short" }}',
                    x_scale="time",
                    x_title=histogram.x_label,
                    y_min=0,
                    y="=y",
                    y_title=histogram.y_label,
                    fill_color=SHOE_WAX,
                    stroke_color=IRON,
                    label_overlap="hide",
                )
            ]
        ),
        data=data(
            fields=["x_min", "x_max", "y"],
            pack=True,
            rows=[('2023-02-14T06:45', '2023-02-14T06:48', 0), ('2023-02-14T06:48', '2023-02-14T06:54', 0), ('2023-02-14T06:54', '2023-02-14T07:00', 0), ('2023-02-14T07:00', '2023-02-14T07:06', 0), ('2023-02-14T07:06', '2023-02-14T07:12', 0), ('2023-02-14T07:12', '2023-02-14T07:18', 0), ('2023-02-14T07:18', '2023-02-14T07:24', 0), ('2023-02-14T07:24', '2023-02-14T07:30', 15310), ('2023-02-14T07:30', '2023-02-14T07:36', 60000), ('2023-02-14T07:36', '2023-02-14T07:42', 24690), ('2023-02-14T07:42', '2023-02-14T07:45', 0)],
        ),
    )
@marek-mihok
Copy link
Contributor

Tracked in #1841.

@dulajra, regarding the second point

Both x1 and x2 in the tooltip should display both the date and time as in the data.

just remove this line x='={{intl x_min type="time" dateStyle="short" timeStyle="short" }}',, for type='interval' plots should be x1 and x2 enough. cc: @mturoci

@mturoci
Copy link
Collaborator

mturoci commented Feb 17, 2023

just remove this line x='={{intl x_min type="time" dateStyle="short" timeStyle="short" }}',

Why should it be removed?

@marek-mihok
Copy link
Contributor

marek-mihok commented Feb 17, 2023

I'm sorry, I take it back. There's no need to remove it @dulajra . Thanks @mturoci.
Fix for both of addressed issues will be available in the next release.

marek-mihok added a commit that referenced this issue Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code plot Related to plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants