What causes the left click to not trigger in Kendo's Angular Charts?

My homepage features a simple bar chart that displays correctly, but I am having trouble capturing the left click event (the right click works fine).

This is an example of code from my template:

<kendo-chart *ngIf="(dataExists | async)"
             [legend]="chartConfig.legend"
             [axisDefaults]="chartConfig.axisDefaults"
             [chartArea]="chartConfig.chartArea"
             [plotArea]="chartConfig.plotArea"
             [seriesDefaults]="chartConfig.seriesDefaults"
             [valueAxis]="chartConfig.valueAxis"
             [transitions]="chartConfig.transitions"
             (seriesClick)="onSeriesClick($event)">
    <kendo-chart-series>
        <kendo-chart-series-item *ngFor="let item of (data | async)"
                                 [data]="[item]"
                                 [field]="dataField"
                                 [name]="item.Name">
        </kendo-chart-series-item>
    </kendo-chart-series>
</kendo-chart>

I am utilizing seriesClick to capture my click events.

This snippet shows part of a component's code:

public onSeriesClick(e: SeriesClickEvent): void {
        if (this.isLeftClick(e)) {
            this.router.navigateByUrl('/videos');
        }
    }

    private isLeftClick(e: SeriesClickEvent) {
        return e.originalEvent.event && e.originalEvent.event.button === 0;
    }

While the right click is being caught successfully, the left click event is not triggering the onSeriesClick function. Upon inspecting the call stack, no stopPropagation was found. Can you assist in resolving this issue?

The following screenshots show the call stack from the Chrome developer panel:

main.js belongs to progress/kendo-charts/dist/npm

https://i.stack.imgur.com/JLKA3.pnghttps://i.stack.imgur.com/mT3gz.pnghttps://i.stack.imgur.com/ccBn3.pnghttps://i.stack.imgur.com/4y3Hs.png

Chart configuration

import { ChartConfigInterface } from '../../shared/components/charts/interfaces/chart-config-interface';

export const ChartConfig: ChartConfigInterface = {
    legend: {
        visible: false
    },
    axisDefaults: {
        majorGridLines: false
    },
    seriesDefaults: {
        type: 'column',
        labels: {
            position: 'insideBase',
            margin: -24, 
            format: 'n',
            visible: true,
            content: e => e.series.name
        }
    },
    valueAxis: {
        labels: {
            step: 5,
        },
        majorUnit: 1,
        type: 'numeric'
    },
    chartArea: {
        height: 280
    },
    plotArea: {
        margin: 10,
        padding: 0
    },
    transitions: false
};

package.json

"@progress/kendo-angular-charts": "1.2.2",
"@progress/kendo-angular-dialog": "0.20.0",
"@progress/kendo-angular-intl": "1.2.2",
"@progress/kendo-angular-l10n": "0.3.0",
"@progress/kendo-angular-popup": "0.17.0",
"@progress/kendo-drawing": "1.1.2",
"@progress/kendo-theme-default": "2.33.5"

Additionally, I encounter a few errors upon loading my home page.

 Unhandled Promise rejection: Cannot read property 'observers' of undefined ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot read property 'observers' of undefined
        at ChartComponent.requiresHandlers (chart.component.js:291)
        at ChartInstanceObserver.requiresHandlers (main.js:461)
        at Chart.requiresHandlers (main.js:110326)
        at Chart._shouldAttachMouseMove (main.js:21873)
        at Chart._attachEvents (main.js:21107)
        at main.js:20591
        at ZoneDelegate.invoke (vendors.js?78cf9b57189af0bd597d:14920)
        at Zone.run (vendors.js?78cf9b57189af0bd597d:14680)
        at vendors.js?78cf9b57189af0bd597d:15315
        at ZoneDelegate.invokeTask (vendors.js?78cf9b57189af0bd597d:14953)
        at Zone.runTask (vendors.js?78cf9b57189af0bd597d:14720)
        at drainMicroTaskQueue (vendors.js?78cf9b57189af0bd597d:15148) 

