// Shared initialization code void Initialize() { this.AutoresizingMask = NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable; BackColor = Color.Wheat; // Set Form1 size: // this.Width = 350; // this.Height = 300; // Sub Chart parameters: sc = new SubChart(this); sc.TotalChartBackColor = Color.White; sc.Margin = 20; sc.Rows = 2; sc.Cols = 2; // Sub-chart 1 (0, 0): dc1 = new DataCollection(); cs1 = new ChartStyle(this); cs1.TickFont = new Font("Arial", 7, FontStyle.Regular); cs1.TitleFont = new Font("Arial", 10, FontStyle.Regular); cs1.XLimMin = 0f; cs1.XLimMax = 7f; cs1.YLimMin = -1.5f; cs1.YLimMax = 1.5f; cs1.XTick = 1.0f; cs1.YTick = 0.5f; cs1.Title = "Sin(x)"; // Sub-chart 2 (0, 1): dc2 = new DataCollection(); cs2 = new ChartStyle(this); cs2.TickFont = new Font("Arial", 7, FontStyle.Regular); cs2.TitleFont = new Font("Arial", 10, FontStyle.Regular); cs2.XLimMin = 0f; cs2.XLimMax = 7f; cs2.YLimMin = -1.5f; cs2.YLimMax = 1.5f; cs2.XTick = 1.0f; cs2.YTick = 0.5f; cs2.Title = "Cos(x)"; // Sub-chart 3 (1, 0): dc3 = new DataCollection(); cs3 = new ChartStyle(this); cs3.TickFont = new Font("Arial", 7, FontStyle.Regular); cs3.TitleFont = new Font("Arial", 10, FontStyle.Regular); cs3.XLimMin = 0f; cs3.XLimMax = 7f; cs3.YLimMin = -0.5f; cs3.YLimMax = 1.5f; cs3.XTick = 1.0f; cs3.YTick = 0.5f; cs3.Title = "Sin(x)^2"; // Sub-chart 4 (1, 1): dc4 = new DataCollection(); cs4 = new ChartStyle(this); cs4.IsY2Axis = true; cs4.IsXGrid = false; cs4.IsYGrid = false; cs4.TickFont = new Font("Arial", 7, FontStyle.Regular); cs4.TitleFont = new Font("Arial", 10, FontStyle.Regular); cs4.XLimMin = 0f; cs4.XLimMax = 30f; cs4.YLimMin = -20f; cs4.YLimMax = 20f; cs4.XTick = 5.0f; cs4.YTick = 5f; cs4.Y2LimMin = 100f; cs4.Y2LimMax = 700f; cs4.Y2Tick = 100f; cs4.XLabel = "X Axis"; cs4.YLabel = "Y Axis"; cs4.Y2Label = "Y2 Axis"; cs4.Title = "With Y2 Axis"; lg = new Legend(); lg.IsLegendVisible = true; lg.LegendPosition = Legend.LegendPositionEnum.SouthEast; }