Error: <path> attribute d: Expected number, " M397,NaN L397,0 A0,0,…"

223 views Asked by At

i have this error when I try to put a value in the field radius and innerRadius value (in a Solid Gauge, amchart)

Error: attribute d: Expected number, " M397,NaN L397,0 A0,0,…".

I tried to find some topic with the error in common this but i didin't found anything.

The two functions that i use for found the value are:

"radius": ( 5 + ( Math.floor( index / 2 ) * ( 100 / length ) ) ) + "%",
"innerRadius": ( ( Math.floor( index / 2 ) + 1 ) * ( 100 / length ) ) + "%"

The problem is using this function

"radius": (105 - ( Math.floor ( index / 2 ) * length ) ) + "%",
"innerRadius": ( 100 - ( Math.floor ( index / 2 ) * length ) ) + "%"

The error is not shown.

1

There are 1 answers

0
khalD On

I found the error. The error is when i set radius and innerRadius value with the "%". I tried to use toFixed method too, it works without errors

"innerRadius":  ( ( Math.floor( index / 2 ) + 1 ) * ( 100 / length ) ).toFixed(2) + "%" ,               

but when i add ' + "%" ' give me the error path. But before it works perfectly, or with others formula. Also i tried to use toString() methods too but it didn't work.