Coder Social home page Coder Social logo

Comments (4)

avdaredevil avatar avdaredevil commented on September 22, 2024

Yeah hight-responsive lets you reflow the chart height wise as well. I've included an example in this fiddle.

The basic premise is that hight-responsive makes the element have no inherent height, so you could either give height to the <highcharts-chart> element or its parent (by setting <highcharts-chart>'s height to 100%).

But that will not reflow the chart for you! Since changing an elements height does not trigger an event, thus you still need to manually run the resizeChart() function on the component as soon as it's parent is loaded and visible.

from highcharts-chart.

lycandroid avatar lycandroid commented on September 22, 2024

Thanks, yes I can see that working so my problem must be something else I'm doing wrong which I can't figure out at the moment. I'm wrapping your highcharts-chart in my own (polymer 2.x) component so I'm no doubt doing something wrong there.

In the meantime I added Polymer.IronResizableBehavior to my component and handle the iron-resize with:

    _onResize(e) {
      var chart = this.$.chart;
      var renderer = this.$.chart.renderer;

      if ( renderer.width != this.offsetWidth || renderer.height != this.offsetHeight )
        chart._chart.setSize(this.offsetWidth, this.offsetHeight, false );
    }

I suppose possibly you could add iron-resize support to highcharts-chart then it would auto adjust height without requiring the manual call to resizeChart()?

from highcharts-chart.

avdaredevil avatar avdaredevil commented on September 22, 2024

Sure that sounds like a splendid idea! I would however remark that your resize implementation may not be very performance friendly. The difference between reflow() and setSize() is very noticeable. I'd recommend the former.

from highcharts-chart.

avdaredevil avatar avdaredevil commented on September 22, 2024

@lycandroid A polymer 2.0 version of this lib is now completed if you'd like to use that instead. It's under the branch polymer-2.0!

Branch: polymer-2.0
PR: #24

from highcharts-chart.

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.