Thanks to USers arvid, GenoMax & dpryan I managed to get
$ ./genomeCoverageBed -ibam test.bam -g human.hg19.genome -bg > testBamHisto.BedGraph
to produce a file for UCSC which has this kind of format.
chr22 16212591 16212595 5
chr22 16212595 16212598 6
chr22 16212598 16212599 15
chr22 16212599 16212600 20
chr22 16212600 16212602 23
What heading and setting do I need to use or is it a different command to get the proper Histogram view like this

Full details are here but its not working right.
Any suggestions for the final step?
$ ./genomeCoverageBed -ibam test.bam -g human.hg19.genome -bg > testBamHisto.BedGraph
to produce a file for UCSC which has this kind of format.
chr22 16212591 16212595 5
chr22 16212595 16212598 6
chr22 16212598 16212599 15
chr22 16212599 16212600 20
chr22 16212600 16212602 23
What heading and setting do I need to use or is it a different command to get the proper Histogram view like this

Full details are here but its not working right.
Any suggestions for the final step?
Comment