Odoo 12 Graph View with horizontal bars - odoo-12

How can I show the graph view with horizontal bars instead of the default vertical orientation?
I'm using odoo v12.
I've already tried this but it's not working:
<graph string="Product" orientation="horizontal" type="bar">
<field name="name" type="row"/>
</graph>

Related

Setting size of editor for chat UI in .NET MAUI app

In my .NET MAUI app, I'm implementing chat feature and want to make sure that the Editor and Button are perfectly located at the bottom of the screen.
I created a Grid for the controls to produce this layout
The problem I'm having is with the Editor width because if I get it to look right on Android, it's not perfect on iOS and vice versa.
Here's how I approached it:
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="StartAndExpand"
Margin="5,5,5,5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>
Other than entering some arbitrary number for WidthRequest for the Editor, how do I set the width for it so that it always takes up all the available space and look like it in the picture?
After setting HorizontalOptions="FillAndExpand" as Jason suggested like below, it looks right on Android and iOS.
<Grid
RowDefinitions="50"
ColumnDefinitions="*,50"
RowSpacing="0"
ColumnSpacing="5"
HorizontalOptions="FillAndExpand"
Margin="5">
<Editor
Grid.Column="0" />
<Button
Grid.Column="1" />
</Grid>

Creating a round border around user avatar in .NET MAUI

In my .NET MAUI app, I'm using the AvatarView in.NET MAUI Community Toolkit to create a nicely round user avatar which is pretty easy to do.
I now want to put a nice border around the image but I'm not getting the desired effect because when I set the BorderWidth property of the AvatarView, it places the border "inside" the image which makes the visible area smaller. I actually want to put the border "outside" the image so that I don't lose anything from the visible area. Here's an image that demonstrates this:
BTW, I tried setting the HeightRequest and WidthRequst larger and then setting the BorderWidth but it still seems to make the visible area smaller because all that's doing is that it makes the main image larger and with the border set, the visible area still doesn't show the additional data/area.
Here's my current code which places the border within the image -- which I can safely assume is the standard behavior.
<mct:AvatarView
ImageSource="{Binding UserInfo.AvatarUrl}"
BorderColor="{StaticResource UILightGray}"
BorderWidth="10"
CornerRadius="70"
HeightRequest="140"
WidthRequest="140"/>
How do I achieve the effect that I want? Basically, I'd like the border to go outside of the image, effectively adding some 10 pixels to the size of the image.
Alternatively, I don't mind placing the border within the image but I need a way to make the actual image 10 pixel smaller so that the visible area stays the same.
How can I achieve this by using or not using .NET MAUI Community Toolkit?
If you don't want to use the community toolkit package, then wrap the image with a Frame would be a trade-off for this scenario. And also you need to set the Aspect of the image to AspectFit.
<Frame HeightRequest="140"
WidthRequest="140"
CornerRadius="70"
HorizontalOptions="Center"
IsClippedToBounds="True"
Padding="0"
BorderColor="Gray"
Margin="0,0,0,0">
<Image
Aspect="AspectFit"
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="140"
WidthRequest="140"
VerticalOptions="Center"
HorizontalOptions="Center" />
</Frame>
Update:
You can also wrap a Border as Steve suggested.
<Border HeightRequest="160"
WidthRequest="160"
StrokeShape="RoundRectangle 80,80,80,80"
HorizontalOptions="Center"
StrokeThickness="8"
Margin="0,0,0,0">
<Image
Aspect="AspectFit"
Source="dotnet_bot.png"
SemanticProperties.Description="Cute dot net bot waving hi to you!"
HeightRequest="160"
WidthRequest="160"
VerticalOptions="Center"
HorizontalOptions="Center" />
</Border>

How Can You Align a Grid Row to the Top and Bottom and Have the Middle Fill the Rest of the Screen

I'm trying to build a UI where there's a small section that's always at the top of the page, and a small section that's always at the bottom. The middle section I want to have fill up the entire rest of the page height. I thought it would be something like the XAML below but it's not working - the middle section never fills up the available space. Was hoping someone could point out what I'm doing wrong. Simplified markup below:
<Grid RowDefinitions="60,*,60" ColumnDefinitions="*">
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
<!-- top stuff here -->
</HorizontalStackLayout>
<VerticalStackLayout Grid.Row="1" Grid.Column="0" VerticalOptions="Fill">
<!-- middle section here -->
</VerticalStackLayout>
<Grid Grid.Row="2" Grid.Column="0">
<!-- bottom section here -->
</Grid>
</Grid>
NOTE: When pasting into this question the editor strips out the closing <//Grid> tag.
When in doubt, use ..AndExpand to be sure all space is used.
<Grid RowDefinitions="60,*,60" ColumnDefinitions="*"
VerticalOptions="FillAndExpand" >
...
<VerticalStackLayout Grid.Row="1" VerticalOptions="FillAndExpand" ...
UPDATE
Actually, your original code does what it should for me, testing on both Windows and Android, when I set MainPage = new MainPage(); and have that code in MainPage. With a BackgroundColor on the middle part, so I can see it expand as desired.
So, what is different in your setup?
Are you using AppShell?
Testing on platform other than Windows or Android?
You didn't test the "simplified markup" you show, so the problem is elsewhere in your actual markup?

Textfields aren't stretching when in same Grid with react-select Select

This is a recent issue and this only happens on Chrome (Version 76.0.3809.132). I've got a real simple dialog that contains a material ui (v4.3.3) Grid, some TextFields and 2 react-select(v3.0.4) Select boxes. The container is setup with justify flex-start and alignItems stretch. The input controls are simply wrapped up in Grid items all with fullWidth set on them. The issue I'm seeing is that on render, the TextFields don't stretch the entire width of the Grid while the Selects do. Here's where it gets interesting, if I tab cycle focus through the components the TextFields will snap to full width as soon as the react-select Select component gets focus, this also occurs if I just click into the react-select Select component. If I shift-tab cycle back to the TextFields, they snap back to their original stunted width.
If I remove the Selects from the Grid, the TextFields stretch the width of the container as expected. I've removed all custom styling from the react-select Select and it still exhibits the same behavior (TextFields displaying not at full width). I also tried a separate 3rd party react wrapper around react-select, react-select-material-ui, and it still exhibits the same behavior.
<Grid
container
direction="column"
justify="flex-start"
alignItems="stretch"
>
<Grid item>
<Select ... />
</Grid>
<Grid item>
<TextField ... />
</Grid>
<Grid item>
<TextField ... />
</Grid>
<Grid item>
<TextField ... />
</Grid>
<Grid item>
<Select ... />
</Grid>
</Grid>
As mentioned, this was working as expected until recently and only happens in Chrome. My expectation is that the TextFields will render the full width of the container consistently.
The latest version of Chrome (Version 77.0.3865.75) appears to have fixed a rendering issue. Things are rendering as expected now.

How to reduce size of DatePicker in Window Universal App in Windows 10?

I am working on ECommerce Universal app in Windows 10. I have DatePicker control to manage filter for Between Dates.
It is working fine in Desktop State(View) (>720). But width of DatePicker doesn't reduce in Tablet State(View) (<720).
I have set Setter for it:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="PageSizeStatesGroup"
CurrentStateChanged="OnCurrentStateChanged">
<VisualState x:Name="MediumState">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="720" />
</VisualState.StateTriggers>
<VisualState.Setters>
<!--Set width to 215 but it doesn't reduce-->
<Setter Target="datepicker1.Width" Value="215"></Setter>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
Generally, this works for other control in my application whether it is for Desktop view or Tablet view or Mobile view. But it doesn't work for DatePicker.
Can anybody suggest me how to achieve this?
DatePicker has also set MinWidth property as default, so you have to join the setter for this property too. Otherwise it takes MinWidth value, when your Width value is smaller.
It should be something like this:
<Setter Target="datePicker1.MinWidth" Value="215" />