Giter VIP home page Giter VIP logo

Comments (9)

moberwasserlechner avatar moberwasserlechner commented on June 10, 2024

Could you please provide a example because in the demo I don't see that behaviour.

from vaadin-chartjs.

dyorgio avatar dyorgio commented on June 10, 2024

Same problem here, but with two behaviors:

When navigate to view (Problem):
captura de tela 2017-01-04 as 16 21 44

When call browser refresh (Ok):
capura de tela 2017-01-04 as 16 21 59

No mystery on layout, just setSizeFull() on Chart component.

from vaadin-chartjs.

moberwasserlechner avatar moberwasserlechner commented on June 10, 2024

@dyorgio thanks for the clarification

from vaadin-chartjs.

dyorgio avatar dyorgio commented on June 10, 2024

@moberwasserlechner @gokhanoner
If you put on charts-connector.js this line:

canvas.setAttribute('height', '100%');

The problem stops, but, in my retina display (HDPi), the chart appears smooth (bad rendered).

from vaadin-chartjs.

moberwasserlechner avatar moberwasserlechner commented on June 10, 2024

@dyorgio
Your retina display issue might be related to chartjs/Chart.js#3575.

Could you please share your configuration, because in the mentioned issue resizing problems appear if 'responsive' option was set to false.

from vaadin-chartjs.

dyorgio avatar dyorgio commented on June 10, 2024

@moberwasserlechner I made new test with this modification:

  • Update Chartjs to 2.4.0.

Now the problem only occurs if I use

chart.maintainAspectRatio(true).

But, using

chart.maintainAspectRatio(false)

works perfectly to me, including responsive resizing.

Animations stopped to work using % sizes, if I change to pixels animations works ok.

from vaadin-chartjs.

Maegar avatar Maegar commented on June 10, 2024

@moberwasserlechner
I investigate some time for analysing why the chart is not sized correctly
I find the following in chartjs-connector.js:
if (state.width > 0) {

The width in state object is a string (e.g. 100%) state.width > 0 will always return false. If you change the line to state.width.length > 0 or something similar it should work.

Best regards

from vaadin-chartjs.

moberwasserlechner avatar moberwasserlechner commented on June 10, 2024

@Maegar @dyorgio thx for that. I hope I can get a new release ready soon.

from vaadin-chartjs.

gokhanoner avatar gokhanoner commented on June 10, 2024

I'm just looking to the demo site, pie with data refresh example. When I refresh the data, chart size incorrectly until you resize the browser.

from vaadin-chartjs.

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.