Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined method Asantibanez\LivewireCharts\Models\ColumnChartModel::setJsonConfig() #131

Open
Hemantkumawat opened this issue May 30, 2024 · 2 comments

Comments

@Hemantkumawat
Copy link

Hemantkumawat commented May 30, 2024

Steps to Reproduce:

  1. I was trying to configure the ColumnChartModel in my Livewire component.

  2. Here is the relevant code snippet:

    <?php
    
    namespace App\Http\Livewire\OrgOwner\Dashboard\Charts;
    
    use Asantibanez\LivewireCharts\Models\ColumnChartModel;
    use Livewire\Component;
    
    class ExampleComponent extends Component
    {
        private ColumnChartModel $columnChartModel;
    
        public function initData(): void
        {
            $this->columnChartModel = (new ColumnChartModel())->setJsonConfig([]);
        }
    }
  3. When I try to execute this code, I receive the error mentioned above.

Additional Context:

  • Livewire Charts Version: [Specify version, e.g., v2.1.0]
  • Laravel Version: [Specify version, e.g., 8.0]
  • PHP Version: [Specify version, e.g., 7.4]

Expected Behavior:

I expected the setJsonConfig() method to configure the JSON settings for the chart model.

Actual Behavior:

The method setJsonConfig() does not seem to exist in the ColumnChartModel class.

Is there a recommended approach to achieve this functionality, or is this a potential bug in the library?

Thank you for your assistance!

@djowebdev
Copy link

djowebdev commented May 30, 2024

Since you haven't specified the additional context: Are you using the latest version or at least >= 3.0.0?
Because the JSON stuff was only added in version three, see https://github.com/asantibanez/livewire-charts/releases/tag/v3.0.0

@sinarahmany
Copy link

As an alternative, try using available methods like setData() or addColumn(), depending on your needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants