Skip to content

How to hide unknown line? #50

@4n70w4

Description

@4n70w4

Hi! I copy examples from readme and pass my parameters and data attributes:

    /**
     * Should return settings for Nova Chart in prescribed format
     *
     * @return array
     */
    public function getNovaChartjsSettings() : array {
        return [
            'default' => [
                'type' => 'line',
                'titleProp' => 'name',
                'identProp' => 'id',
                'height' => 400,
                'indexColor' => '#999999',
                'color' => '#FF0000',
                'parameters' => collect(self::data($this->getAttribute('id')))->pluck('k')->toArray(),
                'options' => ['responsive' => true, 'maintainAspectRatio' => false],
            ]
        ];
    }



    /**
     * Return a list of additional datasets added to chart
     *
     * @return array
     */
    public function getAdditionalDatasets(): array {
        return [
            'default' => [
                [
                    'label' => 'Distribution',
                    'borderColor' => '#f87900',
                    'fill' => '+1',
                    'backgroundColor' => 'rgba(20,20,20,0.2)',//For bar charts, this will be the fill color of the bar
                    'data' => collect(self::data($this->getAttribute('id')))->pluck('v')->toArray(),
                ],
            ]
        ];
    }

A line appears with the title of the Unknown. I don't understand how to remove it at all.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions