Coder Social home page Coder Social logo

Comments (22)

SteveRuben avatar SteveRuben commented on September 21, 2024 1

@sunny9240 , yep I got it.

from angular2-highcharts.

SteveRuben avatar SteveRuben commented on September 21, 2024 1

@pradipkachhadiya I'll create a gist soon

from angular2-highcharts.

vmohir avatar vmohir commented on September 21, 2024 1

I couldn't use this example! It gives me the error Map is unknown chart type. So I solved it with this link

from angular2-highcharts.

gevgeny avatar gevgeny commented on September 21, 2024

Sure http://plnkr.co/edit/AmDfKwhRhshFn3CPprkk?p=preview

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

Thanks!

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

I can duplicate your example and get it to work on a simple site, however I am trying to integrate into a site that I have forked off of angular2-seed.

I can't get it to integrate without throwing a "Highcharts is not defined" error when loading the highmaps module. I have tried a lot of different system config options pointed at both local npm locations and at your example locations and still get the same error when trying to load the highmaps module that Highcharts is undefined even though I can set static settings for the Highcharts like in your examples...

Any ideas?

Regards,

Marc

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

FWIW, I realized that including the highstock mapping was needed in the system config section. (Why not just highcharts.js?)

'highcharts/highstock.src': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/highstock.js',

This cleared up the "Highcharts is not defined" error, but it still won't let me initialize the Highchmap

Highchmap(Highcharts);

If I include that, the application errors out without a useful error message. I can see that it has imported the highcharts/modules/map.js file, but for some reason won't let it connect extend Highcharts.

Marc

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

Finally got it working. I had to import the map module like this:

import * as Highchmap from 'highcharts/modules/map';

from angular2-highcharts.

gevgeny avatar gevgeny commented on September 21, 2024

I see. It really looks very unclear and I think the reason is how Highcharts modules are organised. It was not created to be used as ES2015 modules. BTW what bundler do you use with angular2-seed ?

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

Angular2-seed uses systemjs builder.

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

Another question, how do you load a highcharts plugin? I have a highcharts zoom out plugin I would like to incorporate but i think that since it is not in a module format I can't load the same as the highcharts modules. Here is the link the plugin.

[http://www.highcharts.com/plugin-registry/single/26/Zoom%20Out%20Selection]

from angular2-highcharts.

gevgeny avatar gevgeny commented on September 21, 2024

I think it depends on how the plugin is implemented. Looks like this one (and most of other ones) is just a global script and not a module. AFAIK webpack allows to inject such scripts to bundle but i don't know how to manage it with systemjs.

from angular2-highcharts.

marcgr avatar marcgr commented on September 21, 2024

Thanks for the response. It seems like others using angular2-highcharts may end up wanting to extend highcharts with plugins, so worth thinking about.

I ended up pasting the plugin javascript at the bottom of my component file that is using highcharts and that seems to work. Not the most elegant solution, but is working. When I tried other routes, the load order became problematic since highcharts has to have been called before the plugin and the highcharts module is only loaded when the component is needed so a global include of the plugin wasn't working for me.

from angular2-highcharts.

gevgeny avatar gevgeny commented on September 21, 2024

I see. Do you have any ideas how it can be simplified in angular2-highcharts ?

from angular2-highcharts.

kogen00 avatar kogen00 commented on September 21, 2024

Hello,
has there been any new enlightment on this problem? I don't get it to work whenever I try something like this:

const Highcharts = require('highcharts/highcharts.src'); import 'highcharts/adapters/standalone-framework.src'; import * as Highchmap from 'highcharts/modules/map';

in my module while having it defined like that

'angular2-highcharts': 'https://cdn.rawgit.com/gevgeny/angular2-highcharts/v0.3.0/dist', 'highcharts/highstock.src': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/highstock.js', 'highcharts/adapters/standalone-framework.src': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/adapters/standalone-framework.src.js', 'highcharts/modules/map': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/modules/map.js', 'highcharts': 'node_modules/highcharts',

as a "map" specification in my system.config.js file I finally get a bunch of errors:

3:18 Error: (SystemJS) Highchmap is not defined
ReferenceError: Highchmap is not defined

I'm confused.

from angular2-highcharts.

khraibani avatar khraibani commented on September 21, 2024

@gevgeny can you please provide an example using webpack instead of systemjs.

from angular2-highcharts.

gevgeny avatar gevgeny commented on September 21, 2024

@khraibani there is one in the readme

from angular2-highcharts.

SteveRuben avatar SteveRuben commented on September 21, 2024

Hi @gevgeny , how can we use highchart and highmap in the same module ?

from angular2-highcharts.

sunny9240 avatar sunny9240 commented on September 21, 2024

@Tryptich , Have you got any solution to use highchart and highmap in the same module ?

from angular2-highcharts.

pradipkachhadiya avatar pradipkachhadiya commented on September 21, 2024

Hi @gevgeny , how can we highchart and highmap both in my angular 2 web app?

from angular2-highcharts.

pradipkachhadiya avatar pradipkachhadiya commented on September 21, 2024

Have you got any solution to use highchart and highmap in the same module ?'
@Tryptich can you please provide an example or solution ?

from angular2-highcharts.

Prashanth-Thomas avatar Prashanth-Thomas commented on September 21, 2024

@pradipkachhadiya I seem to be dealing with the similar issue in Angular2. i require highstocks and highmaps within a single module.

But from what i have read, people suggest we place them in separate modules.

from angular2-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.