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 Search | Active Topics | Log In | Register

2 Pages <12
Set Range does not give Vertcail Grids Options · View
Baydalka Volodymyr
#21 Posted : Thursday, December 20, 2012 7:12:17 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

Please, check [aiChartsPackage]\Samples\Axes.Customization\DateTimeSample sample from aiCharts package.

In general case you need:
1) change aixs value type - ChartAxis.setValueType(ChartAxis.ValueType.Date);
2) (optional) set label format ChartAxis.setLabelFormat(new SimpleDateFormat("HH:mm:ss"));
3) recommended to use ChartSeries.getPoints().addDate() to add points
4) recommended to use ChartAxis.getScale().setDateRange() to specify axis range.

Also there is documentation regarding axis labels - http://docs.artfulbits.c...d/guide/axislabels.html

Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#22 Posted : Thursday, December 20, 2012 7:22:50 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Actually i am having x-axis label format "HH:mm:ss" by string formatter. So i just added to the series like elapsed seconds. And if i set valuetype as date then it coming as default time like 5.30. I need to add my string with the format "HH:mm:ss" to the x-axis. How can i achieve this?
Baydalka Volodymyr
#23 Posted : Thursday, December 20, 2012 7:26:32 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

In what way do you add points?

If you adds points like this

series.getPoints().addXY(1, value1);
series.getPoints().addXY(2, value2);
series.getPoints().addXY(3, value3);

you add points with interval in 1 millisecond.

Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#24 Posted : Thursday, December 20, 2012 7:29:33 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

I will be adding points like

ChartPtCollect.addXY(dummyvalue, yaxis value))).setAxisLabel(TIMER_CLOCK.getText().toString()//my hh:mm:ss formatted string);
Baydalka Volodymyr
#25 Posted : Thursday, December 20, 2012 7:46:17 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

ChartPoint.setAxisLabel doesn't work with default label adapter. Default labels adapter uses axis range, interval and label format(ChartAxis.getScale().setRange/setInterval) to gaenerates labels.
Other labels adapters doesn't generate labels outside of points. You may implements your own labels adapter if you want - Samples\New.Features\CustomLabelsAdapterSample

Using of method getPoints().addXY with ValueTYpe.Date is not right. You should use getPoints().addDate() instead. Otherwise you will add points with interval in 1 millisecond.

Docs : http://docs.artfulbits.c...d/guide/axislabels.html

Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#26 Posted : Thursday, December 20, 2012 7:52:19 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

COuld you please send me sample to create custom adapter with the axis label as "HH:mm:yy" format and with grids always. And also i can't set time from date also as i need to display elapsed time it may be 30hrs or more. Please help me to do this?
Vinoth
#27 Posted : Thursday, December 20, 2012 8:36:10 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

I am not able to get the date format as HH:mm:ss. Please help me on this
Vinoth
#28 Posted : Friday, December 21, 2012 9:38:27 AM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Could you please tell me how to create the custom adapter to achieve my requirement?
Baydalka Volodymyr
#29 Posted : Friday, December 21, 2012 1:25:22 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

Why do you don't want to use method addDate(date, y)? What type of TIMER_CLOCK ?

ChartArea area = new ChartArea();
ChartSeries serie = new ChartSeries();

serie.getPoints().addDate(date1, value1);
serie.getPoints().addDate(date2, value2);

area.getDefaultXAxis().setValueType(ValueType.Date);

Anyway, if you want to create custom labelAdapter it's your decision. It's very ease. You just need implement LabelsAdapter interface with single method updateLabels. But you should implement with your specific logic.


Volodymyr Baydalka
Andriod development and support team
Vinoth
#30 Posted : Friday, December 21, 2012 1:58:08 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Actually i am getting now the x axis value as 05:30 as default. I just want to replace this with my timer like 00:00:00..00:00:10..00:00:20...etc., With setting smart adapter i am getting properly but without grids. As i dont know the exact implementation of your source code, i just want a adapter class that will solve the grid problem during setRange.
Vinoth
#31 Posted : Friday, December 21, 2012 1:58:53 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Actually i am getting now the x axis value as 05:30 as default. I just want to replace this with my timer like 00:00:00..00:00:10..00:00:20...etc., With setting smart adapter i am getting properly but without grids. As i dont know the exact implementation of your source code, i just want a adapter class that will solve the grid problem during setRange.
Vinoth
#32 Posted : Friday, December 21, 2012 2:02:40 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Attached screenshot without setting SmartAdapter.
Vinoth attached the following image(s):
Without Smart Adapter.png (84kb) downloaded 36 time(s).
Baydalka Volodymyr
#33 Posted : Friday, December 21, 2012 2:20:17 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

Yep. It's because you don't set real date value for points and all points is set to 5:30 regarding you time-zone. Use getPoints().addDate or ChartPoint.setDate to set real date value.

Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#34 Posted : Friday, December 21, 2012 2:22:19 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

I am not able to add the string "HH:mm:ss" as a Date object. Please provide me the label adapter class with grid bug solve. Please do help on this.
Baydalka Volodymyr
#35 Posted : Friday, December 21, 2012 3:13:36 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

It's not a bug. You just use it in wrong way.

Quote:
I am not able to add the string "HH:mm:ss" as a Date object.


You just need to understand what you really want to show to your customers.

In option I can provide you simple sample of custom labels adapter.

Code:
class PointsLabelAdapter implements ChartAxis.LabelsAdapter
{
    private final ChartSeries mSeries;
    
    public PointsLabelAdapter(ChartSeries series)
    {
        mSeries = series;
    }
    
    @Override
  public void updateLabels(ChartAxis axis, List output)
  {
        ChartAxisScale scale = axis.getScale();
        output.clear();
        
        int start = (int) scale.getVisibleMinimum();
        int end = (int) scale.getVisibleMaximum();
        int step = (int) scale.getVisibleInterval();
        
        for(int p = start; p < end; p += step)
        {
            String labelText = "";
            
            if(p < mSeries.getPoints().size())
                labelText = mSeries.getPoints().get(p).getAxisLabel();
            
            output.add(new Label(labelText, p));
        }
  }
}

...

chartArea.getDefaultXAxis().setLabelsAdapter(new PointsLabelAdapter(chartSeries));


Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#36 Posted : Friday, December 21, 2012 8:29:28 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

I know the sample adapter class from sample document. But i want to know whether the above code will work for my requirement. If i add the date as my x-axis value then the graph is not smooth and also i am facing some issues and difficulties. So only i am asking you to give me the implementation as you know the full aiChart behavior.
Vinoth
#37 Posted : Wednesday, January 02, 2013 4:25:03 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

Could you please provide the required custom class file. I need it urgently. Please help me on this ASAP.
Baydalka Volodymyr
#38 Posted : Wednesday, January 02, 2013 6:07:08 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

Provided sample code does what you need, doesn't it?

Best regards,
Volodymyr Baydalka
Andriod development and support team
Vinoth
#39 Posted : Wednesday, January 02, 2013 6:37:41 PM
Rank: Advanced Member

Groups: Registered

Joined: 4/25/2012
Posts: 68
Location: India
Hi,

As you mentioned like simple sample for the above code, will it fulfill my requirement?
Users browsing this topic
Guest
2 Pages <12
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-2016 ArtfulBits. All rights reserved.