All Projects β†’ jsuyash1514 β†’ Graph-Kit

jsuyash1514 / Graph-Kit

Licence: MIT license
πŸ“Š Android library for plotting and editing graphs πŸ“ˆ

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Graph-Kit

Caroline
A simple Cairo Chart Library for GTK and Vala
Stars: ✭ 41 (+64%)
Mutual labels:  pie-chart
React Fast Charts
Blazing Fast Charting Library in React with loading time less than 50ms
Stars: ✭ 113 (+352%)
Mutual labels:  pie-chart
NetworkLayout.jl
Layout algorithms for graphs and trees in pure Julia.
Stars: ✭ 82 (+228%)
Mutual labels:  graph-visualization
Reaviz
πŸ“Š Data visualization library for React based on D3
Stars: ✭ 1,141 (+4464%)
Mutual labels:  pie-chart
Vue Css Donut Chart
Lightweight Vue component for drawing pure CSS donut charts
Stars: ✭ 104 (+316%)
Mutual labels:  pie-chart
Orcharts
ι₯ΌηŠΆε›Ύγ€ηŽ―ε½’ε›Ύγ€ζ‰‡ε½’ε›Ύγ€ζ›²ηΊΏε›Ύγ€ζŠ˜ηΊΏε›Ύ
Stars: ✭ 125 (+400%)
Mutual labels:  pie-chart
Jhchart
Stars: ✭ 593 (+2272%)
Mutual labels:  pie-chart
grasp
Essential NLP & ML, short & fast pure Python code
Stars: ✭ 58 (+132%)
Mutual labels:  graph-visualization
Core Animation Pie Chart
Pie Chart built using CAShapeLayers, a CADisplayLink and custom layer properties
Stars: ✭ 107 (+328%)
Mutual labels:  pie-chart
react-native-d3multiline-chart
Animated Android and iOS multiline/line/scatterPoint chart based on d3.js 🀘😎🀘
Stars: ✭ 43 (+72%)
Mutual labels:  line-graph
Muze
Composable data visualisation library for web with a data-first approach now powered by WebAssembly
Stars: ✭ 1,153 (+4512%)
Mutual labels:  pie-chart
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (+288%)
Mutual labels:  pie-chart
React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+6296%)
Mutual labels:  pie-chart
Piechart
Simple and elegant pie chart for iOS applications
Stars: ✭ 45 (+80%)
Mutual labels:  pie-chart
GNNLens2
Visualization tool for Graph Neural Networks
Stars: ✭ 155 (+520%)
Mutual labels:  graph-visualization
Dypiechartview
Animated Pie Chart using Custom CALayer.
Stars: ✭ 5 (-80%)
Mutual labels:  pie-chart
Tty Pie
Draw pie charts in your terminal window
Stars: ✭ 125 (+400%)
Mutual labels:  pie-chart
multigraph
multigraph: Plot and Manipulate Multigraphs in R
Stars: ✭ 18 (-28%)
Mutual labels:  graph-visualization
nodesoup
Force-directed graph layout with Fruchterman-Reingold
Stars: ✭ 40 (+60%)
Mutual labels:  graph-visualization
React Minimal Pie Chart
🍰 Lightweight but versatile SVG pie/donut charts for React. < 2kB gzipped.
Stars: ✭ 245 (+880%)
Mutual labels:  pie-chart

Graph Kit

Platform API License: MIT

This library allows you to plot different kinds of graphs from data points. The currently supported graphs are
Line Graph, Bar Graph and Pie Chart. This library also includes an EditGraphView which you can edit by dragging points
and also get normalized points from the curve.

Table of Content

Usage

Just add the following dependency in your app's build.gradle

dependencies {
      implementation 'com.mdgiitr.suyash:graphkit:0.9.0'
}

Features

Line Graph Usage

There are two ways you can use this Graph: through XML or Java.

XML

<com.mdgiitr.suyash.graphkit.LineGraph
        android:id="@+id/lineGraph"
        android:layout_width="700dp"
        android:layout_height="700dp"
        app:graph_color="#ff0000"
        app:label_text_size="25"
        app:line_thickness="8.0"
        app:scrollablex="true"/>    

Then use the View in your java file as follows:

LineGraph lineGraph = findViewById(R.id.lineGraph);

Java

You can use the following Java code to add the View in your desired layout.

LineGraph lineGraph = new LineGraph(getApplicationContext(),700,700); //Pass view width and view height as parameters
//Then add the view to your layout
layout.addView(lineGraph);

To add Data Points to your Line Graph create an ArrayList of DataPoints and add them as shown below:

        ArrayList<DataPoint> points = new ArrayList<>();
        points.add(new DataPoint(10,10));
        points.add(new DataPoint(100,50));
        points.add(new DataPoint(100,100));
        points.add(new DataPoint(150,200));
        lineGraph.setPoints(points);

Bar Graph Usage

There are two ways you can use this Graph: through XML or Java.

XML

<com.mdgiitr.suyash.graphkit.BarGraph
        android:layout_width="700dp"
        android:layout_height="700dp"
        android:id="@+id/barGraph"
        app:label_text_size="25" />
       

