[Teechart Android]show X-Axis each day only from 9am to 6pm?

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
micha
Newbie
Newbie
Posts: 9
Joined: Thu Jul 05, 2012 12:00 am

[Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by micha » Wed Jul 11, 2012 10:05 am

Hi! I am using TeeChart for android.
I am setting the scale of the x-Axis to DateTime
bottomChart.getAxes().getBottom().setIncrement(Utils.getDateTimeStep(DateTimeStep.ONEDAY));
bottomChart.getAxes().getBottom().getLabels().setDateTimeFormat("dd.MM.yyyy");

But i only wanna show the time range for a 7-days-chart from 9.00am to 6.00pm for each day, not 24 hours
same problem when i a using DateTimeStep.ONEMONTH or ONEWEEK

How i solve it? I cannot find a example.

Thanks for ur help!

Michael

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

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by Yeray » Thu Jul 12, 2012 11:09 am

Hi Michael,

I'm not sure to understand what do you exactly mean. However, I guess it should be possible to use the getLabel event (through the Chat's AxisLabelResolver) to format or hide (setting an empty string) the desired axis labels.

If you still have problems with it, please try to arrange 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

micha
Newbie
Newbie
Posts: 9
Joined: Thu Jul 05, 2012 12:00 am

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by micha » Thu Jul 12, 2012 12:23 pm

The documentation of AxisLabelResolver is not the best. Do u have an example how to use it?

micha
Newbie
Newbie
Posts: 9
Joined: Thu Jul 05, 2012 12:00 am

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by micha » Thu Jul 12, 2012 1:15 pm

Ok i cannot send u the project but with a picture u will findout what i what to achieve

This a week chart with a Daystep as increment
week.png
week.png (30.51 KiB) Viewed 16105 times
But i wanna display the chart only from 9am to 6pm
For example here:
week1.png
week1.png (32.51 KiB) Viewed 16106 times
The solution would be the chart without the orange gaps.
Any idea?

Thanks for ur help

Michael

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

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by Yeray » Thu Jul 12, 2012 2:32 pm

Hi Michael,
micha wrote:The documentation of AxisLabelResolver is not the best. Do u have an example how to use it?
Here you have it:

Code: Select all

		tChart1.setAxisLabelResolver(new AxisLabelResolver() {
			
			@Override
			public void scrollModHandler(Axis a, ScrollModEventArgs e) { }
			
			@Override
			public NextAxisLabelValue getNextLabel(Axis axis, int labelIndex, NextAxisLabelValue nextLabel) {
				return nextLabel;
			}
			
			@Override
			public String getLabel(Axis axis, ISeries s, int valueIndex, String labelText) {
				if (axis == tChart1.getAxes().getBottom()) {
					//modify labelText when needed
				}
				return labelText;
			}
		});
micha wrote:The solution would be the chart without the orange gaps.
Any idea?
It sound pretty much what Axis Break tool does. Please, take a look at the example at "What's new?\Welcome!\New Chart tools\Axis breaks" in the features demo included with the TeeChart Java installation (desktop version). If you only have the TeeChart Java for Android version, you can download the TeeChart Java evaluation version to see the examples the desktop version includes.
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

micha
Newbie
Newbie
Posts: 9
Joined: Thu Jul 05, 2012 12:00 am

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by micha » Mon Jul 16, 2012 6:16 am

ok thanks the Axis Break tool seems to be the solution.
But one more question. How can i prevent the overlapping of axis label when i use the axis break tool?

Thanks again.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: [Teechart Android]show X-Axis each day only from 9am to 6pm?

Post by Narcís » Mon Jul 16, 2012 11:33 am

Hi micha,

Can you please attach a simple example project we can run "as-is" to reproduce the problem here? A general option could be using custom axis labels as in the examples at the All Features\Welcome!\Axes\Labels section in the TeeChart.Features.jar demo.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply