 Hello, in this video we're going to create a pie chart of the land cover in a subcatchment. Because we want the pie chart to have the same colors as the legend of our layer, we need to install a plugin that will save the colors to the attribute table. Plugin is called ColorToAttribute. After installation you'll find a new icon in the toolbar. Click on the icon and make sure you choose the Corrine Catch Intersected Core layer that we created before and we use the Create New Attribute option there and we will call the new attribute hex because it will store the hexadecimal color codes that it finds in the legend that we already created. Let's check the result, go to the attribute table and there we find the color codes added in the hex field. For making great charts we use the Data Plotly plugin, you can install it from the Plugins Manager and before we start configuring our pie chart, I'm going to dock the attribute table, you can do that with this icon and then I see the attribute table below on the screen and this is useful for later when I need to use those hexadecimal codes for each land cover so I can easily read them from the screen while we are working in the Data Plotly panel. I sort it by the end value to have all the classes and corresponding colors here on the screen. Click the Data Plotly icon and choose the pie chart. Make sure that you use the Corrine Catch Intersected Core layer. We're going to create a feature subset by using the data defined overwrite and first we will create a pie chart for dn equals 0 so that's the subcatchment which has dn value 0 and for the grouping field of the pie chart I use land cover and for the y field I use percentage and then when I create plot you will see that it will use random colors here that have nothing to do with our own legend colors that we defined before. If you want to use the legend colors you need to again go to the data defined overwrites and click edit to build an expression. We need to create the expected format that is printed in the dialog and therefore we need to use the map get function combined with the map function and this will map our land cover classes to the corresponding colors and format it in such a way that we can create that legend. So now we need to add a land cover field. If you click all unique you can find all the unique classes in the land cover field and let's start with the first one agricultural areas and let's look up the hex value that belongs to it we can read it from our attribute table and we double click so there are basically two strings added here in the map function the land cover class and the corresponding hexadecimal color code. We do the same for all other classes we'll end with a bracket and the map get function still needs the land cover field added there so don't forget that and then a bracket and now we can change the legend use a horizontal legend and give it a nice title and then we can create the plot and here you see the plot in the correct colors and you can use this button to export the plot to an image a PNG file for example. So in this video you've learned how to create a pie chart of the land cover in a subcatchment with the corresponding colors of the legend.