whitespace COMPANY whitespace SERVICES whitespace PRODUCTS whitespace PURCHASE whitespace SUPPORT whitespace CONTACTS whitespace Home whitespace Contact Us whitespace Site Map whitespace
whitespace
SUPPORT
whitespace
FORUM
whitespace
FAQS
whitespace
SUBSCRIPTION
whitespace
REQUEST ON-LINE
whitespace
whitespace

Technical Support Forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Rabish  
#1 Posted : Friday, February 15, 2013 10:52:32 AM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Hi,

I am using maximum value 2013 and minimum value -360. These values I am getting from xml.

Below are the written codes:
chartArea.getDefaultYAxis().getScale().setMaximum(max);
chartArea.getDefaultYAxis().getScale().setMinimum(min); ChartArea.getDefaultYAxis().getScale().setInterval(Double.valueOf(max/4f));

I tried with setOrigin() also but no help, On Y-Axis -360 is not coming.
chartArea.getDefaultYAxis().setOrigin(min);

But when I used interval as 100.0, -ve values came on y-axis. Please refer to attached screenshots.
But I need axis value from -360 to 2013 with 4 or 5 intervals.
Max and min value can be any thing, like 200000 and -100.
[img][/img]

Please help.

Thanks
Rabish attached the following image(s):
Chart1.jpg (51kb) downloaded 41 time(s).
Chart2.jpg (88kb) downloaded 38 time(s).

You cannot view/download attachments. Try to login or register.
Rabish  
#2 Posted : Friday, February 15, 2013 1:03:16 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

One more question..

If max value is too large like 20000000.0, can I show on axis as 2.E7?

Please suggest a way to do this :)

Thanks
Rabish  
#3 Posted : Friday, February 15, 2013 1:59:41 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Scientific notation I am able to achieve using a format like below:

DecimalFormat formatter = new DecimalFormat("0.####E0");
chartArea.getDefaultYAxis().setLabelFormat(formatter);

But I am getting 0 as 0E0. Is There any way to make it again zero? I want to show zero as 0 only.
Rabish  
#4 Posted : Tuesday, February 19, 2013 1:34:21 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Can please someone from support will reply to my these two questions?
Rabish  
#5 Posted : Wednesday, February 27, 2013 1:08:58 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Any update on this?
Baydalka Volodymyr  
#6 Posted : Wednesday, February 27, 2013 2:38:18 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Default labels adapter chooses zero as more better value to start labels generation. In your case you need something simpler.

Try to implement your own labels adapter. Example:

Code:
ChartAxis.LabelsAdapter SIMPLE_ADAPTER = new ChartAxis.LabelsAdapter()
{
	@Override
	public void updateLabels(ChartAxis axis, List output)
	{
		output.clear();
		
		double min = axis.getScale().getVisibleMinimum();
		double max = axis.getScale().getVisibleMaximum();
		double step = (max - min) / 4;

		for (double p = min; p <= max; p += step) 
		{
			output.add(new Label(String.format("%.2e", p), p));
		}				
	}
};

chartArea.getDefaultYAxis().setLabelsAdapter(SIMPLE_ADAPTER);


Best regards,
Volodymyr Baydalka
Andriod development and support team
Rabish  
#7 Posted : Thursday, March 21, 2013 2:33:19 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Hello,

After using suggested adapter I am not getting horizontal grids. Please help.

Regards,
Rabish
Baydalka Volodymyr  
#8 Posted : Friday, March 22, 2013 3:31:04 PM(UTC)
Baydalka Volodymyr
Rank: Member

Groups: Registered
Joined: 7/28/2009(UTC)
Posts: 447
Man

Hi,

Try change next line :
Code:

//from 
output.add(new Label(String.format("%.2e", p), p));
//to
output.add(new Label(String.format("%.2e", p), p, Label.OPTION_ALL));


Best regards,
Volodymyr Baydalka
Andriod development and support team
Rabish  
#9 Posted : Friday, March 22, 2013 4:05:39 PM(UTC)
Rabish
Rank: Member

Groups: Registered
Joined: 2/11/2013(UTC)
Posts: 24
Location: Bangalore

Thanks, suggested change is working.


Best Regards,
Rabish
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Company | Services | Practices | Technologies | Career | Contacts | Privacy
© 2005-2017 ArtfulBits. All rights reserved.