iOSCharts 5.1.0

dotnet add package iOSCharts --version 5.1.0
                    
NuGet\Install-Package iOSCharts -Version 5.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="iOSCharts" Version="5.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="iOSCharts" Version="5.1.0" />
                    
Directory.Packages.props
<PackageReference Include="iOSCharts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add iOSCharts --version 5.1.0
                    
#r "nuget: iOSCharts, 5.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package iOSCharts@5.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=iOSCharts&version=5.1.0
                    
Install as a Cake Addin
#tool nuget:?package=iOSCharts&version=5.1.0
                    
Install as a Cake Tool

iOSCharts

.NET for iOS binding of Charts 5.1.0 (DGCharts), the iOS charting library by Daniel Cohen Gindi, inspired by Philipp Jahoda's MPAndroidChart. Line, bar, horizontal bar, pie, scatter, candle stick, bubble, radar and combined charts, with animations, highlighting, markers, legends and value formatters.

The binding is by Lucas Teixeira (@flash3001). Source and issues: https://github.com/Flash3001/iOSCharts.Xamarin

Requirements

Target framework net10.0-ios (.NET 10 SDK with the ios workload)
Xcode 26.x. Built and verified with Xcode 26.6
Minimum iOS 12.2 (the .NET default; DGCharts itself supports iOS 12+)
Architectures device arm64; simulator arm64 and x86_64 (Apple-silicon simulators included)
Dependencies none. The Swift 5 ABI is stable, so the Xamarin.Swift* packages the 3.x versions required are gone

The native library ships as DGCharts.xcframework inside a .NET binding resource package; nothing else has to be added to your app.

Install

dotnet add package iOSCharts

Quick start

using iOSCharts;

var chart = new LineChartView(View.Bounds);
View.AddSubview(chart);

var entries = Enumerable.Range(0, 12)
    .Select(i => new ChartDataEntry(i, Math.Sin(i / 2.0) * 10 + 20))
    .ToArray();

var set = new LineChartDataSet(entries, "Temperature")
{
    Mode = LineChartMode.CubicBezier,
    LineWidth = 2,
    DrawCirclesEnabled = false,
    DrawFilledEnabled = true,
    Fill = new ChartColorFill(UIColor.SystemBlue),
    FillAlpha = 0.3f,
};
set.Colors = ChartColorTemplates.Material;

