Code Monkey home page Code Monkey logo

microcharts's Introduction

Microcharts

Mac Builds Windows Builds

Looking for more contributors

Version 1.0.0 Beta is now available

NuGet

NuGet

NuGet

NuGet

NuGet

Microcharts is an extremely simple charting library for a wide range of platforms (see Compatibility section below), with shared code and rendering for all of them!

read our wiki to learn more about how to use this library.

About

This project is just simple drawing on top of the awesome SkiaSharp library. The purpose is not to have an heavily customizable charting library. If you want so, simply fork the code, since all of this is fairly simple. Their is no interaction, nor animation at the moment.

Contributions

Contributions are welcome! If you find a bug please report it and if you want a feature please report it.

If you want to contribute code please file an issue and create a branch off of the current dev branch and file a pull request.

More info on how you can help can be found here.

Gallery

animation gallery

gallery

Install

Available on NuGet

NET Standard 2.0, Xamarin.iOS, Xamarin.Android, UWP

NuGet

Xamarin.Forms (.NET Standard 2.0)

NuGet

.NET MAUI

Not yet available through NuGet.

Important

Don't forget to call UseMicrocharts() on MauiAppBuilder in the MauiProgram class.

Tutorials

Compatibility

Built in views are provided for:

  • UWP
  • Xamarin.Forms, Xamarin.iOS and Xamarin.Android, Xamarin.macOS
  • .NET MAUI (Windows, Android, iOS, and macOS)
  • WinUI (Windows App SDK)
  • And any other .NET Standard 2.0 SkiaSharp supported platform is also compatible (see one of the included ChartView implementations for more details).

License

MIT © Aloïs Deniel & Ed Lomonaco

microcharts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

microcharts's Issues

FontSize for labels

Please add FontSize for labels.
How does look charts now in FullHD displays:
image

Class Library (Portable Legacy) Compatibility

Project Type: Native Android & iOS (not forms)

I'm trying to add Microcharts to a "Class Library (Legacy Portable)" project, but the latest version (0.7.0) won't install because it's not compatible. However, 0.5.2 installs fine. .Net Standard is the future, so I'd like to ditch Legacy Portable, but my project is structured around ReactiveUI and the latest stable version (7.4.0) is not .Net Standard compatible.

EDIT: (9/19/2017)

I found this ReactiveUI link that solves my problem: https://reactiveui.net/docs/getting-started/netstandard
Regardless, it may worthwhile to add support for Portable Legacy, since libs are still in the process of migrating to .Net Standard.

Thank you for this simple, yet quality package!

Overlapping of labels in doughnut.

dx

As you can see that two labels are overlapping when values are small relatively and close to each other.Can anybody guide me how to resolve this.

set_chart method not defined error in 0.80pre to 0.83pre

In the new pre-releases forms package including 0.80pre to 0.83pre, doing a simple chart based on the GitHub example like
chartView.Chart=new BarChart() { Entries = entries };
would throw the set_chart method not defined error. the same code works well in 0.62. can't test it in 0.70/0.71 due to .net compatibility errors.

System.Reflection.TargetInvocationException

Hi, I followed the steps on Quickstart section and I get this error when I try to run the application:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

any suggestions???

Create Xamarin.Forms Entry binding

Hi @aloisdeniel,
First of all, congratulations for the library. Great work!

I started trying it to be able to talk about it during the next event in my community.
I created Xamarin.Forms projects but I did not find the binding for Entry object (next ChartEntries).
I thought about creating a new custom object for every chart available.
This is an example of a code, what do you think?

public class MicroDonutChart : Microcharts.Forms.ChartView
{
    public MicroDonutChart()
    {
         Chart = new DonutChart();
    }
    public IEnumerable<Microcharts.Entry> ChartEntries
    {
         get { return (IEnumerable<Microcharts.Entry>)GetValue(ChartEntriesProperty); }
         set { SetValue(ChartEntriesProperty, value); }
    }

    public static readonly BindableProperty ChartEntriesProperty = 
        BindableProperty.Create("ChartEntries", 
             typeof(IEnumerable<Microcharts.Entry>), 
             typeof(IEnumerable<Microcharts.Entry>), 
             null,
             propertyChanged: HandleChartEntriesChanged);

    static void HandleChartEntriesChanged(BindableObject bindable, object oldValue, object newValue)
    {
        ((MicroDonutChart)bindable).Chart.Entries = (IEnumerable<Microcharts.Entry>)newValue;
    }
}

XAML part:

<local:MicroDonutChart ChartEntries="{Binding Path=ChartEntries}" HeightRequest="180"/>

