angular-charts icon indicating copy to clipboard operation
angular-charts copied to clipboard

Error: Invalid value for <text> attribute transform="translate(NaN,NaN)"

Open fizerkhan opened this issue 10 years ago • 4 comments

I tried to draw pie chart with following data

[
    {
        "x": "Chrome",
        "y": [
            0
        ],
        "tooltip": "Chrome"
    },
    {
        "x": "Firefox",
        "y": [
            0
        ],
        "tooltip": "Firefox"
    },
    {
        "x": "Safari",
        "y": [
            0
        ],
        "tooltip": "Safari"
    },
    {
        "x": "IE",
        "y": [
            0
        ],
        "tooltip": "IE"
    },
    {
        "x": "Opera",
        "y": [
            0
        ],
        "tooltip": "Opera"
    },
    {
        "x": "Others",
        "y": [
            0
        ],
        "tooltip": "Others"
    }
]

Since all the values are 0, it throws error: Invalid value for attribute transform="translate(NaN,NaN)"

fizerkhan avatar Sep 23 '14 15:09 fizerkhan

With this error you have labels on correct?

chaosfinity avatar Sep 23 '14 15:09 chaosfinity

Yes, i labelled them correct. If i change any one of the value other than zero(0), it works fine. No error in the console. it only happens if everything is 0 value.

fizerkhan avatar Sep 23 '14 17:09 fizerkhan

Since the arcs have not startAngle and endAngle it cannot calculate a point to place the labels. This error should be suppressed in the next release

chaosfinity avatar Sep 24 '14 16:09 chaosfinity

@chaosfinity Thanks for the fix.

fizerkhan avatar Sep 24 '14 17:09 fizerkhan