Home Forums WinForms controls Xceed Chart for WinForms Show the axes without data and clear

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

    Hello,

    I have created a Chart and at the beginning I create the axes with the scale and some stripes.
    The problem is that if I do not add any data, the scale and the stripes are not shown, and I would like to show the scale from the axes and the stripes, even if there is not any data.
    This is also useful when I clear the data and I want to display just the axes.

    Is it possible?

    Thank you!

    Imported from legacy forums. Posted by Juan (had 2223 views)

    Xceed Support
    Member
    Post count: 5658

    You will need to set the AutoMax and AutoMin to “False” on each axis to show to empty scales.

    <code>
    m_Chart = m_ChartControl.Charts[ 0 ];

    m_Chart.Axis( StandardAxis.PrimaryX ).ScaleMode = AxisScaleMode.Numeric;
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMax = false;
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMin = false;
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.Min = 0;
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.Max = 10;

    m_Chart.Axis( StandardAxis.PrimaryY ).ScaleMode = AxisScaleMode.Numeric;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMax = false;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMin = false;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.Min = 0;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.Max = 10;
    </code>

    You can set them back to “True” when the first data has been added.

    <code>
    //…
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMax = true;
    m_Chart.Axis( StandardAxis.PrimaryX ).NumericScale.AutoMin = true;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMax = true;
    m_Chart.Axis( StandardAxis.PrimaryY ).NumericScale.AutoMin = true;
    </code>

    Imported from legacy forums. Posted by CharlesB (had 3205 views)

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