This is going to depend on which graphing add-on for Nagios you are using to process the perfdata and generate the graphs.
For example, if you are using pnp4nagios, you can do stacked graphs. You need to create a custom template in your pnp4nagios/share/templates dir called xxx.php where xxx is the name of the checkcommand. This is a php script containing all the RRD commands to generate the graph; this can be rather complex so you need to know PHP and read the RRDTool documentation.