If you already have a .jtl result file you can do it like:
jmeter -g /path/to/jtl/file -o /where/you/want/to/store/dashboard
If you would like the dashboard to be generated after the test run, you can run JMeter in command-line non-GUI mode like:
jmeter -n -t /path/to/testplan -l /path/to/result.jtl -e -o /path/to/dashboard/folder
See Full list of command-line options for all possible JMeter command-line arguments listed and explained.
If above steps don't work - add the next lines to user.properties file (lives under "bin" folder of your JMeter installation)
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.timestamp_format=ms
jmeter.save.saveservice.timestamp_format=yyyy/MM/dd HH:mm:ss
JMeter restart will be required in order to pick the properties up.
For dashboard customisation and tuning refer Generating Report Dashboard user manual entry.