Drawing labels and ticks on the axis in case of series lack

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Petr
Newbie
Newbie
Posts: 39
Joined: Wed Jul 24, 2013 12:00 am

Drawing labels and ticks on the axis in case of series lack

Post by Petr » Wed Feb 26, 2014 9:13 am

Hello, is it possible to show ticks and labels on the axis when seriries associated with the axis are invisible, or are absent. Generaly, i want one custom axis for one line, and i want to have ability to hide this line, without hiding axis, but when i do it, all the labels and dick disappearars. what should i do to fix this disappearing?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Drawing labels and ticks on the axis in case of series lack

Post by Christopher » Wed Feb 26, 2014 2:39 pm

Petr wrote:Hello, is it possible to show ticks and labels on the axis when seriries associated with the axis are invisible, or are absent. Generaly, i want one custom axis for one line, and i want to have ability to hide this line, without hiding axis, but when i do it, all the labels and dick disappearars. what should i do to fix this disappearing?
You could use the Series.Transparency property, e.g.

Code: Select all

    private void InitializeChart()
    {
      tChart1.Series.Add(typeof(Bar)).FillSampleValues();    
    }

    private void button1_Click(object sender, EventArgs e)
    {
      //tChart1[0].Visible = !tChart1[0].Visible;
      tChart1[0].Transparency = tChart1[0].Transparency == 0 ? 100 : 0;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Petr
Newbie
Newbie
Posts: 39
Joined: Wed Jul 24, 2013 12:00 am

Re: Drawing labels and ticks on the axis in case of series lack

Post by Petr » Thu Feb 27, 2014 7:07 am

Hi Christopher, unfrtunately that doesn't helps. let me try to explain you on example.In attachement there are two pics, on the "active axis.png" you can see the situation than all axes are active( active means that line is visible ). In this case axis has the same color as line and have labels and marks on it ( so, it's scaled ). On the second pic, called "inactive axis.png" you can see the situation i want to modify, the first plot is invisible now( you can see it's uncheked ), so the first axis is inactive, that means that should become gray with saving all the marks and labels on it. As you can see it's gray, but, there are no labels and ticks on it. So what should i do to set it back?
Attachments
inactive axis..png
inactive axis..png (141.78 KiB) Viewed 7815 times
active axis..png
active axis..png (102.55 KiB) Viewed 7817 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Drawing labels and ticks on the axis in case of series lack

Post by Christopher » Thu Feb 27, 2014 8:56 am

Petr wrote:Hi Christopher, unfrtunately that doesn't helps. let me try to explain you on example.In attachement there are two pics, on the "active axis.png" you can see the situation than all axes are active( active means that line is visible ). In this case axis has the same color as line and have labels and marks on it ( so, it's scaled ). On the second pic, called "inactive axis.png" you can see the situation i want to modify, the first plot is invisible now( you can see it's uncheked ), so the first axis is inactive, that means that should become gray with saving all the marks and labels on it. As you can see it's gray, but, there are no labels and ticks on it. So what should i do to set it back?
I think I understand your situation. What I don't understand is why you cannot set the Series.Transparency property to 100 instead of setting the Series.Active/Visible property to false when you uncheck the checkbox. The issue is here that axis labels and ticks will only be drawn if a series is associated to the axis, and setting the Series.Active/Visible property to false disassociates the series from the axis. The only way, therefore, to have the series invisible but the axis labels and ticks visible is to keep the series associated to the axis, that is, keep the Series.Active/Visible property set to true, but to set the Series.Transparency to 100.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Petr
Newbie
Newbie
Posts: 39
Joined: Wed Jul 24, 2013 12:00 am

Re: Drawing labels and ticks on the axis in case of series lack

Post by Petr » Thu Feb 27, 2014 10:43 am

Thanks a lot, setting transparency to series solved this problem.

Post Reply