• Home
  • Nchart3D
  • NGrid
  • Customers
  • Live demo
  • Download
  • Purchase
  • Blog
  • Support
  • Login
Contact us Terms of service Privacy policy ©   Anjuta Software
How to enable discontinuous axis?
by Eugene at 26 Apr. 2017
  1. NChart3D FAQ
  2. Java API
  3. How to enable discontinuous axis?

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 = new double[] {0.42, 0.43, 1.5, 2.7};
for (int i = 0; i < 4; ++i) {
    NChartValueAxisMark m = new NChartValueAxisMark();
    m.setValue(values[i]);
    m.tick().setVisible(true);
    mNChartView.getChart().getCartesianSystem().getXAxis().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:

mNChartView.getChart().getCartesianSystem().getXAxis().getMajorTicks().setVisible(false);
mNChartView.getChart().getCartesianSystem().getXAxis().getMinorTicks().setVisible(false);
mNChartView.getChart().getCartesianSystem().getXAxis().setLabelsVisible(false);

 

Was this article helpful?

Unfortunately, you can't vote for this article. Please log in to be able to vote.

0 out of 0 found this helpful


Comments


No comments yet.

Please log in to place a comment.