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

Event is not defined #346

Open
farmerhan opened this issue Jun 17, 2022 · 0 comments
Open

Event is not defined #346

farmerhan opened this issue Jun 17, 2022 · 0 comments

Comments

@farmerhan
Copy link

What Version?

3.1.14

Issue

Uncaught ReferenceError: selectHandler is not defined

Controller Code (chart creation code)

        \Lava::GeoChart('Province Orders', $provinceOrderDttb, [
            'displayMode' => 'auto',
            'enableRegionInteractivity' => true,
            'keepAspectRatio' => true,
            'region' => 'US',
            'magnifyingGlass' => ['enable' => true, 'zoomFactor' => 7.5], //MagnifyingGlass Options
            'markerOpacity' => 1.0,
            'resolution' => 'provinces',
            'sizeAxis' => null,
            'events' => ['select' => 'selectHandler']
 ]);

View Code

// I defined it in head tag
<script>
[home.txt](https://github.com/kevinkhill/lavacharts/files/8923487/home.txt)

        lava.js(function() {
            function selectHandler(event, chart) {
                console.log('Hi');
            }
        })
</script>

// Here is render charts which are below script
<?= \Lava::render('GeoChart', 'Province Orders', 'province-order-chart') ?>
<?= \Lava::render('PieChart', 'District Orders', 'district-order-chart') ?>

Hope you support it!

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

1 participant