Pie charts are most effective when the number of categories is limited, typically fewer than six. They are particularly useful when the goal is to show the proportion of each category in relation to the whole. For example, a pie chart can effectively illustrate the proportion of different types of infectious diseases in a given population.