frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

y axis numbers break #382

Open alpap opened 2 years ago

alpap commented 2 years ago

Expected Behaviour

the y axis numbers are shown in order

Actual Behaviour

some of the y axis numbers are wrong

Steps to Reproduce:

{
    "data": {
        "labels": [
            "2022-02-11",
            "2022-02-15",
            "2022-02-16",
            "2022-02-16",
            "2022-02-16",
            "2022-02-16",
            "2022-02-16",
            "2022-02-17",
            "2022-02-17",
            "2022-02-17",
            "2022-02-18",
            "2022-02-18",
            "2022-02-18",
            "2022-02-19",
            "2022-02-21",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-22",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-23",
            "2022-02-24",
            "2022-02-25",
            "2022-02-25",
            "2022-02-25",
            "2022-02-26",
            "2022-02-28",
            "2022-02-28",
            "2022-02-28",
            "2022-02-28",
            "2022-02-28",
            "2022-03-01",
            "2022-03-01",
            "2022-03-03",
            "2022-03-03",
            "2022-03-04",
            "2022-03-07",
            "2022-03-08",
            "2022-03-08",
            "2022-03-08",
            "2022-03-09",
            "2022-03-09",
            "2022-03-10",
            "2022-03-10",
            "2022-03-11",
            "2022-03-11",
            "2022-03-14",
            "2022-03-15",
            "2022-03-15",
            "2022-03-15",
            "2022-03-15",
            "2022-03-16",
            "2022-03-16",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-17",
            "2022-03-18",
            "2022-03-18",
            "2022-03-21",
            "2022-03-21",
            "2022-03-21",
            "2022-03-21",
            "2022-03-22"
        ],
        "datasets": [
            {
                "name": "hours",
                "values": [
                    0.33,
                    0.35,
                    0.28,
                    0.29,
                    0.32,
                    0.33,
                    0.36,
                    0.36,
                    0.38,
                    0.4,
                    0.37,
                    0.41,
                    0.5,
                    0.31,
                    0.32,
                    0.28,
                    0.33,
                    0.34,
                    0.35,
                    0.37,
                    0.38,
                    0.48,
                    0.55,
                    0.57,
                    0.29,
                    0.34,
                    0.47,
                    0.51,
                    0.51,
                    0.52,
                    0.57,
                    0.58,
                    0.38,
                    0.38,
                    0.52,
                    0.54,
                    0.44,
                    0.34,
                    0.36,
                    0.37,
                    0.4,
                    0.48,
                    0.39,
                    0.41,
                    0.44,
                    0.48,
                    0.38,
                    0.46,
                    0.35,
                    0.41,
                    0.47,
                    0.35,
                    0.43,
                    0.38,
                    0.39,
                    0.39,
                    0.47,
                    0.42,
                    0.38,
                    0.39,
                    0.39,
                    0.47,
                    0.44,
                    0.45,
                    0.22,
                    0.35,
                    0.35,
                    0.44,
                    0.45,
                    0.46,
                    0.47,
                    0.5,
                    0.39,
                    0.45,
                    0.38,
                    0.39,
                    0.53,
                    0.56,
                    0.54
                ]
            }
        ],
        "yMarkers": [
            {
                "label": "Target",
                "value": 0,
                "options": {
                    "labelPos": "left"
                },
                "color": "#ff0000"
            }
        ]
    }
}

NOTE: Add a GIF/Screenshot if required.

Screenshot 2022-05-11 at 16 19 15 Screenshot 2022-05-11 at 16 24 14

Frappé Charts version: 1.62 Codepen / Codesandbox:

rokasga commented 2 years ago

I'm almost sure it is in order. If you select and check that ....00001 number in dev tools, you'll see it's actually 0.600000001. I'm having the same problem and not sure how/why that fraction adds up :(

scmmishra commented 2 years ago

Try using the 2.0.0-rc20. See if that fixes it. I'll port any fixes to the latest v1 branch