Tick Marks not working accurately

Tick Marks not working accurately

Forum member · Sep 27, 2019
I only want tick marks to show for the x- axis label. I believe this is called the major tick marks. The major tick marks is the only tick mark I want to show. However I can not get this result. I have tried plotArea.XAxes.DefaultIndexedAxis.MinorTickMarks = null; Yet the minor tick marks still shows When I use plotArea.XAxes.DefaultIndexedAxis.MajorTickMarks = null; no tick marks show at all. I mean even the label tick mark does not show. However I want the label tick mark to show. Please how can I achieve this. I only have 5 labels and I only want tick marks for the 5 labels. Below is my code for the x-axis lables Chart chart = new Chart(0, 0, 500, 400); PlotArea plotArea = chart.PrimaryPlotArea; IndexedStackedLineSeries lineSeries = new IndexedStackedLineSeries(); IndexedStackedLineSeriesElement seriesElement1 = new IndexedStackedLineSeriesElement(array1); seriesElement1.Values.Add((array1Array); lineSeries.Add(seriesElement1); plotArea.XAxes.DefaultIndexedAxis.MinorTickMarks = null; lineSeries.XAxis.Labels.AutoLabels = false; lineSeries.XAxis.Labels.Add(new IndexedXAxisLabel(firstDataPointTime, 0)); lineSeries.XAxis.Labels.Add(new IndexedXAxisLabel(secDataPointTime, 1)); lineSeries.XAxis.Labels.Add(new IndexedXAxisLabel(thrdDataPointTime, 2)); lineSeries.XAxis.Labels.Add(new IndexedXAxisLabel(frthDataPointTime,3)); lineSeries.XAxis.Labels.Add(new IndexedXAxisLabel(fifthDataPointTime,4)); plotArea.Series.Add(lineSeries);

Re: Tick Marks not working accurately

Support · Sep 30, 2019
Hello, Please try setting the Visible property of the X-Axis MinorTickMarks to false before adding the chart to page and see it works for you. Below is the code sample. if (lineSeries.XAxis.MinorTickMarks != null) { lineSeries.XAxis.MinorTickMarks.Visible = false; } page.Elements.Add(chart); If you continue facing any issues then please send over the following information to [^a|mailto:support@dynamicpdf.com|opennewwindow|support@dynamicpdf.com^] so we can look into it further. 1. Code sample which uses static data to recreate the behavior. 2. Output PDF. 3. Exact version and build number of the DynamicPDF DLL file used in the application. You can get this information in DLL references properties (Version and Description fields) in Visual Studio. Thanks, ceTe Software Support Team