Pre loader

Multiple YAxis in SciStockChart

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

0
0

Hi,

Can I have multiple YAxis in SciStockChart?

Thanks,
Arthur

  • You must to post comments
0
0

Hi Arthur,

Yes, you can. Here is modified code from the “Create a Stock Chart” example, which shows how to achieve that:

//Constructor from code-behind
        public CreateSimpleStockChart()
        {
            InitializeComponent();

            stockChart.YAxis = null;

            stockChart.YAxes = new AxisCollection();
            stockChart.YAxes.Add(new NumericAxis{AxisAlignment=AxisAlignment.Left, AxisTitle="Left", Id="First"});
            stockChart.YAxes.Add(new NumericAxis { AxisAlignment = AxisAlignment.Right, AxisTitle = "Right",Id="Second" });
        }

Also you need to set YAxisId property for RenderableSeries:

            <s:SciStockChart.RenderableSeries>
                <s:FastCandlestickRenderableSeries YAxisId="First" />
            </s:SciStockChart.RenderableSeries>

Hope this is helpful!

Best regards,
Yuriy

  • Arthur Romanov
    Hi Yuriy, when I tried binding YAxes
    <sciChart:SciStockChart Grid.Row="1"
                                    SeriesSource="{Binding ChartManager.SeriesViewModels}"
                                    YAxes="{Binding ChartManager.YAxes}"
                                    DrawMinorGridLines="False"
                                    XAxisVisibleRange="{Binding ChartManager.XVisibleRange, Mode=TwoWay}" >
            </sciChart:SciStockChart>
    I have the exception: "Exception has been thrown by the target of an invocation." Thanks, Arthur
  • Arthur Romanov
    Hi Yuriy, The question is closed. I should set DataContext before InitializeComponent.
    public StockChartView()
            {
                DataContext = _stockChartViewModel;
    
                InitializeComponent();
            }
    Thanks, Arthur
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies