Enable the graphite carbon cache writer: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#graphite-carbon-cache-writer
All perfdata metrics will be automatically included as graphs however if you just want a subset, the host or service then needs to have custom vars of the form vars.graphite_keys =["key1","key2"] where key1 key2 represent perfdata stats you want to see.
You can configure the graphite metric keys formats by using standard-ish icinga2 macros.
Just extract this to your Icinga Web 2 module folder in a folder called graphite.
(Configuration -> Modules -> graphite -> enable). Check the modules config tab right there.
NB: It is best practice to install 3rd party modules into a distinct module folder like /usr/share/icingaweb2/modules. In case you don't know where this might be please check the module path in your Icinga Web 2 configuration.
This module borrows a lot from https://github.com/Icinga/icingaweb2-module-pnp4nagios