if series.data_type(X) is not Number:
raise ValueError('Bars only support Number values for the Y axis.')
if series.data_type(Y) is not Text:
raise ValueError('Bars only support Text values for the X axis.')
If the Bars are rows of horizontal bars, then the checks are correct, but the error message saying Y should be X, and vice versa.