asantibanez / livewire-charts

Neat Livewire Charts for your Laravel projects
MIT License
821 stars 119 forks source link

line chart is not working #59

Open suadikhasen opened 2 years ago

suadikhasen commented 2 years ago

I am using this chart column chart is working but the line chart is not working here is my code

$this->lineChartModel = (new LineChartModel())->setTitle('quotations each day')
        ->addPoint('18-10-2020', 200)->addPoint('19-10-2020', 100)->addPoint('20-10-2020', 300)
        ->addPoint('21-10-2020', 200)->addPoint('22-10-2020', 230) ->addPoint('23-10-2020', 280) 
        ->addPoint('24-10-2020', 210);
      return [
        'lineChartModel' => $this->lineChartModel
      ];

the line chart display but it is not showing the data it shows the default x and y-axis without value.

glennjacobs commented 2 years ago

If you are showing two charts on the same page, you might encounter this if you don't set a key on the Livewire component tag.

e.g.

      <livewire:livewire-column-chart
          key="one"
          :column-chart-model="$columnChartModel"
      />

      <livewire:livewire-line-chart
          key="two"
          :line-chart-model="$lineChartModel"
      />
Crtomas2 commented 1 year ago

Hello, can I ask how to Implement the LivewireLineChart on Laravel eloquent collection method ?