How i add a Vertical line or a Second X Axis to a “Clustered Column” Chart ?
Can you give me an Example ?
I have observed the requirements shared by you and like to share that you need plot at-least one chart series on secondary axis in order to display that. Please try using the following sample code on your end to serve the purpose.
public static void TestMultiLinesChart()
PresentationEx pres = new PresentationEx();
SlideEx slide = pres.Slides;
ChartEx chart = slide.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 50, 100, 400, 300);
//Inorder to enable the secondary value axis you need to assign atleast one chart series to them
ChartSeriesEx series = chart.ChartData.Series;
series.PlotOnSecondAxis = true;
chart.SecondValueAxis.IsVisible = true;
I am hopeful, it will work for you. If there is still an issue then please share the requirements in the form of sample chart or snapshot and I will try my best to help you further.
Thank you for the Example , but i want something like this ( Attached File ).
A Red Line in the Chart
But not set the Position with x , y !!
I want to set the Position from the Line for example with Category 1 or Category 2 or Category 3 …
Do you know what i mean ?
Hi Marius W,
Hi Marius W,
I suggest you to please
try using below sample code on your end in order to add line or other
autoshapes along with chart. You can try exploring the feature IChart.UserShape to serve the purpose on your end.
//add line into chart with relative coordinates (80,0) and height 100
chart.UserShapes.Shapes.AddAutoShape(ShapeType.Line, 80, 0, 0, 100);
I hope the shared information will be helpful.