Page 1 of 1

Show Axes Even with NO data

Posted: Fri Oct 22, 2010 1:46 pm
by 15656019
How do I show the axes, instead of an ugly blank chart, even before the series have been added to the chart?

Re: Show Axes Even with NO data

Posted: Fri Oct 22, 2010 2:52 pm
by 10050769
Hello Chris,

I think you can use method of axes SetMinMax(), for initialize previously these. You can do something as next code:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Line series1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = true;
            series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            tChart1.Axes.Left.SetMinMax(0, 500);
            tChart1.Axes.Bottom.SetMinMax(0, 100);
        }
        private void button1_Click(object sender, EventArgs e)
        {
               series1.FillSampleValues();
        }
Please, check if previous code works as you want.

I hope will helps.

Thanks,

Re: Show Axes Even with NO data

Posted: Fri Oct 22, 2010 4:02 pm
by 15656019
Is there any way to do this without adding an empty series? I handle events and currently assume that all series that exist on my chart are valid. I'd have to develop code specifically to handle these (phantom series) that have to be added when the chart is first initialized.

Re: Show Axes Even with NO data

Posted: Mon Oct 25, 2010 8:05 am
by 10050769
Hello Chris,
Is there any way to do this without adding an empty series?
I fear that it is not possible, you need add series,because chart can calculate value its axes.
I handle events and currently assume that all series that exist on my chart are valid. I'd have to develop code specifically to handle these (phantom series) that have to be added when the chart is first initialized.
You don't need treat series are you using for calculate axes of chart as series phantom. I recommend you, use first series you add in chart for initialize axes, as a valid series, you only have added its values.

Thanks,