none
What 's effect about CollapsibleSpaceThreshold RRS feed

  • Question

  • Dear all
    about article
     is described in the following article
    This property is measured as a percentage of the Y-axis scale.By default, its value is set to 25.This means that data points in a series that have a difference of at least 25% of the scale will be collapsed with a scale break.

    i try in c# building ,but don't know What effect  about 25% , 40%

    code:
    chart1.ChartAreas["Default"].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25;

    Thursday, October 20, 2016 5:45 AM

All replies

  • Hi

    AxisScaleBreakStyle.CollapsibleSpaceThreshold Property represents the threshold of space on the chart at which scale breaks are drawn.

    Here is the sample from MSDN, we can have a test.

    private void AddChartData()
    {
       chart1.Series["Series1"].Points.Add(new DataPoint(1, 2));
       chart1.Series["Series1"].Points.Add(new DataPoint(2, 4));
       chart1.Series["Series1"].Points.Add(new DataPoint(3, 400000));
       chart1.Series["Series1"].Points.Add(new DataPoint(4, 3));
    }
    
    private void AddScaleBreaks()
    {
       // Enable scale breaks.
       chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = true;
    
       // Show scale break if more than 25% of the chart is empty space.
       chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25;
    
       // Set the line width of the scale break.
       chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineWidth = 2;
    
       // Set the color of the scale break.
       chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineColor = Color.Red;
    
       // If all data points are significantly far from zero, the chart will calculate the scale minimum value.
       chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.StartFromZero = StartFromZero.Auto;
    
       // Set the spacing gap between the lines of the scale break (as a percentage of the Y-axis).
        chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Spacing = 2;
    }


    Here is my test screen capture, It shows scale break more than 25% of the chart is empty space

    You must have sufficient separation between ranges of data points in a single series to draw a scale break. By default, a scale break can be added only if there is a separation between the data ranges of at least 25% of the chart. If you enable a scale break but it does not appear, even though there is sufficient distance between the data ranges, you can set the CollapsibleSpaceThreshold property to a value less than 25.

    For example , I changed code as below

     
                chart1.Series[0].Points.Add(new DataPoint(1, 2));
                chart1.Series[0].Points.Add(new DataPoint(2, 4));
                chart1.Series[0].Points.Add(new DataPoint(3, 4));
                chart1.Series[0].Points.Add(new DataPoint(4, 3));

    And  set CollapsibleSpaceThreshold property to a value less than 25. I set it 15 instead.

    Here is my test screen capture.  


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Kristin Xie Thursday, October 20, 2016 9:10 AM
    • Proposed as answer by Kristin Xie Monday, October 24, 2016 8:26 AM
    Thursday, October 20, 2016 9:04 AM
  • Thanks 

    how did you know about scale break is 2.97 , 3.97?

    Monday, October 24, 2016 7:07 AM
  • Thanks 

    how did you know about scale break is 2.97 , 3.97?

    @最愛是晴天

    Per my understanding, it is decided by chartControl, Each time that chart control will select a number close to the highest point.

    Best regards,

    Kristin


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 24, 2016 7:31 AM