There are a couple of options:
Embedded Image
Use a chart library to generate an image, then either attach it to your message or embed it inline using base64
Manual HTML + Styles
For simple bar charts with less data, construct them manually using divs and styling. You can also create pie charts using a conic-gradient background style. Here's a sample of some creative styling: https://codepen.io/Theystan/pen/xxZVaXd
Extension App
If you require interactive charts, you will have to build an extension app with a message render override that iframes to a web app that produces the chart. This can get really complicated since you will need to host a web app and it will not work on mobile.