Then use the View in your java file as follows:

BarGraph barGraph = findViewById(R.id.barGraph);

Java

You can use the following Java code to add the View in your desired layout.

BarGraph barGraph = new BarGraph(getApplicationContext(),700,700); //Pass view width and view height as parameters
//Then add the view to your layout
layout.addView(barGraph);

To add Data to your Bar Graph create an ArrayList of DataPoint and add it as shown below:

        ArrayList<DataPoint> points = new ArrayList<>();
        points.add(new DataPoint("2014",5, Color.parseColor("#34495E")));
        points.add(new DataPoint("2015",9, Color.parseColor("#EC7063")));
        points.add(new DataPoint("2016",2, Color.parseColor("#2ECC71")));
        points.add(new DataPoint("2017",4, Color.parseColor("#F5B041")));
        barGraph.setPoints(points);

Pie Chart Usage

There are two ways you can use this Graph: through XML or Java.

XML

<com.mdgiitr.suyash.graphkit.PieChart
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:id="@+id/grid_pie"
       app:label_text_size="40"/>

Then use the View in your java file as follows:

PieChart pieChart = findViewById(R.id.pie_chart);

Java

You can use the following Java code to add the View in your desired layout.

PieChart pieChart = new PieChart(getApplicationContext(),700,700); //Pass view width and view height as parameters
//Then add the view to your layout
layout.addView(pieChart);

To add Data to your Pie Chart create an ArrayList of DataPoint and add it as shown below:

       ArrayList<DataPoint> points = new ArrayList<>();
       points.add(new DataPoint("Football",(float)40.1,Color.parseColor("#34495E")));
       points.add(new DataPoint("Cricket", (float)30.9, Color.parseColor("#EC7063")));
       points.add(new DataPoint("Basketball", (float)15.8,Color.parseColor("#2ECC71")));
       points.add(new DataPoint("Voleyball",(float)12.4,Color.parseColor("#F5B041")));
       pieChart.setPoints(points);

EditGraphView Usage

There are two ways you can use this Graph: through XML or Java.

XML

<com.mdgiitr.suyash.graphkit.EditGraphView
       android:id="@+id/editgraphview"
       android:layout_width="350dp"
       android:layout_height="350dp"
       android:layout_marginEnd="8dp"
       android:layout_marginStart="8dp"
       android:layout_marginTop="56dp"/>

Then use the View in your java file as follows:

final EditGraphView v = findViewById(R.id.editgraphview);

Java

You can use the following Java code to add the View in your desired layout.

EditGraphView v = new EditGraphView(this, 700, 700);//Pass view width and view height as parameters
 //Then add the view to your layout
layout.addView(pieChart);

API Documentation

LineGraph

Property Default values Java method Attribute Description
Data Points NA .setPoints(...) NA Data Points to plot
Scroll X false .setSCrollX(...) scrollablex Is the graph scrollable along the x-axis
Scroll Y false .setScrollY(...) scrollabley Is the graph scrollable alog the y-axis
Trace Color for Line Color.BLACK .setGraphColor(...) graph_color Set the color for tracing the line
Label Text Size 20 .setLabelTextSize(...) label_text_size Size of text used in the label markings
Grid Color Color.LTGRAY .setGridColor(...) grid_color Set the color of the grid lines created
Maximum number of divisions on each axis 50 .setMaxDivisions(...) max_divisions Set the maximum number of divisions on each axis

BarGraph

Property Default values Java method Attribute Description
Data Points NA .setPoints(...) NA Data Points to plot
Label Text Size 20 .setLabelTextSize(...) label_text_size Size of text used in the label markings
Space between two bars 10 .setSpace(...) bar_space Set the spacing between two bars

PieChart

Property Default values Java method Attribute Description
Data Points NA .setPoints(...) NA Data Points to plot
Label Text Size 40 .setLabelTextSize(...) label_text_size Size of text used in the label markings

EditGraphView

Property Default values Java method Attribute Description
Line Thickness 12 .lineThickness(...) line_thickness Data Points to plot
Line Color Color.BLACK .lineColor(...) graph_color Set the color for tracing the line
Get Y-coord from X-coord NA .getYFromX(...) NA Get Y-coord for a specific X between 0 and 1
Set Touch Tolerance 20 .setTouchTolerance(...) touch_tolerance Set Touch Tolerance for anchor points

Guidelines for Contributors

If you want to contribute to improve this library, please read our guidelines.

Possible Improvements

  • Line graph can be plotted for all 4 quadrants.
  • Zoom-in and zoom-out features can be added to graphs.
  • Number of curves can be plotted in a single line graph to compare between the plots or to find the intersections.
  • The Graphs can be made to plot in real-time.
  • Snapping feature can be added in EditGraphView.
  • Undo and Redo feature can be added in Edit graph.
  • Polar Coordinate system can be added.
  • Graphs can be plotted from functions and their roots, stationary points, integrals, etc. can be obtained from the graphs.
  • Database can be integrated to store the graphs locally in the app.

License

Graph Kit is licensed under MIT License. View license here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].