IChartData.Categories property

Gets the primary categories (or both primary and secondary categories if UseSecondaryCategories property is false). Read-only IChartCategoryCollection.

public IChartCategoryCollection Categories { get; }


If UseSecondaryCategories property is false then SecondaryCategories property return null and data in this Categories property is used both for primary and secondary series. If UseSecondaryCategories property is true then data in SecondaryCategories property is used for secondary series and data in this Categories property is used for primary series.


Example. What categories are related to series - ChartData.Categories or ChartData.SecondaryCategories?

if (series.PlotOnSecondAxis && series.Chart.ChartData.UseSecondaryCategories)
    // related categories are series.Chart.ChartData.SecondaryCategories
    // related categories are series.Chart.ChartData.Categories

See Also