Page 1 of 1

custom axis title not disappearing?

Posted: Tue May 26, 2009 3:24 pm
by 14045263
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.

Posted: Wed May 27, 2009 12:01 pm
by narcis
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;
			}
		}