Pre loader

FastColumnRenderableSeries with HorizontalLineAnnotation… but sideways.

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



I would like to implement a simple FastColumnRenderableSeries with an HorizontalLineAnnotation. But I would like it to be sideways.

Here is my current code:

        g = new FastColumnRenderableSeries();
          colums = new UniformXyDataSeries<double>();>          
          using (m_sciChartSurface.SuspendUpdates())
          g.DataSeries = colums;
          m_xAxis = new NumericAxis();
          m_yAxis = new NumericAxis();
          m_sciChartSurface.XAxis = m_xAxis;
          m_sciChartSurface.YAxis = m_yAxis;
          m_xAxis.Visibility = System.Windows.Visibility.Hidden;
          m_yAxis.AutoRange = AutoRange.Never;
          m_yAxis.VisibleRange = new DoubleRange(-3, 2);
          HorizontalLineAnnotation hla = new HorizontalLineAnnotation();
          hla.Y1 = 1;           
          hla.StrokeThickness = 5;
          hla.Stroke = Brushes.Red;  
              m_xAxis.AxisAlignment = AxisAlignment.Left;
              m_xAxis.FlipCoordinates = true;
              m_yAxis.AxisAlignment = AxisAlignment.Top;
              m_yAxis.FlipCoordinates = true;

However, the HorizontalLineAnnotation behaves strangely.

Anny suggestions?

Thank you.

  • You must to post comments
Best Answer

Hi Marc

Thanks for the images, those clarify the situation.

OK so what you’ve done is by setting XAxis.Alignment = Left and YAxis.Alignment = Top is created a Vertical Chart.

In SciChart, this axis orientation transposes the entire chart, and swaps X for Y throughout. It also rotates the chart 90 degrees.

You can still use annotations but you need to set HorizontalLineAnnotation.X1 in this case to get a horizontal line (because the chart is vertical / transposed / rotated 90 degrees).

Try this code:

    <s:SciChartSurface >
            <s:NumericAxis AxisAlignment="Left" VisibleRange="0, 10" AxisTitle="XAxis Left"/>
            <s:NumericAxis AxisAlignment="Top" VisibleRange="-5, 5" AxisTitle="YAxis Top"/>
            <s:HorizontalLineAnnotation X1="5"/>

This results in the following with SciChart WPF 7.0.1

Bet regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.