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

Uncaught TypeError: Cannot read property 'chartX' of null #4505

Closed
thientran1707 opened this issue Aug 25, 2015 · 8 comments
Closed

Uncaught TypeError: Cannot read property 'chartX' of null #4505

thientran1707 opened this issue Aug 25, 2015 · 8 comments

Comments

@thientran1707
Copy link

I see this error when I use highcharts with my project. Despite the fact that it does not affect anything. I just want to know what's wrong with this. This is the settings for the chart

var socialMap = new Highcharts.Map({
  chart: {
    renderTo: socialRadarNode,
    borderWidth: 1,
    backgroundColor: "#E4F1FE"
  },
  credits: {
    enabled: false
  },
  title: {
    text: 'Social Radar'
  },
  tooltip: {
    crosshairs: [{
      zIndex: 5,
      dashStyle: 'dot',
      snap: false,
      color: 'white'
    },
    {
      zIndex: 5,
      dashStyle: 'dot',
      snap: false,
      color: 'white'
    }]
  },
  mapNavigation: {
    enabled: true
  },
  series: [{
    name: 'Basemap',
    mapData: mapData,
    borderColor: '#606060',
    nullColor: 'white',
    showInLegend: false
  },
  {
    name: 'Republican States',
    mapData: mapData,
    data: republicSates,
    joinBy: ['postal-code', 'code'],
    color: '#D91E18',
    tooltip: {
      pointFormat: '{point.name}'
    },
    allAreas: false
  },
  {
    name: 'Democrat States',
    mapData: mapData,
    data: democratStates,
    joinBy: ['postal-code', 'code'],
    color: '#446CB3',
    tooltip: {
      pointFormat: '{point.name}'
    },
    allAreas: false
  },
  {
    name: 'Mindexed States',
    mapData: mapData,
    data: mixedStates,
    joinBy: ['postal-code', 'code'],
    color: '#BF55EC',
    tooltip: {
      pointFormat: '{point.name}'
    },
    allAreas: false
  }]
});
@pawelfus
Copy link
Contributor

Tried to reproduce your issue, but for me it works fine: http://jsfiddle.net/gqq7cfob/1/
Could you update my jsFiddle to get this error reproduced?

@pawelfus
Copy link
Contributor

Commit above is a typo in the ticket number..

@thientran1707
Copy link
Author

hi, still do not understand why sometimes the error appears, but sometimes it does not

@pawelfus
Copy link
Contributor

pawelfus commented Sep 7, 2015

Maybe you have sometimes corrupted data? It looks like connected to the data since my demo doesn't throw error at all. Or maybe is connected to specific width for the chart?

@thientran1707
Copy link
Author

it happens when I try to zoom the chart. Maybe I will try with the width of chart

@MiChAeLoKGB
Copy link

I have same problem and its happening even in your demo. In that JS fiddle it happens when you start zooming while not hovered on any country that has data and then hover over any of them and again start zooming. On my bubble map its happening whenever I hover over bubble and use scroll wheel to zoom.

@pawelfus
Copy link
Contributor

Right, thank you for pointing this out! Steps:

  1. Double click on the chart to zoom in.
  2. Drag&drop the chart when hovering one of the filled shapes

We can observe errors in the console and crosshair has wrong position:

Uncaught TypeError: Cannot read property 'chartX' of null

maps_2

@wwuck
Copy link
Contributor

wwuck commented Feb 22, 2016

The api docs say that the crosshair configuration has moved to the Axis object since Highmaps 1.1.

http://jsfiddle.net/gqq7cfob/2/

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

No branches or pull requests

4 participants