change the function flot update

the origin way is using a recursion, it's fine when there is only one data, when multiple data come in, recursion can cause performance problem.