This question is locked. New answers and comments are not allowed.
I am looking for a way to run some code when a vertical axis (which does not have an explicitly specified min and max value) adjusts itself due to new data points in a series.
Specifically, I have a chart with a single series, and that series is bound to at ObservableCollection (although it looks like the ItemsSource of the chart is actually IEnumerable, so I question how accurately it will reflect changes to the collection as they happed, but that's perhaps an independent issue). I also have a linear gradient background brush set on the plot area which indicates out-of-range values on the high and\or low end of the range. When the actual display range of the vertical axis changes based on the data points in the series, I need to adjust the gradient stops in this brush so that they accurately indicate the new range.
I don't see an event on the vertical axis indicating "range changed". I could adjust the values in the brush whenever I know the underlying collection changed in the assumption that it changed the range of the axis, but I don't know when (or if) the axis changes based on the new values (so I could end up operating on the old values if I do things at the wrong time).
Anybody have any ideas?
-Chris
Specifically, I have a chart with a single series, and that series is bound to at ObservableCollection (although it looks like the ItemsSource of the chart is actually IEnumerable, so I question how accurately it will reflect changes to the collection as they happed, but that's perhaps an independent issue). I also have a linear gradient background brush set on the plot area which indicates out-of-range values on the high and\or low end of the range. When the actual display range of the vertical axis changes based on the data points in the series, I need to adjust the gradient stops in this brush so that they accurately indicate the new range.
I don't see an event on the vertical axis indicating "range changed". I could adjust the values in the brush whenever I know the underlying collection changed in the assumption that it changed the range of the axis, but I don't know when (or if) the axis changes based on the new values (so I could end up operating on the old values if I do things at the wrong time).
Anybody have any ideas?
-Chris