Profile Picture

How do I set up zooming a cartesian chart with a vertical x-axis?

Posted By Kevin Harrison 7 Years Ago

How do I set up zooming a cartesian chart with a vertical x-axis?

Author
Message
Kevin Harrison
Question Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
How do I set up the RangeSelection to do this please?

For a standard horizontal x-axis, I use:

NRangeSelection rangeSelection = new NRangeSelection
{
HorizontalAscendingZoom = true,
ZoomOutResetsAxis = true,
HorizontalAxisId = (int) StandardAxis.PrimaryX,
VerticalAxisId = (int) StandardAxis.PrimaryY
};
chart.RangeSelections.Add(rangeSelection);

If I set
chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft);

What do I change the rangeSelection to? I've tried various permutations, but none of them allow me to zoom. I get a red rectangle dragging the selection area in all directions.

Thanks

Kevin

Nevron Support
Posted 7 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 13 hours ago
Posts: 3,054, Visits: 4,009
Hi Kevin,

Apologies for the delayed response. You need to touch the HorizontalAscendingZoom and VerticalAscendingZoom properties of the range selection to make this work. For example:

NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

NRangeSelection rangeSelection = new NRangeSelection();

rangeSelection.HorizontalAscendingZoom = true;
rangeSelection.VerticalAscendingZoom = true;

chart.RangeSelections.Add(rangeSelection);

NBarSeries bar = new NBarSeries();

bar.Values.Add(10);
bar.Values.Add(20);
bar.Values.Add(30);

chart.Series.Add(bar);

chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft);

nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
nChartControl1.Controller.Tools.Add(new NDataZoomTool());


Hope this helps – let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team



Kevin Harrison
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Thanks, that works as expected.

What is the correct combination for PredefinedChartStyle.HorizontalRight please?
No combination of the two properties seems to work.

Thanks
Kevin


Kevin Harrison
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
Please ignore my previous message. I've worked it out!



Similar Topics


Reading This Topic