Files
firefly-iii/app/Generator/Chart/Basic/GeneratorInterface.php

95 lines
2.6 KiB
PHP
Raw Normal View History

2016-12-11 16:02:04 +01:00
<?php
2022-12-29 19:41:57 +01:00
2016-12-11 16:02:04 +01:00
/**
* GeneratorInterface.php
2020-01-28 08:45:28 +01:00
* Copyright (c) 2019 james@firefly-iii.org
2016-12-11 16:02:04 +01:00
*
* This file is part of Firefly III (https://github.com/firefly-iii).
2016-12-11 16:02:04 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2017-10-21 08:40:00 +02:00
*
* This program is distributed in the hope that it will be useful,
2017-10-21 08:40:00 +02:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
2017-10-21 08:40:00 +02:00
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2016-12-11 16:02:04 +01:00
*/
declare(strict_types=1);
2016-12-11 16:02:04 +01:00
namespace FireflyIII\Generator\Chart\Basic;
/**
2017-11-15 12:25:49 +01:00
* Interface GeneratorInterface.
2016-12-11 16:02:04 +01:00
*/
interface GeneratorInterface
{
2018-08-28 05:21:23 +02:00
/**
2022-12-29 19:41:57 +01:00
* @param array $data
2018-08-28 05:21:23 +02:00
*
* @return array
*/
public function multiCurrencyPieChart(array $data): array;
2016-12-11 16:02:04 +01:00
/**
2017-11-15 12:25:49 +01:00
* Will generate a Chart JS compatible array from the given input. Expects this format.
2017-06-02 12:59:27 +02:00
*
* Will take labels for all from first set.
2016-12-11 16:02:04 +01:00
*
* 0: [
* 'label' => 'label of set',
2017-06-02 12:59:27 +02:00
* 'type' => bar or line, optional
* 'yAxisID' => ID of yAxis, optional, will not be included when unused.
* 'fill' => if to fill a line? optional, will not be included when unused.
2016-12-11 16:02:04 +01:00
* 'entries' =>
* [
2020-03-14 19:12:32 +01:00
* key => [value => x, 'currency_symbol' => 'x']
2016-12-11 16:02:04 +01:00
* ]
* ]
* 1: [
* 'label' => 'label of another set',
2017-06-02 12:59:27 +02:00
* 'type' => bar or line, optional
* 'yAxisID' => ID of yAxis, optional, will not be included when unused.
* 'fill' => if to fill a line? optional, will not be included when unused.
2016-12-11 16:02:04 +01:00
* 'entries' =>
* [
2020-03-14 19:12:32 +01:00
* key => [value => x, 'currency_symbol' => 'x']
2016-12-11 16:02:04 +01:00
* ]
* ]
*
2019-08-17 10:46:55 +02:00
* // it's five.
2016-12-11 16:02:04 +01:00
*
2022-12-29 19:41:57 +01:00
* @param array $data
2016-12-11 16:02:04 +01:00
*
* @return array
*/
public function multiSet(array $data): array;
2016-12-14 18:59:12 +01:00
/**
2017-11-15 12:25:49 +01:00
* Expects data as:.
2016-12-14 18:59:12 +01:00
*
* key => value
*
2022-12-29 19:41:57 +01:00
* @param array $data
2016-12-14 18:59:12 +01:00
*
* @return array
*/
public function pieChart(array $data): array;
2016-12-11 16:25:25 +01:00
/**
2017-11-15 12:25:49 +01:00
* Will generate a (ChartJS) compatible array from the given input. Expects this format:.
2016-12-11 16:25:25 +01:00
*
* 'label-of-entry' => value
*
2022-12-29 19:41:57 +01:00
* @param string $setLabel
* @param array $data
2016-12-11 16:25:25 +01:00
*
* @return array
*/
public function singleSet(string $setLabel, array $data): array;
}