none
How to cancel chart selection by code? RRS feed

  • Question

  • Dear All,

    I'm making an application which includes a chart that can be selected by cursor, cursorX.IsUserSelectEnable=1, we can recover the selection by click the small button beside scroll bar during app's running, but how can we cancel the selection by code which has the same function as the small button?

    Thanks!

    Wednesday, December 19, 2018 12:42 PM

Answers

  • Do you mean for zooming?

    If not zoom then exactly what kind of selection? Show the code to select.

    Here are some cancel things you might try:


       Chart1.ChartAreas(0).AxisX.ScaleView.ZoomReset()

       Chart1.ChartAreas(0).CursorX.IsUserSelectionEnabled = False

       Chart1.ChartAreas(0).CursorX.SelectionEnd = 0    'not sure??

    You could also reset and redraw the chart if reqd.

    How do you want to cancel? Click a button? Mouse button click?

    • Marked as answer by goldenview Thursday, December 20, 2018 12:19 AM
    Wednesday, December 19, 2018 1:24 PM

All replies

  • Do you mean for zooming?

    If not zoom then exactly what kind of selection? Show the code to select.

    Here are some cancel things you might try:


       Chart1.ChartAreas(0).AxisX.ScaleView.ZoomReset()

       Chart1.ChartAreas(0).CursorX.IsUserSelectionEnabled = False

       Chart1.ChartAreas(0).CursorX.SelectionEnd = 0    'not sure??

    You could also reset and redraw the chart if reqd.

    How do you want to cancel? Click a button? Mouse button click?

    • Marked as answer by goldenview Thursday, December 20, 2018 12:19 AM
    Wednesday, December 19, 2018 1:24 PM
  • Do you mean for zooming?

    If not zoom then exactly what kind of selection? Show the code to select.

    Here are some cancel things you might try:


       Chart1.ChartAreas(0).AxisX.ScaleView.ZoomReset()

       Chart1.ChartAreas(0).CursorX.IsUserSelectionEnabled = False

       Chart1.ChartAreas(0).CursorX.SelectionEnd = 0    'not sure??

    You could also reset and redraw the chart if reqd.

    How do you want to cancel? Click a button? Mouse button click?

    The first one is what I need, thank you very much. I need to recover the axis zoom by other events.
    Thursday, December 20, 2018 12:21 AM