You can go through the tutorial https://www.roytuts.com/ajax-jquery-based-xchart-example-using-python-flask-mysql/