Code Monkey home page Code Monkey logo

Comments (15)

nawlbergs avatar nawlbergs commented on May 18, 2024 8

The "highchartsng.reflow" event seems has disappeared in the .component version.
How do we trigger a ctrl.chart.reflow(); with the .component version?

from highcharts-ng.

pderksen avatar pderksen commented on May 18, 2024 3

@pablojim Thanks for adding it in. It's working well in the app I'm working on.

@mgrn0 I'm broadcasting the reflow within a watch on the parent container's size change. I had to add a $timeout to wait for the parent container resize to finish, which you may or may not need.

$timeout(function() {
    $scope.$broadcast('highchartsng.reflow');
}, 10);

from highcharts-ng.

pablojim avatar pablojim commented on May 18, 2024

I think we'd need to call chart.reflow(). Maybe we could add a listener to the directive to listen for an event that would trigger a chart.reflow()

from highcharts-ng.

brayniverse avatar brayniverse commented on May 18, 2024

Not a bad idea. Is there anything else that would benefit from emitting events?

from highcharts-ng.

pajooh avatar pajooh commented on May 18, 2024

for now, i added this listener on this directive's link function:

      scope.$on('resize', function () {
         chart.reflow();
      });

broadcasting resize event somewhere in parent controller works for me

if you want, i can create a PR

from highcharts-ng.

pablojim avatar pablojim commented on May 18, 2024

A pull request sounds good. Maybe call the event "highchartsng_reflow" to avoid interfering with anything else.

from highcharts-ng.

pajooh avatar pajooh commented on May 18, 2024

also, i think watching width/height of chart out of config.options is required, because it's enough to reflow the chart on resizing, and other stuff (initChart, processSeries, redraw) is not required

from highcharts-ng.

pderksen avatar pderksen commented on May 18, 2024

I could really use this feature as well. Happy to test or help where I can.

from highcharts-ng.

mgrn0 avatar mgrn0 commented on May 18, 2024

+1

from highcharts-ng.

pablojim avatar pablojim commented on May 18, 2024

I added an event highchartsng.reflow Thanks for all the comments,

from highcharts-ng.

mgrn0 avatar mgrn0 commented on May 18, 2024

can you please give me a brief idea of how to invoke the event from e.g. a button? I just dont get it working..

from highcharts-ng.

mgrn0 avatar mgrn0 commented on May 18, 2024

thank you, @pderksen - that helped a lot!

from highcharts-ng.

oriko avatar oriko commented on May 18, 2024

Hi

Why when I am using the "highchartsng.reflow" event I get a link to highcharts.com on chart right side?

Thanks,

from highcharts-ng.

MattSidor avatar MattSidor commented on May 18, 2024

Have you disabled the credits explicitly in your graph's config object?

$scope.graphConfig = {
  options: {
    credits: {
      enabled: false
    }
  }
};

from highcharts-ng.

DezrtRose avatar DezrtRose commented on May 18, 2024

thank you, @pderksen

from highcharts-ng.

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.