Hi,
Firstly, try another lead. If this doesn’t work, then you have a faulty dock connector or a bad battery. I use an iPad 6th gen, and they only came out on March 27th 2018, so you are lucky enough to still be in your 2 year warranty if you bought it from Apple or an authorised reseller. Contact them about this issue, as this is a hardware issue that they should fix free of charge.
Hope this helps :)