Oxyplot does not work undeer the listview grid

devxusdevxus Member ✭✭

I have a listvew and when user taps the viewcell I open another grid under the listview with details related to the listview cell clicked(given the accordion control illusion).

But the oxyplot grphs dont work in iOS.They are fine in android.

The graphs appaear and vanish and sometimes appear in the next listview item grid instead of the listview item clicked.

My implementation is straight forward... Is this a bug?

Answers

  • devxusdevxus Member ✭✭

    I am initializing the oxyplot in xamarin -> OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();

    atached is sample file for main.xaml and cs

  • NMackayNMackay GBInsider, University mod

    @devxus said:
    I am initializing the oxyplot in xamarin -> OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();

    atached is sample file for main.xaml and cs

    Using auto and getting the child control to calculate it's own height is not an approach that always works in iOS.

    Try changing your grid layout seeing as you aren't hiding the graph and always showing it.

     <Grid.RowDefinitions>
                                                <RowDefinition Height="20*"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
    
    
  • devxusdevxus Member ✭✭

    I tried changing the grid row definition to 20 and 80* still no difference .

    The behavior is random and sometimes on clicking i see graphs though they are not the graphs assigned to that particular list view item.

    Refer my sample mainpage.xaml and .cs file I created to show the issue from the cross platform shared code.

    I am also initializing in app delegate. OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();

    They work fine if I load the graph in another content page instead of the grid under the listview.

    This is making me think oxyplot plotview is not able to recognize the Plotview when nexted in listvoew??
    Not sure if I am missing something basic since the approach is straight forward.

    Please refer my sample Mainpage files attached from my test project.

  • NMackayNMackay GBInsider, University mod

    @devxus said:
    I tried changing the grid row definition to 20 and 80* still no difference .

    The behavior is random and sometimes on clicking i see graphs though they are not the graphs assigned to that particular list view item.

    Refer my sample mainpage.xaml and .cs file I created to show the issue from the cross platform shared code.

    I am also initializing in app delegate. OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();

    They work fine if I load the graph in another content page instead of the grid under the listview.

    This is making me think oxyplot plotview is not able to recognize the Plotview when nexted in listvoew??
    Not sure if I am missing something basic since the approach is straight forward.

    Please refer my sample Mainpage files attached from my test project.

    I suggested setting the 2nd grid row to *

  • devxusdevxus Member ✭✭

    Setting second grid view row to * dint help either

  • NMackayNMackay GBInsider, University mod
    edited February 1

    @devxus

    Ok, open an issue on the oxyplot github page and post a repo with clear steps on how the issue can be reproduced.

    https://github.com/oxyplot/oxyplot/issues

    I've used RadChart in the past to render in a ViewCell so it should be achievable but I've never used Oxyplot.

    Maybe simplify your Viewcell to just have a chart and see if it renders as expected in iOS.

    <ListView.ItemTemplate>
      <DataTemplate>
        <Grid>
          <oxy:PlotView  x:Name="LinePlotModel"  VerticalOptions="Fill" IsVisible="True"  HorizontalOptions="Fill" />
        </Grid>
      </DataTemplate>
    </ListView.ItemTemplate>
    

    Try and narrow down if the issue is due to the way oxyplot is implemented in your ViewCell or if the control has an issue.

  • devxusdevxus Member ✭✭

    thank you for your response....I have created an issue in Github.....

    Creating a grid in the main list view data templete does not serve the purpose for me.

    I tired to have lesser nested controls....but my requirement is the grid should slide down on click of the listview along with a bunch of other labels ...

    For now on click of listview I am opening another content page instead of the dropdown under the listview to show the details and that works fine since listview is not involved and lesser nested controls ...

Sign In or Register to comment.