fix ajax call in chart