Line chart - x-axis labels

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Marc
Site Admin
Site Admin
Posts: 1254
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Aug 12, 2008 8:46 am

Hello Varun,

Ok, I hadn't understood that you want a non-linear Axis. I don't understand how that relates to the 'Missing' label you requested to see.
..that would require a reserved space for the label with no point.

ie. your comment:
I noticed that when I try to add "missing" in between some values then it is not showing up in the chart.
To reproduce the Chart in your image: TeeChart uses a linear scale for axes. You'll need to add your own labels to achieve what you want.

eg. no value at 3 or 7

Code: Select all

java.util.Random y = new java.util.Random();         

for (int i = 0; i < 10; i++) {
  if ((i != 3) && (i!=7))
    line1.add(y.nextDouble(), " " + i);
In effect, don't add x values. TeeChart will index them 0,1,2,3,4 .. in a linear manner as before, but will display the labels you've added.

Regards,
Marc
Steema Support

Post Reply