From sqlite to json format

At the risk of taking this thread off say a tangent can I ask whether the database is one that has already existed for some purpose and you are now trying to draw charts from it, or whether the purpose of the database is in order to draw the charts? If the purpose is in order to see the charts then there may be alternative approaches that will give you a much better results.