Pre loader

Tag: HorizontalGroupHelper

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

2 votes
12k views

Hi

This is a little snippet of my code

<s:SciChartSurface SeriesSource="{Binding ChartSeries}"
                   YAxes="{Binding YAxisCollection}"
                   XAxis="{Binding XAxis}"
                   Annotations="{Binding AnnotationCollection}"
                   s:HorizontalGroupHelper.HorizontalChartGroup="horizontalChartGroup">

I would like to be able to set throught my ViewModel the “syncWidthGroup” of the HorizontalChartGroup like this.

s:HorizontalGroupHelper.HorizontalChartGroup="{Binding ChartGroup}"

But an exception is thrown saying I can only bind to DP og DO.

    System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message=A 'Binding' cannot be set on the 'SetHorizontalChartGroup' property of type 'SciChartSurface'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
  Source=PresentationFramework
  LineNumber=14
  LinePosition=324
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Sekal.DrillScene.Desktop.Application.Views.TrackView.InitializeComponent() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\obj\Debug\decoratedxaml\Application\Views\TrackView.xaml:line 1
       at Sekal.DrillScene.Desktop.Application.Views.TrackView..ctor() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\Application\Views\TrackView.xaml.cs:line 10
  InnerException: 

So how would I go about doing this through code and not xaml, as I use ViewModel first approach and ViewModels are dynamically appended to an Items collection? (Using Caliburn.Micro)

1 vote
9k views

Hi

I have multiple SciChartSurfaces aligned using the HorizontalGroupHelper. I also need to have multiple y-axes in the charts. I was hoping to use set the margin on each y-axis, but when I do, the upper axis is drawn outside the window. Is there a work-around?

Example.

<Window x:Class="ScichartTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
Title="MainWindow"
Width="800"
Height="450">

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
    </Grid.ColumnDefinitions>

    <!--  Chart left  -->
    <s:SciChartSurface s:HorizontalGroupHelper.HorizontalChartGroup="group">

        <s:SciChartSurface.XAxis>
            <s:NumericAxis
                AxisAlignment="Left"
                AxisTitle="x" />
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y1"
                Id="LeftY1" />
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y2"
                Id="Lefty2" />
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y3"
                Id="LeftY3" />
        </s:SciChartSurface.YAxes>

    </s:SciChartSurface>

    <!--  Chart right  -->
    <s:SciChartSurface
        Grid.Column="1"
        s:HorizontalGroupHelper.HorizontalChartGroup="group">

        <s:SciChartSurface.XAxis>
            <s:NumericAxis
                AxisAlignment="Left"
                AxisTitle="x" />
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis
                AxisAlignment="Top"
                AxisTitle="Right y1"
                Id="RightY1" />
        </s:SciChartSurface.YAxes>

    </s:SciChartSurface>

</Grid>

enter image description here

Showing 2 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies