A warm welcome to HP Forums! This is a great place to get support, find answers and tips to your technical queries.
Battery's do get warm while they are being charged since current is flowing in the battery during charging. However, if the battery is getting hot, then its possible that the battery or the charger is defective. I would recommend calling HP Support for further assistance. I've send you a private message with instructions on how to contact your regional HP Support. Could you please check your inbox on the forums page for the private message.
Have a great day!