My Requirement
I need to draw a second Y-Axis on a Scatter chart using C#.
My data pattern
Signal-1 Value
Signal-2 Value
Time Received
Expected Chart
I need to draw the chart to have
- Signal-1 value on the X-Axis
- Signal-2 value on the Y-Axis
- Time Received on the second Y-Axis.
Please let me know how to draw the second Y-Axis to represent the time value.
I have searched in net, but the solution I get for having Y-Axis is to plot a another series -
Using secondary axis for chart cause x-axis and primary y-axis issue (Excel) -( https://stackoverflow.com/questions/28540458/using-secondary-axis-for-chart-cause-x-axis-and-primary-y-axis-issue-excel)
My Current Code
- var scatterChart =
- workSheet.Drawings.AddChart("scatterChart", eChartType.XYScatterLines) as ExcelScatterChart;
- scatterChart.Title.Text = GraphTitle;
- var rangeLabel = workSheet.Cells["D2:D2571"];
- var range1 = workSheet.Cells["C2:C2571"];
- scatterChart.Series.Add(range1, rangeLabel);
- scatterChart.Series[0].Header = workSheet.Cells["A1"].Value.ToString();
- scatterChart.Legend.Position = eLegendPosition.Right;
- scatterChart.SetSize(600, 300);
- scatterChart.SetPosition(5, 0, 1, 0