Hi
My application has a chart and I have enable scrolling on the X-axis which is date/time based. I also have to calendars that constrain the data displayed in the chart.
Is it possible to determine the start and end of data window displayed when the X axis is scrolled so that I can keep the calendars in sync?
Any help greatly appreciated.
Regards
James
Yes, but you'll have to extract those from FillSceneGraph event. Here's how you can do that:DateTime effectiveMin;DateTime effectiveMax;private void ultraChart1_FillSceneGraph(object sender, FillSceneGraphEventArgs e){ if (e.Grid.Count == 0) return; IAdvanceAxis xAxis = (IAdvanceAxis)e.Grid["X"]; effectiveMin = (DateTime)xAxis.WindowMinimum; effectiveMax = (DateTime)xAxis.WindowMaximum;}
Hi,
I'd like to do the same thing, but e.Grid.Count is always 0 for me. I am using a composite chart with several numerictime series and layers. The data is not bound, but added on the fly.
Any help is appreciated,
Dennis
I found it very easy by handling the Scrolling and Scaling event. I have one visible X Axis in the Area[0], when it changes all other X Axis should scroll and scale:
private void chart_Scaling(object sender, ChartScrollScaleEventArgs e){ if ((e.AxisNumber == AxisNumber.X_Axis)) { foreach (ChartLayerAppearance layer in chart.CompositeChart.ChartLayers) { if (layer.ChartArea != chart.CompositeChart.ChartAreas[0]) { layer.AxisX.ScrollScale.Scale = e.NewValue; } } }}private void chart_Scrolling(object sender, ChartScrollScaleEventArgs e){ if ((e.AxisNumber == AxisNumber.X_Axis)) { foreach (ChartLayerAppearance layer in chart.CompositeChart.ChartLayers) { if (layer.ChartArea != chart.CompositeChart.ChartAreas[0]) { layer.AxisX.ScrollScale.Scroll = e.NewValue; } } }}