Is Microcharts supports TIZEN Cross platform

Hi,

I followed few sites and trying to achieve Charts with help of Xamarin Forms in TIZEN but no luck,
Could you please let me know.

My Code 👍
https://developer.tizen.org/forums/tizen-.net/how-use-microcharts-tizen

Error Log:
` this.chartView.Chart error: error: member reference type '__CrossTemplate1.TabPage1 *' is a pointer; did you mean to use '->'?
error: member reference type 'Microcharts.Forms.ChartView' (aka '__Microcharts.Forms.ChartView *') is a pointer; did you mean to use '->'?
error: no member named 'Chart' in '__Microcharts.Forms.ChartView'
error: 3 errors parsing expression

`

Thanks in advance,
Vamsi K

Feature request: expose SKTypeface for labels

Hey there, I'm currently localizing an application and I've noticed that there isn't any way for a user to pass in a typeface for chart labels. Making it impossible to localize for languages like Chinese.

Request:
Please expose Typeface properties for your chart controls to apply typefaces to labels.

Nullable values

Would it be possible to have a null value, the reason is I want to show every hour of the day (or day of week etc) but I might not have a value for that hour. I still want to see the label but the chart would just bypass showing a bar, dot etc

General Chart Labels

Any plans to support a chart title, x-axis label, and y-axis label? I do not see a way to add these.

Labels get cut off

Labels are cut off - any way you can add rotating / wrapping labels for the data points?

Nuget fails to install on PCL

Hi

I created a new cross platform project, updated the nugets, tried to install Microcharts.Forms.
I get following error :
Severity Code Description Project File Line Suppression State Error Could not install package 'Microcharts.Forms 0.7.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0

Max value of chart

Hello there, I'm using Microchart for Xamarin.Forms. Great tool so far! However, I found an interesting bug:

microchart_maxvalue_bug

According to the tutorial, the max value will become the value of the chart with the highest value. In my case, the max value of the chart is that divided by 2. If I increase the 'MaxValue' property to 400, it still does not give me the desired max value.

Is this a known bug? Am I doing something wrong in my code? Please let me know. I'm using 0.8.1-pre.

Handle null value on linechart

Hello,
I need to handle null values on linechart... I don't want to draw a point on 0... i want make a invisible point with the average of the last valid point and the next valid point... is it possible?

"Invalid Cast Exception" ...all of a sudden

Implementing a donutChart in my android application and I'm getting an invalid Cast exception error all of a sudden after it worked fine before. What could be the issue?
Screen shot attached.

Error is occurring on:
chart = new DonutChart(){Entries = chartSeries };

chart series is Entry array:
chartSeries = new Microcharts.Entry[] { new Microcharts.Entry (A) { Label = "100-75", ValueLabel = MakeAPercentage(A, total), Color = SKColor.Parse("#00D83E") }, new Microcharts.Entry(B) { Label = "75-50", ValueLabel = MakeAPercentage(B, total), Color = SKColor.Parse("#64BCFF") }, new Microcharts.Entry(C) { Label = "50-25", ValueLabel = MakeAPercentage(C,total), Color = SKColor.Parse("#FFD64A") }, new Microcharts.Entry(D) { Label = "25-0", ValueLabel = MakeAPercentage(D,total), Color = SKColor.Parse("#D30D1B") }
screen shot 2017-12-26 at 9 18 25 am

Label location

Hello!

There is a way to specify the location to show the label?
For example, if I use a RadialGauge and my label value or text is big, it goes over the chart graphic.
So, is there a way to choose if I want the label in the top, bottom, left, right of the graphic? Or something similar to that that can help me?

Does not display when another type of View is present - Xamarin.Forms trying iOS

Microcharts is absolutely gorgeous and wonderful, however when I attempt to put it on a page along with any other View-based element (Label, ScrollView, Grid, etc.), the chart becomes invisible.

For example:
<forms:ChartView x:Name="ServicesChart" HeightRequest="50" />
will show perfectly fine, however if my file has this:
<forms:ChartView x:Name="ServicesChart" HeightRequest="50" /> <Label>Test</Label>
the chart is nonexistent (without height or width) and I see the label displayed at the top of the page.

Likewise when I add a ScrollView, Grid, or other View-based element to the page.

Rename Microcharts.Forms

Since there's no (easy to find) information detailing the differences between the nuget packages Microchart and Microchart.Forms, I think it'd be very useful to rename Microchart.Forms to Microchart.XamarinForms.

Using Microcharts with dynamic data

Is it possible to use Microcharts also when data has to be dynamically added to a chart, instead of statistics-like static data ? For instance if new data comes asynchronously from a WebService, more or less cyclically. Are there any samples for this scenario available ?

Strange: Xamarin.iOS: Unable to locate assembly 'Microcharts.Forms' (culture: '')

targetfw_vs

Can anyone point me in the right direction.

Error using the LATEST version

 <package id="Microcharts" version="0.8.3-pre" targetFramework="portable45-net45+win8+wpa81" />
 <package id="Microcharts.Forms" version="0.8.3-pre" targetFramework="portable45-net45+win8+wpa81" />

Xamarin.Forms.Xaml.XamlParseException: Position 31:18. Type microcharts:ChartView not found in xmlns clr-namespace:Microcharts.Forms;assembly=Microcharts.Forms
  at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x0024b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:92 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000ab] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:149 
  at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00043] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Xaml\XamlNode.cs:143 
  at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00078] in C:\

