Download the PHP package macocci7/php-lorenz-curve without Composer

On this page you can find all versions of the php package macocci7/php-lorenz-curve. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-lorenz-curve

PHP Lorenz Curve

A PHP Library to draw a Lorenz Curve.

1. Features

PHP-LorenzCurve draws a Lorenz Curve and also calculates the Gini's coefficient.

2. Contents

3. Requirements

4. Installation

5. Usage

5.1. Basic Usage

To draw a Lorenz Curve, create an instance of LorenzCurve class at first.

Next, set the data, the class range and save the image into a file.

This results in the image below.

5.2. Adjusting the Appearance

5.2.1. Drawing Grid Lines

You can draw grid lines with grid() method specifying the width and the color.

Note: Specifying null as a color code results in transparent.

This results in the image below.

5.2.2. Drawing an Upward Convex Curve

You can create an upward convex Lorenz Curve by sorting the list of the classes in decending order with reverseClasses() method.

This results in the image below.

5.2.3. Setting the Image Size

PHP-LorenzCurve generates images with a width of 400 pixels and a height of 300 pixels by default.

You can change the image size with resize() method.

This code results in as below:

5.2.4. Setting the Attributes of Plotarea

By default, PHP-LorenzCurve sets the Attributes of Plotarea:

You can change them with plotarea() method.

Sample code:

This code results in as below:

5.2.5. Setting Caption and Labels

You can set the Caption and Labels with caption(), labelX() and labelY() methods.

Sample code:

This code results in as below:

5.2.6. Setting Attributes with Array

You can set attributes with the config() method passing array as an argument.

This code results in as below:

See more: Customizable Attributes

5.2.7. Setting Attributes with Neon File

You can set attributes with config() method passing the neon file path as an argument.

First, create a Neon File.

Second, specify the path of the neon file as an argument of the config() method.

This code results in as below:

See more: Customizable Attributes

5.2.8. Customisable Attributes

attribute type default example description
canvasSize['width'] int 400 450 image width
canvasSize['height'] int 300 400 image height
canvasBackgroundColor string '#ffffff' '#0000ff' background color of the image
plotarea['offset'] int[] 10% of the image size [40, 50] offset of the plotarea
plotarea['width'] int 80% of the image size 500 plotarea width
plotarea['height'] int 70% of the image size 400 plotarea height
plotarea['backgroundColor'] string null '#cccccc' background color of the plotarea
showGrid bool false true whether to show grid lines
gridWidth int 1 2 grid line width
gridColor string '#cccccc' '#0099ff' grid line color
axisWidth int 2 3 axis width
axisColor string '#000000' '#ffffff' axis color
scaleWidth int 1 2 scale width
scaleLength int 3 6 scale length
scaleColor string '#000000' '#ffffff' scale color
scaleFontSize int 16 14 scale font size
scaleFontPath string 'fonts/ipaexg.ttf' 'fonts/myfont.ttf' scale font path
scaleFontColor string '#000000' '#ffffff' scale font color
lorenzCurveWidth int 2 1 Lorenz Curve width
lorenzCurveColor string '#0000ff' '#ffff00' Lorenz Curve Color
lorenzCurveBackgroundColor string '#ffcc00' null Lorenz Curve background color
completeEqualityLineWidth int 1 2 complete equality line width
completeEqualityLineColor string '#999999' '#ffffff' complete equality line color
completeEqualityLineDash int[] [4, 4] [8, 8] complete equality line dash pattern (solid and blank)
fontPath string 'fonts/ipaexg.ttf' 'fonts/myfont.ttf' font path
fontSize int 16 14 font size
fontColor string '#333333' '#ffffff' font color
labelX string '' 'Cumulative Relative Frequency' x label
labelXOffsetX int 0 -10 x-offset of x label
labelXOffsetY int 0 10 y-offset of x label
labelY string '' 'Cumulative Relative Subtotal' y label
labelYOffsetX int 0 -10 x-offset of y label
labelYOffsetY int 0 -10 y-offset of y label
caption string '' 'CAPTION' caption
captionOffsetX int 0 10 x-offset of caption
captionOffsetY int 0 -10 y-offset of caption

5.3. Gini's Coefficient

You can get the Gini's Coefficient with getGinisCoefficient() method without generating an image.

This results in as below.

6. Examples

7. LICENSE

MIT


Copyright 2024-2025 macocci7.


All versions of php-lorenz-curve with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
nette/neon Version ^3.4
macocci7/php-frequency-table Version ^1.4
macocci7/php-plotter2d Version ^0.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package macocci7/php-lorenz-curve contains the following files

Loading the files please wait ....