frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.94k stars 718 forks source link

Fix: Sometimes index === -1 #248

Closed emilsgulbis closed 4 years ago

emilsgulbis commented 5 years ago

Sometimes when mouse-overing container, i got vendors.app.js:8427 Uncaught TypeError: Cannot read property 'xPos' of undefined that is caused by -1 index

Explanation About What Code Achieves:
Screenshots/GIFs:
Screenshot 2019-10-07 at 14 39 07
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 138


Totals Coverage Status
Change from base Build 136: 0.0%
Covered Lines: 29
Relevant Lines: 62

💛 - Coveralls
bennylut commented 4 years ago

I am also having this issue - a workaround that I found was to disable pointer events in the relevant components:

.chart-container {
    pointer-events: none;

    .chart-draw-area {
        pointer-events: all;

        .y.axis {
            pointer-events: none;
        }

        .x.axis {
            pointer-events: all;
        }
    }
}
willjosefi commented 4 years ago

hi, is this merge didn't publish yet? on npmjs i just can see the 1.3.0 version, which contains that bug :( is there a way to use the updated version?