|
X-Axis Label Point |
Posted by DCSIT on May-07-2003 21:20 |
|
Hi:
Is it possible to only point certain tick points on the X-Axis so that if you have a lot of data points the bottom of the graph is not all bunched up. Have attached a example of what I mean :
|
Re: X-Axis Label Point |
Posted by Peter Kwan on May-08-2003 01:11 |
|
Hi DCSIT,
Yes. Simply replace some of the elements in your x axis labels array with empty string.
For example, in VBScript, it would be something like:
'Replace 90% of the labels with empty string
For i = 0 to UBound(labels)
If i Mod 10 Then labels(i) = ""
Next
Regards
Peter Kwan |
Re: X-Axis Label Point |
Posted by Stuart on May-09-2003 00:37 |
|
HI,
Im having the same problme ie the x acis when having lots of figures on it gets bunched up and you cant read it. If you get a solution please could you lte me know. I will do the same
Stu |
Re: X-Axis Label Point |
Posted by Peter Kwan on May-09-2003 01:13 |
|
Hi Stuart,
The solution is to replace some of the labels by empty string by modifying the labels array.
'Replace 90% of the labels with empty string
For i = 0 to UBound(labels)
If i Mod 10 Then labels(i) = ""
Next
It does not matter whether the labels array is obtained from a database or other means. All you need to do is to replace some labels with empty strings.
Regards
Peter Kwan |
Re: X-Axis Label Point |
Posted by sally on Jun-05-2003 11:57 |
|
Hi Peter,
I'm using a list (array) in my chartdirector. and Perl is my prog language. When I replace my labels with empty string, the label is not skip but rather a empty label is displayed. Is there any additional x-axis properties that i need to call to skip the empty labels?
Regards. |
Re: X-Axis Label Point |
Posted by Peter Kwan on Jun-05-2003 12:11 |
|
Hi Sally,
Sorry. I am not too sure of your question. What is meant by "the label is not skip but rather an empty label is displayed"? If the label is empty, would you mind to clarify what is displayed for the label, if there is anything to display at all? May be you may attached a sample chart to help me to understand the issue.
For example, in the "Simple Line Chart" example that comes with ChartDirector, the labels are defined as:
my $labels = ["0", "", "", "3", "", "", "6", "", "", "9", "", "", "12", "", "", "15", "", "", "18", "", "", "21", "", "", "24"];
So on the x-axis, only (0, 3, 6, 9, 12, ..) are displayed. Nothing is displayed for the empty positions.
Regards
Peter Kwan |
Re: X-Axis Label Point |
Posted by Andres on Jan-24-2009 04:45 |
|
And what if the labels are dates? I am using ASP.NET and fill my labels with a System.DateTime array, but I need to display only ticks from days 1,5,10,15,20,25,30 and 31 of each month in the X axis. |
Re: X-Axis Label Point |
Posted by Peter Kwan on Jan-24-2009 15:26 |
|
Hi Andres,
I assume you are using a label based x-axis (configured using Axis.setLabels or Axis.setLabels2, and not Axis.setDataScale or auto-scale).
In this case, you can just use the same method in this thread. Actually, you have already mentioned what are the labels on the x-axis. It does not matter if your data are DateTime or not.
According to what you mentioned, it is always the followings (in C#):
string[] myLabels = {"1", "", "", "", "5", "", "", "", "", "10", ...."30", "31"};
c.xAxis().setLabels(myLabels);
If you just want to tick instead of a label, use an empty space, like " ". If some of the months use other labelling methods, just create several labels array to be used by different months.
Hope this can help.
Regards
Peter Kwan |
|