issue with large data.

When I have a large amount of data the labels and bars overlap .. a zoom in out option would help if it exist

Donut Graphic is too big.

Hello, i'm using your Nugget to create some nice looking charts, but the Donut Chart in Portrait mode is a little too big for the screen and it also overlaps the text.

I could use landscape (and I do) but I'm... "Asked" for it to work on Both orientations. Is there a way to make the donut chart smaller?

Not compatible with Profile111

Could not install package 'Microcharts.Forms 0.7.1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Microcharts.forms failed to load assembly

Hello,

I installed Microcharts.Forms to my project and tried to add in a content page "<microcharts:ChartView x:Name="chartView" />" as in the example, but when I run on iOS I get the following error: "Failed to resolve assembly:'Microcharts.Forms, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null".

Version 0.7.1 for Microcharts.Forms and I am using Xamarin Live Player.

Thanks

Changing LineSize of RadialGaugeChart while changing size of chart?

Hey there!

Thanks for this great library. I was trying to change the LineSize attribute of the RadialGaugeChart type and i experienced that whenever i set it to a small size, something like 10, i can't resize the whole chart. So if i only got one entry the chart will appear really small and only gets bigger if i increase the line size.
What i want to achieve is a big chart with a thin line. Any ideas?

Best regards

DateTime chart ?

To make a chart ( X: time 9:50 , 9:51, 9:52 , 9:54, 9.58....... ) , ( Y: value , 0,1,2,3,4 .. )
Is it possible ?

Any plans to support series data?

Great tool!

Question: I would like the ability to show multiple datapoint for the same category to provide a simple visual comparison. Any plans to support something like this in the near future?

Something similar to this:

charting_2dgrid

Can't get access 'Entry' in .Net standard forms project.

Hi,

I have created a .Net standard forms project and included 'Microcharts.Forms' from nuget in all projects in solution.
I can't able to get access of 'Entry' and other Chart types (like LineChart, BarChart, PointChart ...). Is it supported for .Net standard projects or did i miss something?

Works on Xamarin.iOS but not in Xamarin.Droid, System.IO.FileNotFoundException

Hi fellows, I am new in Xamarin framework and currently using Xamarin.Forms to create an app with the Target Framework PCL4.5 profile 111. I have installed Microcharts.Forms nuget package and done the setup.
When I debug on iOS platform the chart generated perfectly, but on android platform, it crashes and display the following error.
screen shot 2017-10-03 at 7 53 pm
It is about something unable to find the assembly file. Can I use some help? Thx alot!

P/S: I am using Microcharts.Form v0.6.2, and I am unable to update to latest 0.7.1 due to I got an error saying "Package Microcharts.Forms 0.7.1 is not compatible with portable45-net45+win8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile111). Package Microcharts.Forms 0.7.1 supports: netstandard1.4 (.NETStandard,Version=v1.4)"

Microcharts fails to install in VS2017

I was trying to install the Microcharts nuget package in VS2017, and it failed with the following error message:

Restoring packages for \\Mac\Home\Developer\UwpApps\Microcharts\Microcharts.csproj...
Cycle detected. 
  Microcharts -> Microcharts (>= 0.7.1).
Package restore failed. Rolling back package changes for 'Microcharts'.
Time Elapsed: 00:00:00.8877490
========== Finished ==========

I tried installing Microcharts on the following configurations VS versions:

  • Visual Studio Community 2017 (15.4.4)
  • Visual Studio Community 2017 (15.5.0 Preview 4.0)

I also tried installing Microcharts 0.8.3-pre, but I get the same error message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.