Skip to content Skip to sidebar Skip to footer

Refresh Morris Chart With Ajax

As the first I would like to apologise for my bad English. Though I understand the English language, but can express myself In writing, unfortunately, very badly. So I use a transl

Solution 1:

Redraw the char using redraw()

graph.setData(data);
graph.redraw();

Solution 2:

I have my script simplified a bit for testing. But unfortunately I do not know, to which I present this must set recharge. This script everything is loaded once at the beginning.

<!-- jQuery 2.2.3 --><scriptsrc="https://code.jquery.com/jquery-3.1.1.min.js"></script><linkrel="stylesheet"href="http://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"><scriptsrc="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script><scriptsrc="http://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script><buttonid="ReLoadData">Daten erneut laden</button><divid="IcecastGraph"></div><script>

            $("#IcecastGraph").html("");

            $.ajax({
            url: "TEST_01.php",
            type: "POST",
            dataType: "json",
            success: function (data) {

              ShowGrpah(data);

            },

            });

            functionShowGrpah(data) {

            newMorris.Line({
                element: 'IcecastGraph',
                data: data,
                xkey: '2',
                ykeys: ['1'],
                labels: ['Hörer']
                });

            }

            </script>

Solution 3:

Post a Comment for "Refresh Morris Chart With Ajax"