Page 1 of 1

Left margin AreaLineChart

Posted: Tue May 18, 2021 10:19 am
by 18291004
We use the AreaLineChart in our Xamarin Forms application.
But no matter what we set the WidthRequest to, there is always more left margin white space than on the right side.
We set the control to Center.

Cfr screenshot.

How can we get equal margins?

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 8:43 am
by Pep
Hello,

could you please share the code that you're using to change the chart aspect and data points to populate ?
I can't reproduce the problem here by using this area example.

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 10:30 am
by 18291004
I will try to recreate a sample.

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 1:32 pm
by 18291004
Seems our screen design is doing something, because the demo app I created to share does indeed not have this problem.
In other words, I need to digg deeper in our production app.

Sorry for the inconvenience and time, thanks for the tip.

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 1:51 pm
by 18291004
Ha, found the difference!
When toggling the chart with IsVisible, it will be smaller!

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 1:57 pm
by 18291004
So the problem is with graphs being rendered invisible and shown later...
Here I load the same graph twice on the page, the first one is just like your sample the second one has a bool bound to IsVisible and will become visible with the button click.
This will render it smaller! Cfr screenshots.

Do you still need extra info on code? I can supply the example if needed.

Re: Left margin AreaLineChart

Posted: Fri May 21, 2021 2:07 pm
by Pep
Hello,
ok, it's very strange problem. Let me check here and back to you. If I need code you use will ask.
Thanks.

Re: Left margin AreaLineChart

Posted: Sat May 22, 2021 5:14 pm
by Pep
Hello,
I've just checked here setting the Chart view visible and invisible by using a simple IsVisible code :

Code: Select all

        private void B_Clicked(object sender, EventArgs e)
        {
            AreaLineChart.IsVisible = !AreaLineChart.IsVisible;
        }
but all seems to work fine anyway.
Could you please send me the code that you're using in order to make it invisible at first ?
Thanks

Re: Left margin AreaLineChart

Posted: Tue May 25, 2021 7:51 am
by 18291004
I added the sample here : https://github.com/Depechie/Charting
It does not contain our license file of course :)

Re: Left margin AreaLineChart

Posted: Fri May 28, 2021 5:05 am
by Pep
Hello,
yes, you're correct, I'm able to reproduce the problem here.
For the moment still not found what's the cause of this. We will review more carefully in order to find a solution.
In meantime, would be an option to you to set invisible via code instead of doing it via binding ?

Thanks

Re: Left margin AreaLineChart

Posted: Fri May 28, 2021 12:33 pm
by 18291004
Not in our actual production app. Everything is abstracted away from the View and handled in the ViewModel...