Code Monkey home page Code Monkey logo

Comments (17)

johnarrr avatar johnarrr commented on May 18, 2024 6

@lmaccherone and anyone else who comes along later -- this seems to work (with webpack, at least):

import ReactHighcharts from 'react-highcharts/dist/bundle/highcharts'
import HighchartsMore from 'highcharts-more'
HighchartsMore(Highcharts)

Using the ReactHighcharts bundle automatically adds Highcharts.

from react-highcharts.

laopunk avatar laopunk commented on May 18, 2024 2

For what it's worth, this solution works for me:

HighchartsMore = require('highcharts-more')(ReactHighcharts.Highcharts)

from react-highcharts.

lmaccherone avatar lmaccherone commented on May 18, 2024

I knew as soon as I asked, I would figure it out. This worked for me:

import ReactHighcharts from 'react-highcharts/bundle/highcharts';
import 'highcharts-exporting';
import 'highcharts-more';

It meant that I had to separately npm install highcharts-exporting and highcharts-more

from react-highcharts.

martin-svk avatar martin-svk commented on May 18, 2024

Hey I have a similar problem. I want to use highcharts-more to display solidgauge graph.
If I separately install highcharts-exporting and highcharts-more and import it like @lmaccherone I get error: HighchartsAdapter is not defined.

What is the preffered way to get the highcharts-more working. Thanks

from react-highcharts.

kirjs avatar kirjs commented on May 18, 2024

Are you sure you're using the latest version of highcharts?

from react-highcharts.

lmaccherone avatar lmaccherone commented on May 18, 2024

@martin-svk, did you try npm install highcharts-exporting and npm install highcharts-more and use the imports I show above?

from react-highcharts.

martin-svk avatar martin-svk commented on May 18, 2024

@kirjs Yes I think I am. (version 4.2.1). But I am importing the bundled highcharts in react-highcharts.

I also tried to import highcharts separetaly from react-highcharts like this:

import Highcharts from 'highcharts';
import ReactHighcharts from 'react-highcharts';

but got Highcharts is not bundled by default. use "react-highcharts/dist/bundle/highcharts" instead, or include highcharts. error.

@lmaccherone Yes, I did exactly this:

import ReactHighcharts from 'react-highcharts/bundle/highcharts';
import 'highcharts-exporting';
import 'highcharts-more';

and got HighchartsAdapter is not defined error.

from react-highcharts.

kirjs avatar kirjs commented on May 18, 2024

What if you try using non-bundled version?

from react-highcharts.

martin-svk avatar martin-svk commented on May 18, 2024

@kirjs As I wrote, I tried to use non-bundled Highcharts:

import Highcharts from 'highcharts';
import ReactHighcharts from 'react-highcharts';

but got Highcharts is not bundled by default. use "react-highcharts/dist/bundle/highcharts" instead, or include highcharts. error.

from react-highcharts.

kirjs avatar kirjs commented on May 18, 2024

ReachHighcharts expects global Highcharts variable, can you try setting it explicitly?

from react-highcharts.

martin-svk avatar martin-svk commented on May 18, 2024

Hi, it seems to not work with ES6 import but I managed to get rid of Highcharts is not bundled by default... message with this:

global.Highcharts = require('highcharts');
const ReactHighcharts = require('react-highcharts'); // This works

For information, I can't even combine the imports like this:

global.Highcharts = require('highcharts');
import ReactHighcharts from 'react-highcharts'; // This does not work

But that still does not solve my problem (which is to import highcharts-more to be able to use solidgauge graph). I tried:

global.Highcharts = require('highcharts');
global.HighchartsMore = require('highcharts-more');
const ReactHighcharts = require('react-highcharts');

Which don't produce any error but still throwing The requested series type does not exist Highcharts error 17. Then I tried also require highcharts-exporing:

global.Highcharts = require('highcharts');
global.HighchartsMore = require('highcharts-more');
global.HighchartsExporting = require('highcharts-exporting');
const ReactHighcharts = require('react-highcharts');

But that fails with HighchartsAdapter is not defined error.

from react-highcharts.

kirjs avatar kirjs commented on May 18, 2024

This seems to be more about the modules, I created an issue in another repository: kirjs/publish-highcharts-modules#3

from react-highcharts.

lmaccherone avatar lmaccherone commented on May 18, 2024

Thanks John. This is working for me:

ReactHighcharts = require('react-highcharts/bundle/highcharts')
require('highcharts-exporting')
require('highcharts-more')

On Mon, Jan 25, 2016 at 1:48 PM John Reuning [email protected]
wrote:

@lmaccherone https://github.com/lmaccherone and anyone else who comes
along later -- this seems to work (with webpack, at least):

import ReactHighcharts from 'react-highcharts/dist/bundle/highcharts'import HighchartsMore from 'highcharts-more'HighchartsMore(Highcharts)

Using the ReactHighcharts bundle automatically adds Highcharts.


Reply to this email directly or view it on GitHub
#72 (comment)
.

from react-highcharts.

thanasis00 avatar thanasis00 commented on May 18, 2024

For what it's worth, this solution works for me:

HighchartsMore = require('highcharts-more')(ReactHighcharts.Highcharts)

Thank you for this answer. It worked for me, too.

from react-highcharts.

surmistry avatar surmistry commented on May 18, 2024

Here's a VERY clear example of a fully working react app and highcharts-more integration into a component 🎉 🔥 💯 https://kirjs.github.io/react-highcharts/more.html

from react-highcharts.

kenkotch avatar kenkotch commented on May 18, 2024

Has anyone been able to implement highcharts-more into react-native?

from react-highcharts.

Sunzhuoyi avatar Sunzhuoyi commented on May 18, 2024

import * as ReactHighcharts from "react-highcharts"; <br/> import * as HighchartsMore from "highcharts/highcharts-more"; <br/> HighchartsMore(ReactHighcharts.Highcharts);

this way worked for me

from react-highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.