Chebyshev approximation with respect to a weight function