Tick Marks not working accurately

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Generator for .NET (v4)  /  Re: Tick Marks not working accurately

DynamicPDF Generator for .NET (v4) Forum

 Sep 27 2019 11:47 AM
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);
            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));
 Sep 30 2019 10:31 AM
Posted by a ceTe Software moderator

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;

If you continue facing any issues then please send over the following information to 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.

ceTe Software Support Team

All times are US Eastern Standard time. The time now is 5:12 AM.