Plugins and how to visualize the results in Kibana 5

I'm new to ELK and need some help.
Can you help me with how i creat a plugin that compares values of two fields (both selectable and from the same index) and shows if they're equal in a pei chart, e. g. 80% equal & 20% don't equal ?

you would probably start with cloning kibana repository:

git clone https://github.com/elastic/kibana.git

read the CONTRIBUTING.md, it contains useful info on how to set up your dev environment

check code of some existing visualizations like tagcloud in /src/core_plugins/tagcloud

let me warn you however, our API is not stable nor documented so it might be challenging to develop and to maintain your own plugin at this time.