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 ✭✭

    <Grid.RowDefinitions>


    </Grid.RowDefinitions>
    I tried the above but it does not work.

    Moreoever, since the graphs appear in the neightbouring listview item grid if we open it after the first item is clicked you will see the grpah there.

    The behaviour is unpredictable and the wrong graphs are displayed .

    Not sure if am missing something really basic.

    I am initializing in appdelegate : OxyPlot.Xamarin.Forms.Platform.iOS.PlotViewRenderer.Init();

    Also attached is a sample main xamal and cs file for a blank cross platform xamarin project.

    Attached files are for the shared project main page.

    It clearly shows how the graphs appear randomly sometimes and sometimes they are never there.
    Also, for testing purpose I have assigned different plots for each list item but the graphs are not as assigned in the code.

    Thisis the same behaviour in my application where the web service plots are ignored and the previous listview item grpahs are shown sometimes.

    They work fine if i open the graph in a different content page on click of the listview instead of displaying in the accordion fashion under the item.

  • 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.