Page 1 of 1

spacing beteen x-axis labels based in x-axis variable

Posted: Sun Jun 15, 2008 5:40 am
by 7667591
Hi,
Suppose I have date values on X-axis, I would like to provide two options to the user,

1) Create a Line Chart where spacing is equal in the x-axis (this is default)
2) X-axis label spacing based on x-variable values

The first one comes by default in TeeChart. I want to know how I could perform the second one.
Let's take an example,

Suppose I have date values like,
1-Jan-2008, 5-jan-2008 and 10-jan-2008. If I plot these values on x-axis there will be three points on x-axis and the spacing between each point will be equal. Suppose I want to add another date say 2-jan-2008, I want that point to be between 1-jan-2008 and 5-jan-2008. In this case I should not have equal spacing between the points on X- axis. So in brief the x-axis should act like an ordered set of points.


Thanks,
varun

Posted: Mon Jun 16, 2008 8:13 am
by narcis
Hi varun,

To achieve what you request, you can set bottom axis labels and series' marks like this:

Code: Select all

        chart1.getSeries(0).getMarks().setStyle(MarksStyle.XVALUE);
        chart1.getAxes().getBottom().getLabels().setStyle(AxisLabelStyle.MARK);