Skip to content

AndreCL/Oxyplot.DotNetAndroid

Repository files navigation

OxyPlot.DotNetAndroid

High-performance charting library for .NET 10 Android applications using OxyPlot.

Nuget CodeQL Build Nuget Package .NET Android License

Features

  • Chart Types: Line, Bar, Scatter, Pie, Real-time, Multi-series
  • Touch Gestures: Pan, zoom, pinch with native Android support
  • High Performance: Hardware-accelerated rendering
  • Customizable: Themes, colors, fonts, and styling options

Quick Start

using OxyPlot.DotNetAndroid;
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.Axes;

// Create PlotView
var plotView = new PlotView(context);

// Create chart model
var model = new PlotModel { Title = "Sample Chart" };
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left });

// Add data series
var series = new LineSeries { Title = "Data", Color = OxyColors.Blue };
for (int i = 0; i < 100; i++)
{
    series.Points.Add(new DataPoint(i * 0.1, Math.Sin(i * 0.1)));
}
model.Series.Add(series);

// Assign and render
plotView.Model = model;
plotView.Invalidate();

Chart Examples

Line Chart

var model = new PlotModel { Title = "Line Chart" };
var series = new LineSeries { Color = OxyColors.Blue };
// Add data points...
model.Series.Add(series);
plotView.Model = model;

Bar Chart

var model = new PlotModel { Title = "Bar Chart" };
var barSeries = new BarSeries();
barSeries.Items.Add(new BarItem { Value = 25 });
// Add more items...
model.Series.Add(barSeries);

Scatter Plot

var model = new PlotModel { Title = "Scatter Plot" };
var scatterSeries = new ScatterSeries { MarkerType = MarkerType.Circle };
// Add scatter points...
model.Series.Add(scatterSeries);

Touch Interactions

  • Pan: Drag to move around the chart
  • Zoom: Pinch to zoom in/out
  • Reset: Double-tap to reset view
  • Tracker: Tap data points for details

Requirements

  • .NET 10 Android target framework
  • Android API Level 21 (Android 5.0) or higher
  • OxyPlot.Core and OxyPlot.SkiaSharp dependencies

Sample Application

Clone and run the included sample:

git clone https://github.com/AndreCL/Oxyplot.DotNetAndroid.git
cd Oxyplot.DotNetAndroid
dotnet run --project Sample.OxyPlot.Android

License

MIT License - see LICENSE for details.

Support

Built on OxyPlot with SkiaSharp rendering.

About

.NET Android Oxyplot view

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages