Hi Brian,
The following code snippet shows how to align two charts with different orientation:
NCartesianChart chart1 = CreateBarChart();
nChartControl1.Panels.Add(chart1);
NDockAxisAnchor anchor = new NDockAxisAnchor(AxisDockZone.FrontBottom);
anchor.EndPercent = 80;
chart1.Axis(StandardAxis.PrimaryX).Anchor = anchor;
chart1.Axis(StandardAxis.PrimaryY).Anchor = new NDockAxisAnchor(AxisDockZone.FrontRight);
chart1.PositionChildPanelsInContentBounds = true;
chart1.BoundsMode = BoundsMode.Stretch;
NCartesianChart chart2 = CreateBarChart();
chart2.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalRight);
chart2.DockMode = PanelDockMode.Right;
chart2.BoundsMode = BoundsMode.Stretch;
chart2.Size = new NSizeL(new NLength(18, NRelativeUnit.ParentPercentage), new NLength(0));
chart2.Fit2DAxisContent = false;
chart2.Axis(StandardAxis.PrimaryX).Visible = false;
chart1.ChildPanels.Add(chart2);
NCartesianChart CreateBarChart()
{
NCartesianChart chart = new NCartesianChart();
NBarSeries bar =new NBarSeries();
Random rand = new Random();
for (int i =0; i < 10; i++)
{
bar.Values.Add(10.0 + rand.Next(10));
}
chart.Series.Add(bar);
return chart;
}
The trick is to use docking, and specify on the parent chart that child panels should be docked to the plot area. Hope this helps - let us know if you meet any problems.
Best Regards,
Nevron Support Team