Microcharts icon indicating copy to clipboard operation
Microcharts copied to clipboard

[Question] How to make chart's size relative in Xamarin.Android?

Open jevgenijusmarinuskinas opened this issue 4 years ago • 1 comments

Hello,

I've encountered an issue with setting the relative height of Microcharts in Xamarin.Android. If I set it to wrap_content, it would take all the screen, seems like it would ignore this parameter... The only workaround I've got so far is specifying it explicitly, like 250dp..

android:layout_height="250dp"

Is there any chance to make it relative to the size of the viewport?

<LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal|center_vertical"> <Microcharts.Droid.ChartView android:layout_width="match_parent" android:layout_height="250dp" android:minWidth="25px" android:minHeight="25px" android:id="@+id/chartView1" /> </LinearLayout>

jevgenijusmarinuskinas avatar Apr 14 '21 07:04 jevgenijusmarinuskinas

I always set a certain height so I've never tried setting it to take the whole screen, but if it doesn't take the whole screen when asked, it might be a bug somewhere.

eman1986 avatar May 01 '21 03:05 eman1986