Home Forums WinForms controls Xceed Chart for WinForms Problem manual scaling graph

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #19136 |

    Given a chart with those settings

      m_Chart.Axis(StandardAxis.PrimaryY).NumericScale.AutoMax = false;
      m_Chart.Axis(StandardAxis.PrimaryY).NumericScale.AutoMin = false;

     

    For example. if the values along PrimaryY are between 0 and 500 and I set

    m_Chart.Axis(StandardAxis.PrimaryY).NumericScale.Min = 100
    m_Chart.Axis(StandardAxis.PrimaryY).NumericScale.Max = 200:

    It happens the graph goes outside the border of the chart.

    If I choose the same range (Y between 100 and 200) with the zoom function then the graph is inside the border of the chart.

     

    Is there a way to manual scale Min e Max of PrimaryY and at the same time not to see the graph outside of the chart border? Something
    like an automatic zooming

     

    Thanks

    Imported from legacy forums. Posted by Claudio (had 3813 views)

    User (Old forums)
    Member
    Post count: 23064

    Any answer?

    Imported from legacy forums. Posted by Claudio (had 468 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    could  

    m_Chart.MarginMode = MarginMode.Fit

    or

    m_Chart.MarginMode = MarginMode.Stretch;

    be what you’re looking for?

    You should probably have a closer look at the Xceed.Chart.Samples.Explorer, in particular the Fit Margin Mode and the Stretch Margin Mode examples.

    Imported from legacy forums. Posted by Ghislain (had 1608 views)

    User (Old forums)
    Member
    Post count: 23064

    Unfortunately the MarginMode is not what I am looking for.

    If I set the minimum and maximal value of Y (es 100 – 200) manually, it happens the values between 100 and 200 are visualized into the m_chart area.

    By contrast, the Y values < 100 or > 200 (if present) are visualized outside the m_chart and inside the m_chartControl.

    This is optically not very nice.

    So the main problem is: values < 100 and > 200 are still visible

     

    Imported from legacy forums. Posted by Claudio (had 1481 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi again,

    I am still not sure of what you want to do exactly.  You said that you would like to be able to select a the minimal and maximal values to be visualized.  You would like all other values to be invisible?  And you would like to have an “auto-zoom” feature to fill the display area?  This means that, with the zoom, the 100-200 preset could change radically.  Suppose that are your data are actually between 155 and 159 and you are using you “auto-zoom”, this would mean the Y axis would get auto-corrected to display Y:150-160 ?

    You must also consider that if the 155 (from the scenario above) is the first value in the series, and 158 is the last one, and every other values is out of your (Y:100-200) selected range, the data points would almost appear as a DBNull.Value even if these are not (they could anything below 100). 

    Could it make sense to copy all the values between 100 and 200 to a temporary DataSeries and to display these?  (I’m only suggesting since I don’t know what your data is about.)

    It would require a complex algorithm to obtain a “optimized viewport” from the data and a min-max scale, in my opinion, for the reasons mentioned above. 

    Imported from legacy forums. Posted by Ghislain (had 1289 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes, if I set manually the Y-range, I would like all the values outside that range to be invisible.

    Unfortunately for my case I cannot copy all the values within the range inside a temporary dataseries.

     What works great is if I select the Y-range with the mouse making a zoom.

     

    Is there a way to perform a zooming only using code? I mean without using the mouse.

     

    Imported from legacy forums. Posted by Claudio (had 2485 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.