TypeError: Cannot read property 'observers' of undefined
    at ChartComponent.requiresHandlers (http://localhost/app.js?78cf9b57189af0bd597d:87177:35)
    at ChartInstanceObserver.requiresHandlers (http://localhost/app.js?78cf9b57189af0bd597d:89711...

Answer №1

The issue at hand stemmed from a faulty Kendo npm package that I uncovered.

This snippet showcases part of my package.json:

"@progress/kendo-angular-charts": "1.2.2",
"@progress/kendo-angular-dialog": "0.20.0",
"@progress/kendo-angular-intl": "1.2.2",
"@progress/kendo-angular-l10n": "0.3.0",
"@progress/kendo-angular-popup": "0.17.0",
"@progress/kendo-drawing": "1.1.2",
"@progress/kendo-theme-default": "2.33.5",

While this is just one section of my package.json, the real culprit was

"@progress/kendo-angular-charts": "1.2.2"
which relied on
"@progress/kendo-charts": "1.9.0"
. This particular package automatically updated to version 1.11.0. Post-update, errors surfaced in the chart.component.js file with the PlotAreaLeave callback being undefined (One of two callbacks – PlotAreaHover and PlotAreaLeave). Consequently, my angular component failed to initialize and lost functionality for left-click actions.

A Fixing Action
To rectify the issue, I opted to specify the previous version,

"@progress/kendo-charts": "1.9.0"
, in my package.json.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using JSON parsing to dynamically create classes with preloaded background images

Today, I successfully deployed my browser game using MVC4 to my website for the first time. I am currently navigating through the differences between running the site off of localhost and running it from the actual website. My process involves loading all ...

The combination of Ajax, JavaScript, PHP/HTML, and dynamic variables

Hey there, I'm currently working on a game development project and have encountered what seems to be a scope issue. The issue arises in my js file when a player clicks on the card they want to play: It starts in my js file:</p> <pre>&l ...

Zendesk API integration with Angular is experiencing issues with retrieving data as a result of a CORS restriction

I have been working with the Zendesk API and have encountered a problem. Despite being able to successfully send POST requests (even though the response indicates an error), I am unable to make GET requests using my Angular 4 application along with HttpCli ...

React component making repeated calls to my backend server

As a React newbie, I am currently in the process of learning and exploring the framework. I recently attempted to fetch a new Post using axios. However, upon hitting the '/getPost' URL, I noticed that the GetPost component continuously calls the ...

Having trouble changing fonts in JavaScript Photoshop using scripting on certain fonts

I have created a script for photoshop that is designed to change the font family to a different type. However, I am experiencing some inconsistencies in its performance. Here is the section of the script responsible for altering the font family: var origD ...

Revolutionary scroll-based navigation fill transition

I'm attempting to achieve an effect where the fill color of the "insticon" SVG changes from black to white based on the scroll position indicated in the jQuery code. I have made the necessary modifications in the if and else statements, but unlike "he ...

Problem with Bootstrap multiselect: it only opens the first time, and stops working after an ajax call

I am having trouble using Bootstrap multiselect with jQuery ajax. When I run the ajax code, the multiselect button stops working properly. To see the issue in action, click here: and look at the last multiselect dropdown. Here is the ajax code snippet: ...

Is there a way to dynamically toggle the visibility of a floating textarea between on and off?

I have my own blog website: Essentially, what I am aiming for is When a user clicks on the search button, a floating semi-transparent textarea window should appear inside the designated rectangle area (as shown in the image, that red orange rectangle). ...

What is the best way to display a message on the 403 client side when an email sending fails?

I am attempting to display an alert message when the email is sent successfully or if it fails. If it fails, I receive a 403 status code from the backend. However, I am unsure how to handle this error on the client-side. In the case of success, I receive a ...

Ways to Export HTML to Document without any borders or colorful text

How can I make a contentEditable area visible when filling text and then disappear when exporting the document? I found a script online that allows you to do this, but the issue is that the contentEditable area is not visible until clicked on. To address t ...

A function in Jasmine for testing that returns a promise

I have implemented the following function: function getRepo(url) { var repos = {}; if (repos.hasOwnProperty(url)) { return repos[url]; } return $.get(url) .then(repoRetrieved) .fail(failureHandler); function ...

What is the best way to pass multiple row values in a form field using AngularJS to a web API?

Is it possible to insert multiple row values in an AngularJS controller using a web api? <tr ng-repeat="rt in xxtt"> <td> <input type="text" class="form-control" ng-model="rt.name" required /> </td> <td> ...

Revamping Tab Styles with CSS

Currently, I am working on a mat tab project. The code snippet I am using is: <mat-tab-group> <mat-tab [label]="tab" *ngFor="let tab of lotsOfTabs">Content</mat-tab> </mat-tab-group> If you want to see the liv ...

Ways to prevent adding duplicate elements to a state array in React.js?

The state provided below is within my class component. I need to prevent adding duplicate objects to an array in my state as shown below: this.state = { frequency: { time: [ {time:"20:15",timezone:"IST"}, ...

Is QA supported by LG WebOS 3.5 through webdriver?

I've been experimenting with Javascript ( nodejs ) and have successfully automated browser operations using selenium-webdriver on a local server. However, I am facing challenges when trying to automate tasks on my LG WebOS 3.5 TV. Does anyone know how ...

Using a static function within a library's state function in NextJS is throwing an error: "not a function"

Inside a library, there's a special class known as MyClass. This class contains a static method named setData. The contents of the MyClass.js file are shown below: class MyClass { static DATA = ''; static setData(data) { MyClass ...

Show information from a JSON file in a tooltip on a Highcharts' pie chart

I have a pie chart that shows two percentages. I am looking to update the tooltip content to display information from my JSON data. Here is an example of how my JSON data looks: {"object1":{"percentage": 0.7, "numberOfObject": 167}, "object2":{"percentage ...

What could be causing my ajax file uploader to malfunction?

I am currently working on building an AJAX file upload module. Below is a snippet of the code I have been using: //creating a form for uploading files via AJAX FileUploader.prototype.createForm = function() { // creating a new form var form = docu ...

Node JS: Despite modifying the URL, the response remains unchanged

My attempt to log in to teeSpring.com and retrieve a response from another URL using a login cookie seems to be causing an issue. Upon logging into teeSpring.com, the dashboard details are returned. However, when I try to make a GET request to the second U ...

Ways to populate an AngularJS array with text input from HTML

I'm new to AngularJS - attempting to create a simple todo-list application. I'm struggling with how to insert the text value from the input box into the 'todos' array. Here's my code snippet. HTML: <body ng-controller="MainCt ...