views:

22

answers:

1

Using System.Web.UI.DataVisualization.Charting, I've got data I want to represent as a Bar chart with the first item at the series displaying at the top of the chart, rather than the bottom. E.g. for a series with labels {"A", "B", "C"}, the bar for C will display at the top, while I would want A to be the top bar. This ordering makes sense for numerical data, but in some cases less sense for categorical data. Is there any property or something I can set, or do I need to reverse the order of the data?

A: 

You might try something like this after you've bound the data (but before the chart is rendered):

Chart1.Series["Series1"].Sort(PointSortOrder.Ascending, "X");

This will sort Series1 by its X-axis value.

Scott Mitchell has a post about Sorting and Filtering data in the Chart control here.

Peter