GithubHelp home page GithubHelp logo

Comments (11)

monbro avatar monbro commented on May 18, 2024

Ah I think this was a fault by me, I did not properly set the data and config.

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

Ok easy Fix, thx for closing
On 23 Jun 2016 10:24 a.m., "Michael Klein" [email protected] wrote:

Ah I think this was a fault by me, I did not properly set the data and
config.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#14 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAvLg6FWUWjPebhJMeJLHZsVZm62VhFjks5qOkKngaJpZM4I7xAv
.

from easychart.

monbro avatar monbro commented on May 18, 2024

Ah sorry I have to reopen it :)

I do set the data and the config. But it will show the preview and datatable from the last chart I was editing. Only as soon as I edit a field in the data table it will update the datatable and the preview to the correct / current chart.

Any idea what this could be?

from easychart.

monbro avatar monbro commented on May 18, 2024

I think there is a trigger missing somehwere, when the data or the config is being updated from outside.

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

So you are reusing the same instance? just setting different config and data when the modal opens?

any chance for jsfiddle? that would facilitate allot

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

What part of your graph was incorrect? the data or the config?

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

because https://github.com/bestuurszaken/easychart/blob/master/src/js/services/data.js#L67 will trigger an update event that will trigger the config update->
https://github.com/bestuurszaken/easychart/blob/master/src/js/services/config.js#L202
But an set
https://github.com/bestuurszaken/easychart/blob/master/src/js/services/config.js#L48
will not trigger an update, so im guessing if i add and config update there it will be fixed

from easychart.

monbro avatar monbro commented on May 18, 2024

Yes this seems to be one part of the problem. When I do update the data after setting the config, the highcharts preview div chartContainer is correct. I suggest to add a update trigger to the config set method as well.

So this way the config and data should be updated and the event distributed within easycharts. But sometimes it seems it does still not pick the change up.


The other part of the problem is, that handsontable (which I heavily assume) is not refreshing the view of the table as it is not visible in the browser when the data is updated --> as I am using a modal window (via twitter bootstap js). When I am switching between the tabs, and then back to the 'data' tab, handsontables is showing the correct data / table (which I updated earlier in easychart.


Overall I solved both problems by adding a function "triggerUdpate" to the API which will trigger the dataUpdate event to the mediator:

that.triggerUpdate = function () {
          var data = that.get();
          mediator.trigger('dataUpdate', data);
};

And then I add an event to my modal, that as soon as its showed it will trigger the update:

$('#easyChartModal').on('shown.bs.modal', function (e) {
      easychartInstance.triggerUpdate();
    });

Which will update the highcharts preview div and the datatables correctly.

from easychart.

monbro avatar monbro commented on May 18, 2024

Its up to you if you want to close this task or to keep it open for further process on this.

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

I rather fix the core issue of this.

from easychart.

frankbaele avatar frankbaele commented on May 18, 2024

the config update fix fixed the essential part and the issue with handsontable seem to be not related to the project. Because we are doing the proper data update in code.

from easychart.

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.