Skip to content

iXamDev/xcharts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XCharts.iOS

This is the lightweight C# chart rendering library for Xamarin iOS.

At this moment there are two views of charts:

  • LineChartView - simple enough, used to display line charts. Allows you flexibly customize its style.
  • ChartView - allows you to display any type of charts by implementing custom render.

Samples

Line chart Line chart


Quick start

  1. Install nuget package XCharts.iOS
  2. Add ChartView to View. You can do it in xib or by code like:
var lineChart = new LineChartView();

lineChart.TranslatesAutoresizingMaskIntoConstraints = false;

this.View.AddSubview(lineChart);

NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[]
{
   lineChart.TopAnchor.ConstraintEqualTo(View.TopAnchor),
   lineChart.BottomAnchor.ConstraintEqualTo(View.BottomAnchor),
   lineChart.LeftAnchor.ConstraintEqualTo(View.LeftAnchor),
   lineChart.RightAnchor.ConstraintEqualTo(View.RightAnchor)
});
  1. Set chart datasource:
var points = new List<double>();
var r = new Random();
for (int i = 0; i < 1000; i++)
{
   points.Add(r.Next(0, 10000));
}

lineChart.DataSource = new IndexValueDataSource(points);

About

XCharts - charts library for Xamarin iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages