Coder Social home page Coder Social logo

ajunlonglive / ultimate-xamarin-forms-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bulubuloa/ultimate-xamarin-forms-kit

0.0 2.0 0.0 11.09 MB

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.

Home Page: https://www.nuget.org/packages/UltimateXF/

C# 100.00%

ultimate-xamarin-forms-kit's Introduction

MPAndroidChart/iOSChart for Xamarin Forms Custom Renderer

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.

Available on NuGet:

Build status NuGet Badge

MPAndroidChart Binding

Add assembly references

xmlns:ultimateChart="clr-namespace:UltimateXF.Widget.Charts;assembly=UltimateXF"

Setup for iOS project (add to AppDelegate before LoadApplication)

 UltimateXFSettup.Initialize();

Setup for Android project (add to MainActivity before LoadApplication)

 UltimateXFSettup.Initialize(this);

Required:

  • [Xamarin.Forms](>= 3.1.0.697729)

  • Your app could not run on simulator(iOS)

  • Install Xamarin.Swift package for iOS project(maybe if your app can't start)

    [Xamarin.Swift] (>= 1.0.7)  
    
  • You can downgrade swift support version for you project or your device (just download this project source and downgrade version of library for each project)

LineChart & BarChart

    <ultimateChart:SupportLineChartExtended  
	       x:Name="chart"  
           HorizontalOptions="FillAndExpand"  
           VerticalOptions="FillAndExpand"  
           DrawBorders="false"  
           DoubleTapToZoomEnabled="false" />  

DataBinding

        var entries = new List<EntryChart>();
        var entries2 = new List<EntryChart>();
        var labels = new List<string>();

 	    var random = new Random();
    for (int i = 0; i < 7; i++)
    {
	entries.Add(new EntryChart(i, random.Next(1000,50000)));
	entries2.Add(new EntryChart(i, random.Next(1000,50000)));
	labels.Add("Entry" + i);
    }
 	    var FontFamily = "";
        switch (Device.RuntimePlatform)
        {
            case Device.iOS:
                FontFamily = "Pacifico-Regular";
                break;
            case Device.Android:
                FontFamily = "Fonts/Pacifico-Regular.ttf";
                break;
            default:
                break;
        }
        var dataSet4 = new LineDataSetXF(entries, "Line DataSet 1")
        {
            CircleRadius = 10,
            CircleHoleRadius = 4f,
            CircleColors = new List<Color>(){
                Color.Accent, Color.Red, Color.Bisque, Color.Gray, Color.Green, Color.Chocolate, Color.Black
            },
            CircleHoleColor = Color.Green,
            ValueColors = new List<Color>(){
                Color.Accent, Color.Red, Color.Bisque, Color.Gray, Color.Green, Color.Chocolate, Color.Black
            },
            Mode = LineDataSetMode.CUBIC_BEZIER,
            ValueFormatter = new CustomDataSetValueFormatter(),
            ValueFontFamily = FontFamily
        };

        var dataSet5 = new LineDataSetXF(entries2, "Line DataSet 2")
        {
            Colors = new List<Color>{
                Color.Green
            },
            CircleHoleColor = Color.Blue,
            CircleColors = new List<Color>{
                Color.Blue
            },
            CircleRadius = 3,
            DrawValues = false,

        };

        var data4 = new LineChartData(new List<ILineDataSetXF>() { dataSet4,dataSet5 });

        chart.ChartData = data4;
        chart.DescriptionChart.Text = "Test label chart description";
        chart.AxisLeft.DrawGridLines = false;
        chart.AxisLeft.DrawAxisLine = true;
        chart.AxisLeft.Enabled = true;

        chart.AxisRight.DrawAxisLine = false;
        chart.AxisRight.DrawGridLines = false;
        chart.AxisRight.Enabled = false;

        chart.AxisRight.FontFamily = FontFamily;
        chart.AxisLeft.FontFamily = FontFamily;
        chart.XAxis.FontFamily = FontFamily;

        chart.XAxis.XAXISPosition = XAXISPosition.BOTTOM;
        chart.XAxis.DrawGridLines = false;
        chart.XAxis.AxisValueFormatter = new TextByIndexXAxisFormatter(labels);

Chart types:

Screenshots are currently taken from the original repository, as they render exactly the same :-)

  • LineChart (with legend, simple design) alt tag

  • LineChart (with legend, simple design) alt tag

  • LineChart (cubic lines) alt tag

  • LineChart (gradient fill) alt tag

  • Combined-Chart (bar- and linechart in this case) alt tag

  • BarChart (with legend, simple design)

alt tag

  • BarChart (grouped DataSets)

alt tag

  • Horizontal-BarChart

alt tag

  • PieChart (with selection, ...)

alt tag

  • ScatterChart (with squares, triangles, circles, ... and more)

alt tag

  • CandleStickChart (for financial data)

alt tag

  • BubbleChart (area covered by bubbles indicates the value)

alt tag

  • RadarChart (spider web chart)

alt tag

License

You can use this library for any project, or custom, edit it if you want, no need license and permissions

Special thanks Daniel Cohen Gindi & Philipp Jahoda

ultimate-xamarin-forms-kit's People

Contributors

hoangquachaes avatar bulubuloa avatar jotadobleese avatar

Watchers

James Cloos avatar  avatar

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.