Download the PHP package dgc/chart-bundle without Composer

On this page you can find all versions of the php package dgc/chart-bundle. 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 chart-bundle

ChartBundle

Bundle to create charts from SQL or MongoDB database queries

Requirements

Installation

Request bundle using composer

composer require dgc/chart-bundle

Add ChartBundle to your AppKernel.php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ...

            new DGC\ChartBundle\DGCChartBundle(),

            new AppBundle\AppBundle(),
        ];
        ...

Add JavaScript and CSS dependencies to your views

...
<head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    {% include '@DGCChart/Includes/lib_daterangepicker.html.twig' %}
    {% include '@DGCChart/Includes/lib_echarts.html.twig' %}
    {% include '@DGCChart/Includes/lib_morris.html.twig' %}
</head>
...

Add Charts

TestController.php

// Create a new aggregator
$aggregator = $this->get('dgc_chart.factory.aggregator')->createSqlAggregator();

// Build the query
$aggregator
    ->setDatabaseConnection($this->get("doctrine.dbal.ext_connection"))
    ->getQueryBuilder()
    ->select('`date`, orders, clients')
    ->from('stats')
    ->orderBy('date', 'DESC')
;

// Set which fields will be used for X and Y values 
$aggregator
    ->setXField('date')
    ->addYField('orders', 'Number of orders')
    ->addYField('clients', 'Number of clients')
    ->addResultCallback(function ($data) {
        return $data; //optional: manipulate data used to render the chart
    })
;

// Optionally create and add filters
$filter = $this->get("dgc_chart.factory.filter")->createDateRangeFilter("test");
$filter->setSqlField('date');

// Create the chart
$chart = $this->get('dgc_chart.factory.chart')->createAdvancedChart('test');
$chart
    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

return $this->render('@App/Test/index.html.twig', array(
    'chart' => $chart->render(),
    'filter' => $filter->render()
));

index.html.twig

{{ filter|raw }}
{{ chart|raw }}

Chart types

AdvancedChart

$chart = $this->get('dgc_chart.factory.chart')->createAdvancedChart('test');
$chart
    ->setHeight(...)
    ->setWidth(...)
    ->setLabelFormat(...)
    ->setSeriesLabelPosition(...)
    ->setXAxisLabelInterval(...)
    ->setYAxisLabelInterval(...)
    ->setRelativeScale(...)
    ->setHorizontal(...)
    ->showXAxis(...)
    ->showYAxis(...)
    ->showToolbar(...)
    ->showData(...)
    ->showDownload(...)
    ->showSplitLines(...)
    ->setTooltipFormat(...)
    ->hideLabelLengthDependent(...)

    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

LineChart

$chart = $this->get('dgc_chart.factory.chart')->createLineChart('test');
$chart
    ->setSmooth(...)        

    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

PieChart

$chart = $this->get('dgc_chart.factory.chart')->createPieChart('test');
$chart
    ->setStartAngle()
    ->formatTooltip()
    ->setThresholdDisplayPieSlice()
    ->setThresholdDisplayPieSliceDescription()        

    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

BarChart

$chart = $this->get('dgc_chart.factory.chart')->createBarChart('test');
$chart
    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

ListChart

$chart = $this->get('dgc_chart.factory.chart')->createListChart('test');
$chart
    ->setTitle("Just a test")
    ->addAggregator($aggregator)
    ->addFilter($filter)
;

Filter

Date range filter

$filter = $this->get("dgc_chart.factory.filter")->createDateRangeFilter("test");
$filter
    ->setStartDate(...)
    ->setEndDate(...)
    ->setDateFormat(...)
    ->setSqlField(...)
    ->setSqlFieldRangeEnd(...)
    ->setMongoField(...)
;

Number range filter

$filter = $this->get("dgc_chart.factory.filter")->createNumberRangeFilter("test");
$filter
    ->setLabel(...)
    ->setUnit(...)
    ->setMin(...)
    ->setMax(...)
    ->setRangeMin(...)
    ->setRangeMax(...)
    ->setMongoField(...)
    ->setSqlField(...)
;

Reference filter (choices)

$filter = $this->get("dgc_chart.factory.filter")->createReferenceFilter("test");
$filter
    ->setReference(...)
    ->setChoices(...)
    ->setLabel(...)
    ->setMongoField(...)
    ->addCustomWhereClause(...)
;

All versions of chart-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/framework-bundle Version ~3.0
symfony/dependency-injection Version ~3.0
twig/twig Version ^1.0||^2.0
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 dgc/chart-bundle contains the following files

Loading the files please wait ....