Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Axis Laravel Package

epessine/axis

View on GitHub
Deep Wiki
Context7

title: 'Highcharts' weight: 3 prev: /docs/drawing-charts next: false

{{< callout >}} In this section we will reproduce the same chart as the Your First Chart section of the Highcharts docs. {{< /callout >}}

After installing Axis and Highcharts, we can instantiate a chart object and pass it to a view on a controller:

use Axis\Chart;

class ExampleController extends Controller
{
    public function __invoke(): View
    {
        $chart = Chart::highcharts()
            ->bar()
            ->title('Fruit Consumption')
            ->labels(['Apples', 'Bananas', 'Oranges'])
            ->series('Jane', [1, 0, 4])
            ->series('John', [5, 7, 3])
            ->options(['yAxis' => ['title' => ['text' => 'Fruit eaten']]]);

        return view('example.chart', compact('chart'));
    }
}

On the blade file:

<section>
    <div>{{ $chart }}</div>
</section>

You should get a chart like this:

Pretty simple, right?

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
baks-dev/finances
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle