Change handling of empty data to prevent chart library errors.