You can use chartist-render web component to turn a CSV file into a pie chart. Here’s how:
<chartist-render chart-title="Favorite Pie" chart-desc="A pie chart of favorite pies." data-source="https://webcomponents.psu.edu/styleguide/elements/chartist-render/demo/pie.csv" scale="ct-square" type="pie" style="max-width:300px;">
</chartist-render>
To see how your CSV should be set up, download this example file.
Learn more about how to customize it at https://webcomponents.psu.edu.