Git Product home page Git Product logo

Comments (4)

cord avatar cord commented on September 12, 2024

->withMeta($options)

from nova-dashboard.

xoco70 avatar xoco70 commented on September 12, 2024

Ah, thanks for the tip, @cord

I couldn't make it :(

Here is how I am doing it :

public function widgets(): array
    {
        $widget = new ConsumedSolarEnergyValue(0, 0, 2, 1);
        $options = [
            "prefix" => null,
            "suffix" => "kWh",
            "decimal" => "2",
            "no_current_data" => "N\/A",
            "labels" => [
                "No Prior Data" => "Aucune donn\u00e9e plus ancienne",
                "No Current Data" => "Aucune donn\u00e9e",
                "No Increase" => "Pas d\u2019augmentation",
                "Increase" => "Augmentation",
                "Decrease" => "Diminution",
                "Previous Value" => "Previous value:"
            ],
            "widget_title" => "Energie r\u00e9seau consomm\u00e9e",
            "widget_help" => null
        ];
        $widget->withMeta(['options' => $options]);
        return [
            $widget,
        ];
    }

If I change it to

$widget->withMeta(['optionsXXX' => $options]);,

I can see the optionsXXX value when checking /nova-vendor/nova-dashboard/tableau-de-bord.

but when I use options, it seems to be overwritting the $options variable with null values.

Do you have an example you already did ?

from nova-dashboard.

cord avatar cord commented on September 12, 2024

check

https://github.com/Nova-BI/nova-dashboard-manager/blob/main/src/Views/CustomView.php

https://github.com/Nova-BI/nova-dashboard-manager/blob/main/src/Models/Datavisualables/BaseDatavisualable.php

for an example how to work with meta data.

from nova-dashboard.

xoco70 avatar xoco70 commented on September 12, 2024

mmm. Still can't find it. I think withMeta may not be the problem, it is just overwritten by empty defaults, and I can't find to see why.

from nova-dashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.