Skip to content

Replace flash based charts with jqPlot / Chart.js / Chartist #342

Closed

Description

@daN4cat

Soon or later Flash will not be any longer supported by web browsers, following java support destiny.

We should replace chart flash based with https://github.com/jqPlot/jqPlot/ jQuery plugin which seems rich in chart options and flavours.

Flash issue was also discussed in #50

Activity

  1. added this to the 2.4 milestone on Feb 21, 2016
  2. changed the title [-]Replace flash based charts with jqPlot[/-] [+]Replace flash based charts with jqPlot / Chart.js[/+] on Mar 7, 2016
  3. daN4cat commented on Mar 7, 2016

    @daN4cat
    CollaboratorAuthor

    Thanks, I'll look into that yes. If my memory is not mistaken AdminLte uses it, so better not to add more distance for the ones that want AdminLTE in ospos.

  4. modified the milestones: , 2.4 on Mar 8, 2016
  5. self-assigned this
    on Mar 16, 2016
  6. modified the milestones: , on Mar 16, 2016
  7. daN4cat commented on Apr 12, 2016

    @daN4cat
    CollaboratorAuthor

    @jekkos I gave a quick try to Chart.js, first I sorted out all the js importing with bower and grunt that were not working that fine. Not sure why Chart.js bower support is not right but never mind it's sorted.

    I changed one report as test but I face an issue with Chart.js. It looks like requiring HTML5 and canvas and this line $("#report_chart").get(0).getContext("2d"); fails because it cannot find any getContext of undefined:

    Uncaught TypeError: Cannot read property 'getContext' of undefined

    Here the canvas declaration: <canvas id="report_chart" width="600" height="800"></canvas>.

    I'm not familiar with HTML5 declaration and etc., so I would need to read about. But maybe you can give me some quick hint here to understand the magnitude of the issue or if there is something obvious I missed or can fix.

  8. daN4cat commented on Apr 12, 2016

    @daN4cat
    CollaboratorAuthor

    OK, I believe I need to check something else first: chartjs/Chart.js#1505

    Bower pulled Chart.js 2.0.0-beta and probably the documentation online is for 1.0.0.... mhhh let me check that first!

  9. jekkos commented on Apr 12, 2016

    @jekkos
    Member

    ok might be easy to inspect the jquery object in a javascript console. There you will see what properties the object has and what could be wrong and needs a fixing.

  10. daN4cat commented on Apr 12, 2016

    @daN4cat
    CollaboratorAuthor

    Just checked this example: https://github.com/nnnick/Chart.js/blob/v2.0-dev/samples/line.html
    I should use that as guideline.

    I even noticed that Chart.js requires jQuery 2.x. I don't know if we can upgrade to 2 with no issue?

  11. daN4cat commented on Apr 12, 2016

    @daN4cat
    CollaboratorAuthor

    I might give a try to jqPlot, it seems more in line with what we have already.

  12. 27 remaining items

  13. jekkos commented on May 24, 2016

    @jekkos
    Member

    Yes I think so, was looking how it worked before and reverted to cfacf52 to see what went wrong

    screenshot from 2016-05-24 17 35 40

    but output looks the same as in current HEAD. Think it's better to do it server side anyway. So what tasks are there left now?

  14. jekkos commented on May 24, 2016

    @jekkos
    Member

    Otherwise I'll just start another story and leave this for you to finish?

  15. daN4cat commented on May 24, 2016

    @daN4cat
    CollaboratorAuthor

    Yes, I'll finish and fix it adding the tooltip to pie chart too.

  16. daN4cat commented on May 25, 2016

    @daN4cat
    CollaboratorAuthor

    With this commit I've added tooltip support to charts and solved the % issue as anyway was better to be implemented as part of the tooltip.

    Please check the sales chart and let me know if you like the tooltip when you hover over the circle of the value.

    Also I've sorted the currency representation reflecting the correct side according to the local configuration.

  17. daN4cat commented on May 25, 2016

    @daN4cat
    CollaboratorAuthor

    Just few more adjustments around the currency point.

    I believe this is completed and can be closed.

  18. odiea commented on May 25, 2016

    @odiea
    Collaborator

    Yes the tooltips really pop out.

  19. daN4cat commented on May 26, 2016

    @daN4cat
    CollaboratorAuthor

    OK, there is still something to do on the responsiveness side.
    So not completely closed yet.

  20. daN4cat commented on May 26, 2016

    @daN4cat
    CollaboratorAuthor

    OK, responsiveness sorted and Summary section placement with different screen sizes.

    I believe this is now done. There will be more I suppose but that's an enhancement story not a replacement one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions