custom axis title not disappearing?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
noaksey
Newbie
Newbie
Posts: 55
Joined: Wed May 23, 2007 12:00 am

custom axis title not disappearing?

Post by noaksey » Tue May 26, 2009 3:24 pm

Hey,

I've created a custom axis and 'attached' a series to it, but when I click on the legend to turn it off (via the checkbox), it doesn't seem to turn the axis title off?

Code: Select all

        public Form1()
        {
            InitializeComponent();
            tChart1.Aspect.View3D = false;
            tChart1.Legend.CheckBoxes = true;

            Steema.TeeChart.Axis custAxis = new Steema.TeeChart.Axis(false, false, tChart1.Chart)
            {
                RelativePosition = 100, //// so labels are on left hand side
                Title =
                {
                    Text = "chris",
                    Angle = 270
                },
                Automatic = true,
                Visible = true,
                Grid =
                {
                   Visible = false
                }
                ,
                MinimumOffset = 15,
                MaximumOffset = 15
            };

            tChart1.Axes.Custom.Add(custAxis);

            Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(tChart1.Chart)
            {
                CustomVertAxis = custAxis
            };
            line.FillSampleValues(1000);
        }
Regards,
Chris.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed May 27, 2009 12:01 pm

Hi Chris,

I could reproduce the issue here and added it to the defect list (TF02014192) to be fixed for next releases. In the meantime a workaround is using ClickLegend event as shown below.

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();
		}

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;
			tChart1.Legend.CheckBoxes = true;

			Steema.TeeChart.Axis custAxis = new Steema.TeeChart.Axis(false, false, tChart1.Chart)
			{
				RelativePosition = 100, //// so labels are on left hand side
				Title =
				{
					Text = "chris",
					Angle = 270
				},
				Automatic = true,
				Visible = true,
				Grid =
				{
					Visible = false
				}
					,
				MinimumOffset = 15,
				MaximumOffset = 15
			};

			tChart1.Axes.Custom.Add(custAxis);

			Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line(tChart1.Chart)
			{
				CustomVertAxis = custAxis
			};
			line.FillSampleValues(1000);

			//Workaround
			tChart1.ClickLegend += new MouseEventHandler(tChart1_ClickLegend);
		}

		void tChart1_ClickLegend(object sender, MouseEventArgs e)
		{
			int index = tChart1.Legend.Clicked(e.X, e.Y);

			if (index != -1)
			{
				tChart1[index].GetVertAxis.Title.Visible = tChart1[index].Active;
			}
		}
Best Regards,
Narcís Calvet / 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