Difference between revisions of "XamarinAndroidTutorial3"

From Steema Software Reference Wiki
Jump to: navigation, search
(Paging by code)
(Paging by code)
Line 37: Line 37:
  
 
* Show the user a page number
 
* Show the user a page number
  [C#.Net] <br />private void Initialize() <br />{ <br />     Bar bar1 = new Bar(); <br />     PageNumber pageNumber1 = new PageNumber(); <br />     tChart1.Series.Add(bar1); <br />     tChart1.Tools.Add(pageNumber1); <br />     bar1.FillSampleValues(100); <br />     tChart1.Page.MaxPointsPerPage = 10; <br />} <br /> <br />        button1.Click  = delegate <br />        { <br />          tChart1.Page.Previous(); <br />        };  <br /> <br />        button2.Click  = delegate <br />        { <br />          tChart1.Page.Next(); <br />        };  <br />
+
  [C#.Net] <br />private void Initialize() <br />{ <br />     Bar bar1 = new Bar(); <br />     PageNumber pageNumber1 = new PageNumber(); <br />     tChart1.Series.Add(bar1); <br />     tChart1.Tools.Add(pageNumber1); <br />     bar1.FillSampleValues(100); <br />     tChart1.Page.MaxPointsPerPage = 10; <br />} <br /> <br />        button1.Click  = delegate <br />        { <br />          tChart1.Page.Previous(); <br />        };  <br /> <br />        button2.Click  = delegate <br />        { <br />          tChart1.Page.Next(); <br />        };
<br /><br /><br /><br />[TeeChartProNetTutorialsContentsTutorial2-ChartDisplayProperties.htm [[Image:backtut.png]]][TeeChartProNetTutorialsContentsTutorial4-AxisControl.htm [[Image:fwdtut.png]]]
+
 
+
 
----
 
----
  

Revision as of 15:18, 14 February 2014

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.