Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /home/fdshops/public_html/vendor/consoletvs/charts/src/Features/Chartjs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/fdshops/public_html/vendor/consoletvs/charts/src/Features/Chartjs/Chart.php
<?php

namespace ConsoleTVs\Charts\Features\Chartjs;

trait Chart
{
    /**
     * Minalist chart display (Hide labels and axes).
     *
     * @return self
     */
    public function minimalist(bool $display)
    {
        $this->displayLegend(!$display);

        return $this->displayAxes(!$display);
    }

    /**
     * Display the chart legend.
     *
     * @param bool $legend
     *
     * @return self
     */
    public function displayLegend(bool $legend)
    {
        return $this->options([
            'legend' => [
                'display' => $legend,
            ],
        ]);
    }

    /**
     * Display the chart axis.
     *
     * @param bool $axes
     *
     * @return self
     */
    public function displayAxes(bool $axes, bool $strict = false)
    {
        if ($strict) {
            return $this->options([
                'scale' => [
                    'display' => $axes,
                ],
            ]);
        }

        return $this->options([
            'scales' => [
                'xAxes' => [
                    [
                        'display' => $axes,
                    ],
                ],
                'yAxes' => [
                    [
                        'display' => $axes,
                    ],
                ],
            ],
        ]);
    }

    /**
     * Set the bar width of the X Axis.
     *
     * @param float $width
     *
     * @return self
     */
    public function barWidth(float $width)
    {
        return $this->options([
            'scales' => [
                'xAxes' => [
                    [
                        'barPercentage' => $width,
                    ],
                ],
            ],
        ]);
    }

    /**
     * Set the chart title.
     *
     * @param string $title
     * @param int    $font_size
     * @param string $color
     * @param string $font_weight
     * @param string $font_family
     *
     * @return self
     */
    public function title(
        string $title,
        int $font_size = 14,
        string $color = '#666',
        string $font_weight = 'bold',
        string $font_family = "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"
    ) {
        return $this->options([
            'title' => [
                'display'    => true,
                'fontFamily' => $font_family,
                'fontSize'   => $font_size,
                'fontColor'  => $color,
                'fontStyle'  => $font_weight,
                'text'       => $title,
            ],
        ]);
    }
}

Spamworldpro Mini