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.

Access to Highcharts.getOptions().colors?

See original GitHub issue

Hi,

I’m working through a Highcharts example and using React with your excellent project here.

Unfortunately I’m really struggling to access Highcharts.getOptions().colors. Can I do it from a standard import like:

var Highcharts = require('react-highcharts');

Or do I have to import the highcharts library separately? I’m afraid my understanding of node’s modules is not good enough to figure it out, though hopefully it is simple.

Any help would be much appreciated, Michael

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kirjscommented, Jun 11, 2015

Hi michaeljones,

You should be able to access Highcharts object as Highcharts.Highcharts. e.g. Highcharts.Highcharts.getOptions().colors.

Please let me know if this works for you.

0reactions
michaeljonescommented, Jun 11, 2015

Hi @kirjs,

Thanks for the response and thank you @Kureev. I did try your approach @kirjs and it didn’t seem to work but I’ve just realised I was still on 0.0.7. If I update to the latest on npm then it works.

Sorry for the trouble, I should know better than to fail to check for newer versions.

It might be worth documenting the availability of Highcharts.Highcharts if it isn’t covered already. I can’t see reference to it.

Cheers, Michael

Read more comments on GitHub >

github_iconTop Results From Across the Web

colors | highcharts API Reference
An array containing the default colors for the chart's series. When all colors are used, new colors are pulled from the start again....
Read more >
How to use the highcharts.getOptions function in ... - Snyk
To help you get started, we've selected a few highcharts. ... getOptions().colors.map(function (color) { return { radialGradient: { cx: 0.4, cy: 0.3, ...
Read more >
Angular-highcharts colors. Is there any way to get color ...
Already solved, but just wondering, is there any way to get an access to the highcharts colors besides Highcharts.getOptions()?.
Read more >
Highcharts Demo - JSFiddle - Code Playground
1. var colors = Highcharts.getOptions().colors; ; 2. ​ ; 3. Highcharts.chart('container', { ; 4. title: { ; 5. text: 'Zones on X axis'....
Read more >
Highcharts - Chart having Multiple Axes - Tutorialspoint
getOptions().colors[0] } } }, { // Tertiary yAxis gridLineWidth: 0, title: { text: 'Sea-Level Pressure', style: { color: Highcharts.getOptions().colors[1] } ...
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