chart.Data = new LineChartData(new IChartDataSetProtocol[] { set });
chart.XAxis.ValueFormatter = new ChartIndexAxisValueFormatter(
    new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" });
chart.LeftAxis.AddLimitLine(new ChartLimitLine(25, "target"));
chart.RightAxis.Enabled = false;
chart.Legend.Form = ChartLegendForm.Line;
chart.AnimateWithXAxisDuration(1.0, ChartEasingOption.EaseInOutQuart);

Every chart type follows the same shape: XxxChartView, XxxChartData, XxxChartDataSet, XxxChartDataEntry.

Implementing the Charts protocols in C#

Charts exposes formatters, markers, delegates, highlighters and renderers as Swift protocols. In the binding each protocol has an I… interface and a model base class of the same name. Subclass the model class and override what you need; pass the instance anywhere the interface is expected.

class CurrencyFormatter : ChartValueFormatter
{
    public override string StringForValue(double value, ChartDataEntry entry, nint dataSetIndex,
                                          ChartViewPortHandler? viewPortHandler)
        => value.ToString("C0");
}

class SelectionDelegate : ChartViewDelegate
{
    public override void ChartValueSelected(ChartViewBase chartView, ChartDataEntry entry, ChartHighlight highlight)
        => Console.WriteLine($"x={entry.X} y={entry.Y}");
    public override void ChartValueNothingSelected(ChartViewBase chartView) { }
}

class DotMarker : ChartMarker
{
    public override CGPoint Offset => CGPoint.Empty;
    public override CGPoint OffsetForDrawingAtPoint(CGPoint point) => CGPoint.Empty;
    public override void RefreshContentWithEntry(ChartDataEntry entry, ChartHighlight highlight) { }
    public override void DrawWithContext(CGContext context, CGPoint point)
    {
        context.SetFillColor(UIColor.Red.CGColor);
        context.FillEllipseInRect(new CGRect(point.X - 6, point.Y - 6, 12, 12));
    }
}

set.ValueFormatter = new CurrencyFormatter();
chart.Delegate = new SelectionDelegate();
chart.Marker = new DotMarker();

Available protocols: ChartDataSetProtocol and its per-chart specialisations (LineChartDataSetProtocol, BarChartDataSetProtocol, …), ChartDataProvider and specialisations, ChartValueFormatter, ChartAxisValueFormatter, ChartFillFormatter, ChartFill, ChartMarker, ChartViewDelegate, ChartAnimatorDelegate, ChartHighlighterProtocol, ChartRenderer, ChartDataRenderer, ShapeRenderer.

Upgrading from iOSCharts 3.2.x

Charts 5 is a breaking release upstream; see the Charts changelog. On the binding side the Swift protocols were renamed, so the old IInterface… names are gone:

3.2.x 5.1.0
IInterfaceChartDataSet / InterfaceChartDataSet IChartDataSetProtocol / ChartDataSetProtocol
IInterfaceLineChartDataSet, IInterfaceBarChartDataSet, … ILineChartDataSetProtocol, IBarChartDataSetProtocol, …
IInterfaceChartValueFormatter / InterfaceChartValueFormatter IChartValueFormatter / ChartValueFormatter
IInterfaceChartAxisValueFormatter IChartAxisValueFormatter / ChartAxisValueFormatter
IInterfaceChartFillFormatter IChartFillFormatter / ChartFillFormatter
IInterfaceChartMarker / InterfaceChartMarker IChartMarker / ChartMarker
IInterfaceChartHighlighter IChartHighlighterProtocol / ChartHighlighterProtocol (the ChartHighlighter class is unchanged)
IInterfaceShapeRenderer IShapeRenderer / ShapeRenderer
ChartRenderer, ChartDataRendererBase, ChartAxisRendererBase classes IChartRenderer / IChartDataRenderer protocols; axis renderers derive from NSObject
ChartFill class and ChartFillType enum IChartFill protocol with ChartColorFill, ChartLinearGradientFill, ChartRadialGradientFill, ChartImageFill, ChartLayerFill, ChartEmptyFill
Xamarin.Swift NuGet dependency none
xamarinios10 net10.0-ios

Everything else (LineChartView, ChartDataEntry, ChartLimitLine, ChartLegend, the enums, …) keeps its name.

License

Apache License 2.0. Copyright 2016-2026 Lucas Teixeira, Daniel Cohen Gindi & Philipp Jahoda.

Product Compatible and additional computed target framework versions.
.NET net10.0-ios26.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-ios26.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on iOSCharts:

Package Downloads
UltimateXF

A powerful Android/iOS chart view / graph view library, binding support for Xamarin.Forms, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on iOSCharts:

Repository Stars
bulubuloa/Ultimate-Xamarin-Forms-KIT
A powerful 🚀 Android/iOS chart view / graph view library, binding support for Xamarin.Forms, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, dragging and animations.
Version Downloads Last Updated
5.1.0 0 9/15/2026
3.2.2.3 13,881 3/18/2025
3.2.2.2 12,499 2/2/2024
3.2.2.1 62,719 4/23/2019
3.2.2 1,062 4/3/2019
3.2.2-alpha2 764 4/2/2019
3.2.2-alpha 742 4/1/2019
3.2.1 6,727 11/7/2018
3.2.0 4,101 9/18/2018
3.1.1.2 11,873 5/10/2018
3.1.1.1 1,713 4/9/2018
3.1.1 1,740 4/7/2018
3.0.4 4,278 9/27/2017
3.0.2 4,027 4/3/2017
3.0.1.1 2,490 11/24/2016
3.0.1 1,498 11/23/2016
3.0.0.4 1,509 11/23/2016
3.0.0.3 1,824 10/28/2016
3.0.0.2 1,445 10/26/2016
3.0.0.1 1,485 10/21/2016
Loading failed

Charts (DGCharts) 5.1.0 as an xcframework (device arm64, simulator arm64 + x86_64). .NET 10 / Xcode 26.6. Breaking changes: https://github.com/ChartsOrg/Charts/blob/master/CHANGELOG.md