XamarinAndroidTutorial3

From Steema Software Reference Wiki
Revision as of 15:18, 14 February 2014 by Clive (Talk | contribs) (Paging by code)

Jump to: navigation, search

File:XamarinAndroidHeaderLogo.gif

Contents page
Previous | Next


Tutorial 3 - Chart Paging

If the data source for your Chart contains more data than can legibly be displayed on one Chart screen you may wish to divide the Chart into pages that can be leafed through. This can be achieved programmatically.

[#CodePaging Paging by code]

Paging by code

Paging properties and methods are available via the Page class.
Steps required to add paging to your Chart:

  • Define Points per page
[C#.Net] 
tChart1.Page.MaxPointsPerPage = 10;


  • Add Navigation buttons to the Chart's Form.
[C#.Net] 
tChart1.Page.Current = 0;
[C#.Net] 
tChart1.Page.Next();
[C#.Net] 
tChart1.Page.Previous();
[C#.Net] 
tChart1.Page.Current = tChart1.Page.Count;
  • Decide what to do with the last page.
[C#.Net] 
tChart1.Page.ScaleLastPage = false;   (default = true)
  • Show the user a page number
[C#.Net] 
private void Initialize()
{
     Bar bar1 = new Bar();
     PageNumber pageNumber1 = new PageNumber();
     tChart1.Series.Add(bar1);
     tChart1.Tools.Add(pageNumber1);
     bar1.FillSampleValues(100);
     tChart1.Page.MaxPointsPerPage = 10;
}

        button1.Click = delegate
        {
          tChart1.Page.Previous();
        };  

        button2.Click = delegate
        {
          tChart1.Page.Next();
        };

PREVIOUS

NEXT


© 1998-2014 Steema Software SL. All rights reserved.