Conversion graph

Graphs a conversion path

Лицензия

Лицензия

Группа

Группа

com.ncona
Идентификатор

Идентификатор

conversion-graph
Последняя версия

Последняя версия

1.2
Дата

Дата

Тип

Тип

aar
Описание

Описание

Conversion graph
Graphs a conversion path
Ссылка на сайт

Ссылка на сайт

https://github.com/soonick/conversion-graph
Система контроля версий

Система контроля версий

https://github.com/soonick/conversion-graph

Скачать conversion-graph

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.ncona/conversion-graph/ -->
<dependency>
    <groupId>com.ncona</groupId>
    <artifactId>conversion-graph</artifactId>
    <version>1.2</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.ncona/conversion-graph/
implementation 'com.ncona:conversion-graph:1.2'
// https://jarcasting.com/artifacts/com.ncona/conversion-graph/
implementation ("com.ncona:conversion-graph:1.2")
'com.ncona:conversion-graph:aar:1.2'
<dependency org="com.ncona" name="conversion-graph" rev="1.2">
  <artifact name="conversion-graph" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.ncona', module='conversion-graph', version='1.2')
)
libraryDependencies += "com.ncona" % "conversion-graph" % "1.2"
[com.ncona/conversion-graph "1.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Build Status

Conversion Graph

Graph for displaying a conversion path

Get it

If you are going to use this library I recommend using the version on Central repository. You can add it to your project by adding this line to your dependecies inside your build.gradle:

  compile 'com.ncona:conversion-graph:1.0.0@aar'

If you prefer you can always download this repository and generate your own aar by running gradle build.

Use it

Start by importing the library:

import com.ncona.conversiongraph.Graph;

You need to pass the context to the constructor:

Graph conversiongraph = new Graph(this);

Then you will need to create a list of Measures. A Measure consists of a label and an array of values. Here is an example of how to create this list of Measures:

import com.ncona.conversiongraph.models.Measure;

// Some more code

// Create the list and populate it
List<Measure> measures = new ArrayList<Measure>();
int[] values = { 10000, 5000 };
measures.add(new Measure("Leads", values));
int[] values2 = { 3000, 2800 };
measures.add(new Measure("Prospects", values2));
int[] values3 = { 500, 100 };
measures.add(new Measure("Customers", values3));

// Add the measures to the graph
conversiongraph.setMeasures(measures)

// Some more code

For each of the values you will need to provide a legend. In the previous example we have two values per measure so we would need two legends:

import com.ncona.conversiongraph.models.Legend;

// Some more code

Legend[] legend = {
    new Legend("this month", Color.YELLOW),
    new Legend("Last month", Color.RED),
};
conversiongraph.setLegends(legend);

// Some more code

Now your view is ready to be inserted anywhere you want:

setContentView((View)conversiongraph);

The previous example will give you this result:

Screenshot of example with two values

Версии библиотеки

Версия
1.2
1.1
1.0.0