Nevron Forum

PredefinedChartStyle Horizontal and DataZoomTool problem

https://www.nevron.com/Forum/Topic4243.aspx

By Ricardo Sousa 1 - Monday, September 27, 2010

Hello,

I'm trying to rotate a chart (HorizontalLeft or HorizontalRight) and use DataZoomTool, but it doesn't work.

The only way it makes zoom is if I set one of the ValueSnapper property (Vertical or Horizontal) in the NRangeSelection.

But I want to zoom both.

Any ideas?

To replicate, just use the Nevron.Examples.ChartGallery.Bar.HorizontalBar and add the zoom tool lines:

(chart as NCartesianChart).RangeSelections.Add(new NRangeSelection());
nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NAxisScrollTool());
nChartControl1.Controller.Tools.Add(new NDataZoomTool());


Thanks,
Ricardo
By Nevron Support - Tuesday, September 28, 2010

Hi Ricardo,

The range selection will by default zoom in when the distance from the begin point and the end point produces a positive offset on the x axis and negative offset on the y axis - that is when the range selection starts from [left, top] and goes [bottom, right] on a standard, non rotated cartesian chart.

This is why in the case of the rotated bar the zoom will be when you drag from the [right, top] to the [bottom, left] (in order to produce a negative) value on the y axis. Currently you can workaround this by using the AlwaysZoomIn property of the data zoom tool:

NDataZoomTool dzt = new NDataZoomTool();
dzt.AlwaysZoomIn = true;
nChartControl1.Controller.Tools.Add(dzt);

We've also added two properties to the range selection that allow you to modify the direction of the zoom.

NRangeSelection rangeSelection = new NRangeSelection();
rangeSelection.HorizontalAscendingZoom = true;
rangeSelection.VerticalAscendingZoom = true;

these two properties will be available in the next SP (probably at the end of this week).

By Ricardo Sousa 1 - Tuesday, September 28, 2010

Thanks