question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

r.globals.xAxisScale is null / Cannot read property 'niceMin' of null

See original GitHub issue

I am trying to put a brush chart in my React App. I only want a single, minimalist chart to start with. My target chart is hidden.

I get a console error instead of a selection event when I change the selection of my chart on my webpage.

In Chrome, it says: Cannot read property ‘niceMin’ of null In Firefox, it says r.globals.xAxisScale is null

Here is how I am defining my chart options

var series = [{
  name: 'vals',
  data: data_vals
}];

// Dummy Data
var data_idx = Array.from(Array(255).keys());
var data_vals = Array.from({length: 255}, () => Math.ceil(Math.random() * 100));


var brushChartOptions = {
  colors: ['#04638f'],
  fill: {
    type: "gradient",
    gradient: {
      opacityFrom: 0.1,
      opacityTo: 0.91
    }
  },
  xaxis: {
    type: 'category',
    labels: {
      show: false
    },
    axisTicks: {
      show: false,
    },
    categories: data_idx
  },
  yaxis: {
      show: false,
  },
  chart: {
    id: "chartBrush",
    brush: {
      enabled: true,
      target: "hiddenChart"
    },
    events: {
      selection: function (chartContext, {xaxis, yaxis}) {
        console.log(chartContext);
      }
    },
    selection: {
      enabled: true,
      xaxis: {
        min: 0,
        max: 255
      }
    }
  },

}

var hiddenChartOptions = {
  chart: {
    id: "hiddenChart",
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lengomancommented, Feb 16, 2020

This error is no longer happening on version 1.5.2

0reactions
junedchhipacommented, Jan 5, 2020

Currently, the brush chart works only with datetime xaxis. @michaeljakob If you want to override the labels of datetime xaxis with your own formatter, you can do

xaxis: {
  type: 'datetime',
  tickAmount: 10,
  labels: {
    formatter: function(value) {
     ...
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular - Cannot read property 'globals' of null - Stack Overflow
I just discovered a weird bug in my angular application (1.4.7) When I'm on the page /#/dashboard , if I click on the...
Read more >
Uncaught TypeError: Cannot read properties of null ... - Reddit
I have a javascript file that loads on every page - one contains a script for my contact form and another for my...
Read more >
A Pen by Lukas Leitsch - CodePen
... r(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported! ... niceMin=e,t.globals. ... xAxisScale=null,e.
Read more >
Manual
null. A null data type is used for data where Tao is not able to calculate a model value. Such data cannot be...
Read more >
apexcharts - Versions diffs - 0.1.9 → 0.1.10 - Mend - Diffend
typeof Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot ... r=[],n=t;i>=0;)r.push(n),n+=s,i-=1;return{result:r,niceMin:r[0] ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found