I want to show in the graph only from Monday to Friday

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
khipras
Posts: 15
Joined: Mon Feb 07, 2005 6:41 pm
Location: Mexico D.F.
Contact:

I want to show in the graph only from Monday to Friday

Post by khipras » Fri Feb 11, 2005 3:36 am

I have a JDCXYDataset and I want to make a timeserieschart but I select from my table only dates in a x month from Monday to Friday, but the chart show me all days in the month.
I don't want to show Saturday neither Sunday.
My recordset don't get those days, but when I make the chart those days are drawing with some x valuie between the value of Friday and Monday.

This is confused, because we don't know if there is this data for weekdays And I didn't selected from the database.

What can I do to skip this two days from my chart?

I have read some skip post but I didn't find the answer.

Thanks for any help that you can post.

s.manchikalapudi
Posts: 11
Joined: Sun Feb 06, 2005 2:05 pm
Location: Hyderabad, India
Contact:

replay

Post by s.manchikalapudi » Sat Feb 12, 2005 12:23 pm

Hi, The method
'public static SegmentedTimeline newMondayThroughFridayTimeline()' in
'package org.jfree.chart.axis.SegmentedTimeLine' class is may be usefull for you.

s.manchikalapudi@rediffmail.com
SAMBASIVARAO MANCHIKALAPUDI

khipras
Posts: 15
Joined: Mon Feb 07, 2005 6:41 pm
Location: Mexico D.F.
Contact:

Re: replay

Post by khipras » Mon Feb 14, 2005 11:12 pm

Hi manchi...

Thanks very much!!!

Your hint is that I look for...
s.manchikalapudi wrote:Hi, The method
'public static SegmentedTimeline newMondayThroughFridayTimeline()' in
'package org.jfree.chart.axis.SegmentedTimeLine' class is may be usefull for you.
I do next implementation to my Class

Code: Select all

        DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
        dateaxis.setDateFormatOverride(new SimpleDateFormat("EEE dd"));
        dateaxis.setVerticalTickLabels(true);
        SegmentedTimeline stl= SegmentedTimeline.newMondayThroughFridayTimeline();
         dateaxis.setTimeline(stl);
And works as I want ..
Thanks a lot

Locked