Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

How to catch click or mouse hover Events. #47

Open
kjhatis opened this issue Jun 5, 2018 · 0 comments
Open

How to catch click or mouse hover Events. #47

kjhatis opened this issue Jun 5, 2018 · 0 comments

Comments

@kjhatis
Copy link

kjhatis commented Jun 5, 2018

Hi,

can you please provide a working example to catch events on the Bars for a bar chart and same for line chart. My code looks like below and i need to catch the event.


 <chartjs-line 
                    :id="chart.id"  
                    :labels="chart.labels" 
                    :datasets="chart.data"
                    :option="chart.options"
                    :width="500"
                    :height="250"></chartjs-line>

And Option Object looks like this:


{
                "id": "SystemAverages",
                "title": "Top Systems",
                "labels": [
                    "ASDF..",
                    "XYZ..",
                    "ABC.."
                ],
                "data": [
                    "79.6970",
                    "73.5294",
                    "77.0290"
                ],
                "mybackgroundcolor": [
                    "#35a400",
                    "#35a400",
                    "#35a400"
                ],
                "mybordercolor": [
                    "#35a400",
                    "#35a400",
                    "#35a400"
                ],
                "option": {
                    "responsive": true,
                    "events": [
                        "click"
                    ],
                    "onClick": "handleEvent",
                    "maintainAspectRatio": true,
                    "title": {
                        "display": true,
                        "position": "top",
                        "text": "Top Regional School Systems"
                    },
                    "scales": {
                        "yAxes": [
                            {
                                "stacked": true
                            }
                        ]
                    }
                }

Thanks!

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

No branches or pull requests

1 participant