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,

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.