Свойство | Тип | Описание | |
---|---|---|---|
$title_attributes | string | Adds possibility to set html attributes on the sparklines title / headline. For example can be used to set an angular directive |
Метод | Описание | |
---|---|---|
__construct ( ) | ||
addPlaceholder ( integer | null $order = null ) | Adds a placeholder. In this case nothing will be shown, neither a sparkline nor any description. This can be useful if you want to have some kind of separator. Eg if you want to have a sparkline on the left side but not sparkline on the right side. | |
addSparkline ( array $requestParamsForSparkline, integer | float | string | array $value, string | array $description, array | null $evolution = null, integer $order = null ) | Add a new sparkline to be displayed to the view. | |
addSparklineMetric ( string | array $metricName, integer | null $order = null ) | Adds a new sparkline. | |
areSparklinesLinkable ( ) | Detect whether sparklines are linkable with an evolution graph. {@link setNotLinkableWithAnyEvolutionGraph()} | |
getSortedSparklines ( ) : array | ||
getSparklineMetrics ( ) : array | ||
hasSparklineMetrics ( ) : boolean | ||
removeSparklineMetric ( array | string $metricNames ) | Removes an existing sparkline entry. Especially useful in dataTable filters in case sparklines should be not displayed depending on the fetched data. | |
replaceSparklineMetric ( array | string $metricNames, array | string $replacementColumns ) | Replaces an existing sparkline entry with different columns. Especially useful in dataTable filters in case sparklines should be not displayed depending on the fetched data. | |
setNotLinkableWithAnyEvolutionGraph ( ) | If there are sparklines and evolution graphs on one page, we try to connect them so that when you click on a sparkline, the evolution graph will update and show the evolution for that sparkline metric. In some cases we might falsely connect sparklines with an evolution graph that don't belong together. In this case you can mark all sparklines as "not linkable". This will prevent the sparklines being linked with an evolution graph. |
Метод | Описание | |
---|---|---|
getGraphParamsModified ( array $paramsToSet = [] ) : array | Returns the array of new processed parameters once the parameters are applied. | |
getSparklineOrder ( $order ) | ||
getUrlSparkline ( array $customParameters = [] ) : string | Returns a URL to a sparkline image for a report served by the current plugin. |
public addPlaceholder ( integer | null $order = null ) | ||
$order | integer | null | Defines the order. The lower the order the earlier the sparkline will be displayed. By default the sparkline will be appended to the end. |
public addSparkline ( array $requestParamsForSparkline, integer | float | string | array $value, string | array $description, array | null $evolution = null, integer $order = null ) | ||
$requestParamsForSparkline | array | You need to at least set a module / action eg array('columns' => array('nb_visit'), 'module' => '', 'action' => '') |
$value | integer | float | string | array | Either the metric value or an array of values. |
$description | string | array | Either one description or an array of descriptions. If an array, both $value and $description need the same amount of array entries. $description[0] should be the description for $value[0]. $description should be already translated. If $value should appear somewhere within the text a `%s` can be used in the translation. |
$evolution | array | null | Optional array containing at least the array keys 'currentValue' and 'pastValue' which are needed to calculate the correct percentage. An optional 'tooltip' can be set as well. Eg array('currentValue' => 10, 'pastValue' => 20, 'tooltip' => '10 visits in 2015-07-26 compared to 20 visits in 2015-07-25') |
$order | integer | Defines the order. The lower the order the earlier the sparkline will be displayed. By default the sparkline will be appended to the end. |
public addSparklineMetric ( string | array $metricName, integer | null $order = null ) | ||
$metricName | string | array | Either one metric name (eg 'nb_visits') or an array of metric names |
$order | integer | null | Defines the order. The lower the order the earlier the sparkline will be displayed. By default the sparkline will be appended to the end. |
public areSparklinesLinkable ( ) |
public removeSparklineMetric ( array | string $metricNames ) | ||
$metricNames | array | string | The name of the metrics in the same format they were used when added via {@link addSparklineMetric} |
public replaceSparklineMetric ( array | string $metricNames, array | string $replacementColumns ) | ||
$metricNames | array | string | The name of the metrics in the same format they were used when added via {@link addSparklineMetric} |
$replacementColumns | array | string | The removed columns will be replaced with these columns |
public setNotLinkableWithAnyEvolutionGraph ( ) |
public string $title_attributes | ||
Результат | string |