MySQL stored procedure calculates K-line mean and Java drawing curve