You can use NChartValueAxisMark to display ticks with irregular step. For example, if you need to have ticks with values 0.42, 0.43, 1.5, 2.7 on the X-Axis, you can do the following:
double values[4] = { 0.42, 1.33, 1.75, 2.7 };
for (int i = 0; i < 4; ++i)
{
NChartValueAxisMark *m = [NChartValueAxisMark mark];
m.value = values[i];
m.tick.visible = YES;
[m_view.chart.cartesianSystem.xAxis addMark:m];
}
You can set up the ticks drawn for each mark through tick property of the mark.
You can also switch off the regular ticks of the value axis to let marks be the only ticks displayed:
m_view.chart.cartesianSystem.xAxis.majorTicks.visible = NO;
m_view.chart.cartesianSystem.xAxis.minorTicks.visible = NO;
m_view.chart.cartesianSystem.xAxis.labelsVisible = NO;
Comments
No comments yet.
Please log in to place a comment.