How to connect with own custom database

Hello All
First, thank you for the wonderful tool. It is really amazing and useful tool. I am using the on-premise version and have a question for which I couldn’t able to find relevant answers anywhere.
Question: Is it possible to connect Matomo with our own custom database and fetch information from that database and show data on the dashboard. I want to retrieve information from my own custom MySQL database and want to show data in a graph and also want to generate reports from that data in Matomo. Please help me to implement this functionality. I am not sure how to implement this in Matomo’s on-premise version. Looking forward to your prompt response. Thank you. Regards Gundeep