Giter Site home page Giter Site logo

Responsive Layout about ngx-charts HOT 7 CLOSED

swimlane avatar swimlane commented on May 16, 2024
Responsive Layout

from ngx-charts.

Comments (7)

marjan-georgiev avatar marjan-georgiev commented on May 16, 2024 1

There is currently a way to achieve a sort of responsiveness by changing the view parameter of the components to the new dimensions on parent resize. The charts are smart enough to adapt to the new dimensions, but there is room for a lot of improvement.

Some of the charts still need work on their layout (Advanced Pie Chart being one of them), as well as all of the charts that have legends.

We are open to any ideas and PR's are welcome.

from ngx-charts.

amcdnl avatar amcdnl commented on May 16, 2024

@yann510 - We haven't started working on it yet.

@marjan-georgiev can you point him in the direction to go about implementing this?

from ngx-charts.

yann510 avatar yann510 commented on May 16, 2024

@marjan-georgiev Do you guys have a slack or something ? I have some questions, which I believe would spam this issue.

from ngx-charts.

marjan-georgiev avatar marjan-georgiev commented on May 16, 2024

@yann510 we have a gitter channel: https://gitter.im/swimlane/ng2d3

from ngx-charts.

marjan-georgiev avatar marjan-georgiev commented on May 16, 2024

@yann510 Refactored the code in this commit:
7686e79

I added unsubscribe on chart destroy, as the subscriptions were never being cancelled.

Also modified the behavior:

  • If the chart has the view input property set, then the dimensions come from the input property
  • If the chart does not have the input property set, the dimensions will come from it's parent container

This was added so that you can still manually override the width/height of the chart, in case you don't want it to fit the parent container.

There is one last thing that needs to be added, but I will open a new issue for it. Sometimes the parent container can be resized without resizing the window. In this case, window.onResize will not fire. We will need to add a manual listener on the charts that can trigger the update from outside.

from ngx-charts.

yann510 avatar yann510 commented on May 16, 2024

Awesome !
Some very important details I didn't think about.
Thanks for working with me on this one, definitely looking forward to contributing more.

from ngx-charts.

mailok avatar mailok commented on May 16, 2024

Hi!!, how to update manually??

from ngx-charts.

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.