Jump to content
Software FX Community

AllowDrag constrained to changes of Y-values


User (Legacy)

Recommended Posts

Hello,

If I create a Line chart without specifying X-coordinates, AllowDrag is

constrained to changes of Y-values, and this is reflected by the SizeNS

cursor; however if X-coordinates are specified, AllowDrag is unconstrained,

and the cursor is SizeAll. Ideally, I would like to allow users to change

Y-values while keeping X-values fixed, even though the chart may have

unevenly distributed X-values. Is there some means of achieving this?

Turning AllowDrag off and overriding the control's behaviour using mouse

events and coordinate transformations seems a wee bit hairy.

Many thanks (and my apologies if there's an AllowDrag.YOnly property I

missed!)

Link to comment
Share on other sites

The way to achieve what you want is by processing the DataChangedByUser 

event as follows:

private void chart1_DataChangedByUser (object sender,PointLabelEventArgs e)

{

if (e.Axis == chart1.AxisX)

e.Handled = true; // Prevent change of X-Axis values

}

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...