If the question is worth answering with more than a link, then users better spend time posting an actual answer with more than a link.
One-liners are not necessarily bad, but many times they are a sign that either the question was low-quality to begin with, or that a better answer was possible.
We shouldn't encourage posting more of these comments. We want quality answers, not users gaining rep for comments.
In some cases, very short answers are perfectly fine though. The question is not a dupe, is not a typo... and yet it can be fully answered with a very short answer. In those cases go ahead and post the answer (as long as the very short answer is not just a link, because we do not consider those to be answers around here).
In the example you posted, the comment you posted wouldn't qualify as "link-only" answer if posted as such:
A quick look in the documentation helps ;) : xlsxwriter.readthedocs.io/chart.html -> method chart.set_x_axis({'visible': False})
Wouldn't be a great answer, but would not be subject to deletion as "not an answer".
However, when answering a question is that easy, it's worth considering if the question couldn't have been posted already, and if it wouldn't be better to close it as a duplicate. In this example, I believe the question could be a duplicate of this one, or maybe this other one. So I don't think posting an answer is the best course of action, but flagging for closure would.