wave icon indicating copy to clipboard operation
wave copied to clipboard

X Axis title name flipped in plot

Open ShehanIshanka opened this issue 2 years ago • 3 comments

Wave SDK Version

v0.21.1 & v0.24.0

Actual behavior

X-Axis title is flipped in the plot. This is problematic for Y-Axis title also.

Screenshot 2022-11-22 at 20 59 56

Expected behavior

The X-Axis title is expected not to be flipped and to be placed under X-Axis.

Steps To Reproduce

from h2o_wave import site, data, ui, main

page = site['/demo']
page.add('example', ui.form_card(
    box='1 1 4 5',
    title='Histogram',
    items=[ui.visualization(
        data=data('price low high', 8, pack=True, rows=[
            (4, 50, 100),
            (6, 100, 150),
            (8, 150, 200),
            (16, 350, 400),
            (18, 400, 450),
            (10, 200, 250),
            (12, 250, 300),
            (14, 300, 350),
        ]),
        plot=ui.plot([ui.mark(type='interval', y='=price', x1='=low', x2='=high', y_min=0, x_title="x_title" * 40,
                              label_overlap="hide", )])
    )]
))

page.save()

ShehanIshanka avatar Nov 22 '22 15:11 ShehanIshanka

When you say it should be placed under the center, do you mean it should only read "x_title" rather than repeating?

solomonsanderson avatar Nov 24 '22 00:11 solomonsanderson

When you say it should be placed under the center, do you mean it should only read "x_title" rather than repeating?

I added repeating text for the example. It can be any longer text.

ShehanIshanka avatar Nov 24 '22 03:11 ShehanIshanka

Tmp workaround for anyone: Do not use axis titles longer than the plot itself. This is also a good practice since plots should be quick to look into and having too much text makes them unnecessarily complex.

mturoci avatar Dec 07 '22 09:12 mturoci