Show Axes Even with NO data

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Chris
Newbie
Newbie
Posts: 2
Joined: Tue Apr 27, 2010 12:00 am
Location: Melbourne, FL
Contact:

Show Axes Even with NO data

Post by Chris » Fri Oct 22, 2010 1:46 pm

How do I show the axes, instead of an ugly blank chart, even before the series have been added to the chart?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Show Axes Even with NO data

Post by Sandra » Fri Oct 22, 2010 2:52 pm

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chris
Newbie
Newbie
Posts: 2
Joined: Tue Apr 27, 2010 12:00 am
Location: Melbourne, FL
Contact:

Re: Show Axes Even with NO data

Post by Chris » Fri Oct 22, 2010 4:02 pm

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.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Show Axes Even with NO data

Post by Sandra » Mon Oct 25, 2010 8:05 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply