Problem with setRoundFirstLabel

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Problem with setRoundFirstLabel

Post by Dmitry » Fri Jul 31, 2009 2:03 pm

Image

Code: Select all

                chart.getAxes().getBottom().getLabels().setDateTimeFormat("d hh:mm");
		chart.getAxes().getBottom().setIncrement(Utils.getDateTimeStep(DateTimeStep.ONEDAY));
		chart.getAxes().getBottom().getTitle().setText("Date");

		chart.getAxes().getBottom().getLabels().setRoundFirstLabel(true);
		chart.getAxes().getBottom().setStartPosition(1);

                        com.steema.teechart.DateTime cd1 = new com.steema.teechart.DateTime(c1.getTime().getTime());
			com.steema.teechart.DateTime cd2 = new com.steema.teechart.DateTime(c2.getTime().getTime());
			chart.getAxes().getBottom().setMinMax(cd1, cd2);
c1 - 00:00:00 first date interval
c2 - 23:59:59 last date interval
My timezone +3h

I had like set axis line to 00:00

Sorry my English
Dmitry

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with setRoundFirstLabel

Post by Yeray » Fri Jul 31, 2009 2:56 pm

Hi Demetrio,

Yes, it seems that the hour is not rounded or calculated correctly. So I've added this to the wish list to be fixed in future releases.
In the meanwhile you could force the 00:00 time to be shown as follows:

Code: Select all

chart.getAxes().getBottom().getLabels().setDateTimeFormat("d 00:00");
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Problem with setRoundFirstLabel

Post by Dmitry » Fri Jul 31, 2009 3:40 pm

Set chart.getAxes().getBottom().getLabels().setDateTimeFormat("d 00:00"); is not correctly.
Just you changed label but not axis. I'l like that FIRST axis set to 00:00 and next... next... next

I use area chart with series.setStairs(true); and I set left border to 00:00:00(N - value) and right border 23:59:59( 0 - value) for my histogram

Code: Select all

						com.steema.teechart.DateTime dd = new com.steema.teechart.DateTime(cStart.getTime().getTime());
						series.add(dd, value);

						dd = new com.steema.teechart.DateTime(cRight.getTime().getTime());
						series.add(dd, 0);

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Problem with setRoundFirstLabel

Post by Dmitry » Fri Jul 31, 2009 5:48 pm

How can I set first Label for DateTime axis?

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Problem with setRoundFirstLabel

Post by Dmitry » Sun Aug 02, 2009 4:52 pm

I've decided my problem so TimeZone.setDefault(TimeZone.getTimeZone("GMT+0"));
I'm waiting your bug fix.
Best regards
Dmitry

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with setRoundFirstLabel

Post by Yeray » Tue Aug 04, 2009 10:30 am

Hi Dmitry,

I'm not sure to understand your problem. Is it possible that you are looking for SetMinMax axis function?
If not, could you please attach a simple example project we can run as-is to reproduce the problem here?

Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Dmitry
Newbie
Newbie
Posts: 54
Joined: Mon Jul 27, 2009 12:00 am
Contact:

Re: Problem with setRoundFirstLabel

Post by Dmitry » Tue Aug 04, 2009 1:10 pm

Yes I use function setMinMax(c1, c2) c1=00:00:00 c2=23:59:59

if set setRoundFirstLabel = true first vertical axis is 4:00:00 ( for my GMT +3)
if i set GMT+0 first vertical axis is 00:00:00 ( correct for me)

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with setRoundFirstLabel

Post by Yeray » Tue Aug 04, 2009 1:41 pm

Hi Dmitry,

Then I'm afraid that you probably should translate your dates to GMT+0 before using them as dates.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply