I'm creating a bar graph with 54 bars. Major ticks are set to 9, minor ticks are set to 6. My problem is with the axis labels. I want the label to start at 200 and go up one hundred at each major tick. ie: first major tick = 200, next major tick 300 ect.
the code I'm using: LinearAxis xAxis = new LinearAxis(); xAxis.SetColor(Color.Black); xAxis.SetAxisMin(0); xAxis.SetAxisMax(54); xAxis.SetAxisMajorNthTick(9); xAxis.SetAxisMinorTicksPerMajor(6); chartVu.AddChartObject(xAxis);
NumericAxisLabels xAxisLab = new NumericAxisLabels(xAxis); xAxisLab.SetColor(Color.Black); chartVu.AddChartObject(xAxisLab);
I cant find any method in the AxisLabels or LinearAxis that will let me specify the value on each major tick mark, or at least specify a min max value of 200-1100. Is there a way to do this?
The axis labels of the NumericAxisLabels follow the plot area scaling and label all major tick marks except for the first, last and the intercept label, which are optional. If you want axis labels different than this you must use the StringAxisLabels class instead of the NumericAxisLabels class, where you pass in a string array of the major tick mark labels. Some of the strings can be null strings if you want major tick marks without labels.
You may find it easier to scale the plotting are for the range that you want your axis labels to use. You can easily calculate each bars x-value to position them properly.