#25330·highcharts

Export-data throws "Cannot read properties of null (reading 'y')" after addPoint into a cropped series

Author: dvd900Created Sep 10, 2026Updated Sep 17, 2026
LabelsType: BugProduct: Highcharts

Expected behaviour

chart.exporting.getCSV() / downloadCSV / downloadXLS / getTable should export the series data after series.addPoint() has inserted a point.

Actual behaviour

Uncaught TypeError: Cannot read properties of null (reading 'y') thrown from getDataRowsgetPointArray:

TypeError: Cannot read properties of null (reading 'y')
    at getPointArray (export-data.src.js)  namedPoints = series.data.some((d) => (typeof d.y !== 'undefined') && d.name)
    at Array.some (<anonymous>)
    at Exporting.getDataRows
    at Exporting.getCSV
    at Exporting.downloadCSV

Cause: Series.addPoint splices a literal null into series.data when the point is inserted in the middle of a sorted series or the series has processed data (series.data.splice(i, 0, null) in Core/Series/Series.ts). The slot is filled by generatePoints only for points inside the current extremes, so on a cropped series the null survives the redraw. getPointArray in Extensions/ExportData/ExportData.ts then iterates series.data with .some((d) => typeof d.y !== 'undefined' && d.name) and has no guard for that null.

Note that Array.prototype.some skips holes, so the sparse undefined slots that cropping normally leaves in series.data are fine; only the null from addPoint triggers this.

It is also reachable without calling addPoint directly. series.setData() (and therefore series.update() / chart.update() with new data) routes unmatched x values through addPoint when it takes the updateData path, which requires the series to be uncropped at that moment. If the new data then exceeds cropThreshold and extends past the axis extremes, the redraw crops the series and the null slots outside the extremes survive. That is how we hit it in production: a chart whose data is replaced in place, followed by "Download CSV" from the export menu.

Live demo with steps to reproduce

https://jsfiddle.net/kh7fmLst/

javascript
const H = 3600e3;
const chart = Highcharts.stockChart('container', {
    navigator: { enabled: false },
    scrollbar: { enabled: false },
    rangeSelector: { enabled: false },
    xAxis: { min: 500 * H, max: 600 * H },
    series: [{
        data: Array.from({ length: 1000 }, (_, i) => [i * H, i])
    }]
});

// Insert a point in the middle, outside the visible range
chart.series[0].addPoint([10.5 * H, 1]);

// Throws: Cannot read properties of null (reading 'y')
console.log(chart.exporting.getCSV());

Steps: run the fiddle, open the console. Alternatively remove the getCSV line and pick "Download CSV" from the export menu.

Product version

Highcharts Stock 12.5.0. Also present in 13.0.2 and current master (ts/Extensions/ExportData/ExportData.ts, getPointArray).

Affected browser(s)

Chrome 152 (Windows), also reproducible in Node + jsdom. Not browser specific.