Net.iOS.Charts
0.0.1-beta3
dotnet add package Net.iOS.Charts --version 0.0.1-beta3
NuGet\Install-Package Net.iOS.Charts -Version 0.0.1-beta3
<PackageReference Include="Net.iOS.Charts" Version="0.0.1-beta3" />
paket add Net.iOS.Charts --version 0.0.1-beta3
#r "nuget: Net.iOS.Charts, 0.0.1-beta3"
// Install Net.iOS.Charts as a Cake Addin
#addin nuget:?package=Net.iOS.Charts&version=0.0.1-beta3&prerelease
// Install Net.iOS.Charts as a Cake Tool
#tool nuget:?package=Net.iOS.Charts&version=0.0.1-beta3&prerelease
This is .NET iOS binding of danielgindi iOS Charts (DGCharts) library
Be aware, library is beta
Not all functionality may be available (like, some setters missing or something) and not all demos and no tests was ported to C#. If you observe any problem – open new issue to prioritize its fix.
Known issues
Sometimes GC can remove class reference of value of properties, which declared type is protocol interfaces.
You can observe this issue in DataSets property of any ChartDataSet subclass. Create some set (e.g. LineChartDataSet), wrap it into array and then set to DataSets property of you LineChartView.Data property. Then after some time try to get this set from DataSets property and cast it to LineChartDataSet and you will observe that it is impossible, as type of this set is ChartDataSetWrapper instead of LineChartDataSet. There is (looks like) similar issue on Xamarin GitHub and workaround for this situation can be found there: instead of using C# casting use
Runtime.GetINativeObject<IProtocolName> (handler.WeakClient.Handle, false);
Launch screen does not work
Suppose it is due to fact that it is in non-standard path for .NET iOS (by default it is in root, here in Resources folder).
ApiDefinition contains setters for properties in protocol interfaces, that doesn't has setters in source protocols.
Example of such protocol is ChartDataProvider: the Data
property in ApiDefinition has setter, while correspondent
data
property in original protocol doesn't. It is because Data
property in LineChartView
class
(that conforms that ChartDataProvider protocol) has setter.
You can see in ApiDefinition that ChartViewBase
(one of LineChartView
's base classes) conforms ChartDataProvider
protocol and, moreover, has setter for Data
property, but LineChartView
, that inherits ChartViewBase
doesn't.
It looks like it is because of reimplementation of IChartViewProvider
interface (of ChartViewProvider
protocol) and,
hence, inlining all its required properties (such as Data
) with required signature (so without setter).
Unfortunately, I haven't found any way to prevent this behavior and looks like there is no one for now.
You can check open .NET iOS issue that is (probably) causing this: https://github.com/xamarin/xamarin-macios/issues/3217
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-ios17.2 is compatible. |
-
net8.0-ios17.2
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.0.1-beta3 | 55 | 3/12/2024 |
0.0.1-beta2 | 148 | 12/4/2023 |
0.0.1-beta | 63 | 12/1/2023 |