Skip to content

mobile browser odd behaviour #713

Closed
@nits

Description

@nits

jsfiddle: http://jsfiddle.net/1sc6L8dk/5/

Open this jsfiddle in mobile browser (I am using safari,chrome).

    var ChartData = '', ChartOptions = '';

function updategraph() {
    ChartData = [{
        value: 400,
        color: "#000",
        title: "#1"
    }, {
        value: 375,
        color: "#555",
        title: "#2"
    }, {
        value: 323,
        color: "#222",
        title: "#3"
    }, {
        value: 375,
        color: "#000",
        title: "#4"
    }, {
        value: 323,
        color: "#000",
        title: "#5"
    }];
    ChartOptions = {

    };

    new Chart(document.getElementById("myChart").getContext("2d")).PolarArea(ChartData, ChartOptions);
}
window.onload = function () {
    polarChart = new Chart(document.getElementById("myChart").getContext("2d")).PolarArea(ChartData, ChartOptions);
};

$("span").click(function () {
    updategraph();
});

If you click on "click here to draw" you will see the graph generated which is perfectly fine on Mozilla, Chrome, Safari (all latest desktop browsers).

Now when I try doing the same in mobile browser(iPhone 5 Safari, Samsung S4 Chrome) this behaves really strange. If you click on graph for second time, this graph will appear double of its first size and then again the same. It just gets expanded where it should behave like how it behaves in desktop browser.

First I thought this might be the issue only with PolarArea, but same issue appears with Pie too. You can check the same just changing PolarArea to Pie.

Any ideas on this ? May be some small mistake in my code?

Thanks in advance.

http://stackoverflow.com/questions/26495262/generating-chartjs-graph-dynamically-odd-behavior-in-mobile-browsers

Posted this question here earlier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions