Gantt chart Label value display

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Gantt chart Label value display

Post by nsurendiran » Tue Oct 27, 2009 4:47 am

Hi all,

I am displaying a Gantt for parking slot Utilization in a particular day. So My Series values will be something like below...

Code: Select all

DateFormat sdf = new SimpleDateFormat("HH:mm");
try{
s1.add(new Task("PS1",new SimpleTimePeriod(sdf.parse("00:00"), sdf.parse("23:59"))));
s1.add(new Task("PS2",new SimpleTimePeriod(sdf.parse("02:00"), sdf.parse("13:20"))));
s1.add(new Task("PS3",new SimpleTimePeriod(sdf.parse("08:00"), sdf.parse("09:20"))));
s1.add(new Task("PS4",new SimpleTimePeriod(sdf.parse("15:00"), sdf.parse("18:45"))));	
 }catch(ParseException pe){
      pe.printStackTrace();
 }
The Gantt is displayed ok.

Now I need to display the Vehicle registration number on each Gantt. So I 've decided to use Labels. There I have a problem
I am using a LabelGenerator,

Code: Select all

public String generateLabel(CategoryDataset dataset, int series,
		int category) {
		Number value = dataset.getValue(series, category);
		System.out.println(series +","+ category+","+value);
	}
The above output statement gives something like below
0,0,-19800000
0,1,-19800000
0,2,-19800000
0,3,-19800000
0,4,-19800000
0,5,10560000
0,6,-19800000
0,7,-19800000
0,8,11640000
0,9,-19800000
0,10,-19800000
Can someone help me to understand the 3rd value in each line?

Also, I need to display the label on the Gantt, currently its displayed above the Gantt. How can I position the label to display the value on the Gantt?

Any help would be appreciated

Thanks
Surendran

nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Re: Gantt chart Label value display

Post by nsurendiran » Tue Oct 27, 2009 11:39 am

Also, I need to display the label on the Gantt, currently its displayed above the Gantt. How can I position the label to display the value on the Gantt?
I did this by adding the following code

Code: Select all

 renderer.setItemLabelAnchorOffset(-20);
Any thoughts on the other quries please??

nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Re: Gantt chart Label value display

Post by nsurendiran » Wed Oct 28, 2009 11:31 am

Hi,

Ant thoughts on my first question, on how can I uniquely identify each Gantt in my chart.
I have String in my DomainAxis/Category and Time values in the RangeAxis. Please help me in this regards.

Thanks
Suren

nsurendiran
Posts: 17
Joined: Mon Oct 26, 2009 12:07 pm
antibot: No, of course not.

Re: Gantt chart Label value display -- Closed

Post by nsurendiran » Tue Nov 03, 2009 5:30 am

Hi,

This thread is a duplication of what is being asked here..

http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=29441

Code: Select all

dataset.getColumnKey(category)
Sorry for that. And Please refer the above URL

Thanks
Suren

Locked