SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hi,

I’m trying to wrap the Scichart surface in XF. I’ve used native views as recommended in documentation and there is no problem when the SciChartSurface is the only element in a ContentPage, but when the surface is placed inside a layout or merged with any other element, then is not rendering.

Do you know why is this happening and how can I merge XF controls and SciChartSurface(s) in a ContentPage or any Layout?

1: This is rendering without problem

    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:SciChartForms"
             xmlns:localAndroid="clr-namespace:SciChartForms.Droid"
             x:Class="SciChartForms.MainPage">
    <localAndroid:Stripchart />
</ContentPage>

2: This is not rendering:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:SciChartForms"
             xmlns:localAndroid="clr-namespace:SciChartForms.Droid"
             x:Class="SciChartForms.MainPage">
    <StackLayout Margin="20">
        <Button Text="adafsd"/>
        <localAndroid:Stripchart/>
    </StackLayout>
</ContentPage>

Thanks in advance!

PS: I’ve also tried with custom renderer obtaining the same result.

Version
2.1.0.625
Images
  • You must to post comments
1
0

Hi Antonio,

Have you tried to set Horizontal/VerticalOptions for you custom View. It seems to work in this case:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:FormsSandbox"
         xmlns:customViews="clr-namespace:scichartshowcase.CustomViews;assembly=FormsSandbox.Android"
         x:Class="FormsSandbox.MainPage">
  <StackLayout Margin="20">
    <Button Text="Label"/>
    <customViews:SciChartSurfaceView x:Name="sampleSurface" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/>
  </StackLayout>

</ContentPage>

Best regards,
Yura

Images
  • You must to post comments
0
0

I tried that with the native view and got a xaml parse exception:

Xamarin.Forms.Xaml.XamlParseException: Position 9:34. Cannot assign property "HorizontalOptions": Property does not exists, or is not assignable, or mismatching type between value and property

I’ve just tried with the custom renderer and in this case is working, thanks!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.