Hi. I'm working with the winforms chartview and exploring what it can do. I've noticed that If I scroll and zoom my chart with control/mouse-wheel and click/drag operations, the labels fly off the X axis and start scrolling with the chart... I've attached a pic and some code.
Ideas?
Ideas?
ChartPanZoomController panZoomController = new ChartPanZoomController();
panZoomController.PanZoomMode = ChartPanZoomMode.Both;
chart.Controllers.Add(panZoomController);
private void DrawChart(string ticker)
{
chart.Series.Clear();
chart.ShowPanZoom = true;
CandlestickSeries series = new CandlestickSeries();
List<
DailyOHLCV
> prices = hStocks[ticker];
foreach (DailyOHLCV dayPrice in prices)
series.DataPoints.Add(
new OhlcDataPoint(dayPrice.open, dayPrice.high, dayPrice.low, dayPrice.close, dayPrice.date));
DateTimeCategoricalAxis axis = new DateTimeCategoricalAxis();
axis.LabelFormat = "{0:dd-MMM-yy}";
axis.LabelRotationAngle = 90;
axis.LabelFitMode = AxisLabelFitMode.Rotate;
axis.MajorTickInterval = chart.Width / 10;
series.HorizontalAxis = axis;
chart.Series.Add(series);
}