Page 1 of 1

Controlling Header/Axis visibility

Posted: Thu Mar 17, 2016 3:53 pm
by 15673386
Dear Steema team,
How to control the visibility e.g. of Header and axes?

E.g. I'm trying this:

Code: Select all

TChart.CurrentTheme = ThemeType.Flat;
TChart.Header.Visible = false;
TChart.Axes.Left.Visible = true;
TChart.Axes.Left.AxisPen.Visible = true;
TChart.Axes.Right.Visible = true;
TChart.Axes.Right.AxisPen.Visible = true;
But the header saying "TeeChart" is showing nevertheless. Also, only the bottom axis is visible.

Setting Axis.XXX.Visible to true worked in previous releases, but I'm experiencing these issues now in release 4.1.2015.12160 (WPF version).

Thanks!
Ansgar

Re: Controlling Header/Axis visibility

Posted: Fri Mar 18, 2016 11:34 am
by Christopher
Using the following code with TeeChart.WPF.dll v.4.1.2015.12160

Code: Select all

    private void InitializeCharts()
    {
    }

    private void button_Click(object sender, RoutedEventArgs e)
    {
      tChart1.CurrentTheme = ThemeType.Opera;
      tChart1.Header.Visible = false;
      tChart1.Axes.Left.Visible = true;
      tChart1.Axes.Left.AxisPen.Visible = true;
      tChart1.Axes.Right.Visible = true;
      tChart1.Axes.Right.AxisPen.Visible = true;
    }
I get the following two images:
wpf_1.PNG
wpf_1.PNG (7.36 KiB) Viewed 9135 times
and
wpf_2.PNG
wpf_2.PNG (7.59 KiB) Viewed 9133 times
do you get the same results?

Re: Controlling Header/Axis visibility

Posted: Thu Mar 31, 2016 4:09 pm
by 15673386
Christopher wrote:Using the following code with TeeChart.WPF.dll v.4.1.2015.12160

...........

do you get the same results?
Dear Christopher,
sorry for my delayed reply.

Using your example, I get the same results.
I can also make the bottom and top axes appear by setting .Visible and .AxisPen.Visible to true for those axes.
But if I now add a series (e.g. FastLine) to the chart, the right and top axes disappear again.

Code: Select all

void Button_OnClick(object sender, RoutedEventArgs e)
{
    tChart1.CurrentTheme = ThemeType.Opera;
    tChart1.Header.Visible = false;
    tChart1.Axes.Left.Visible = true;
    tChart1.Axes.Left.AxisPen.Visible = true;
    tChart1.Axes.Right.Visible = true;
    tChart1.Axes.Right.AxisPen.Visible = true;

    tChart1.Axes.Bottom.Visible = true;
    tChart1.Axes.Bottom.AxisPen.Visible = true;
    tChart1.Axes.Top.Visible = true;
    tChart1.Axes.Top.AxisPen.Visible = true;

    Line line = new Line(tChart1.Chart);
    line.Add(0.0, 0.0);
    line.Add(1.0, 5.0);
    line.Add(4.0, 2.0);
    line.Add(5.0, 0.0);
	// only left and bottom axis are now visible
}

Re: Controlling Header/Axis visibility

Posted: Fri Apr 01, 2016 8:43 am
by Christopher
AuerAhellwig wrote: But if I now add a series (e.g. FastLine) to the chart, the right and top axes disappear again.
To get those axes to display they need to be associated to a series, e.g.

Code: Select all

      line.HorizAxis = HorizontalAxis.Both;
      line.VertAxis = VerticalAxis.Both;

Re: Controlling Header/Axis visibility

Posted: Mon Apr 04, 2016 9:38 am
by 15673386
Dear Christopher,

thanks, I think I got it working now.

By the way, when setting CurrentTheme=ThemeType.Flat in this simple example application, I get a NullReferenceException inside TeeChart.WPF.dll, is this supposed to happen?

Re: Controlling Header/Axis visibility

Posted: Mon Apr 04, 2016 12:53 pm
by Christopher
Hello,
AuerAhellwig wrote:By the way, when setting CurrentTheme=ThemeType.Flat in this simple example application, I get a NullReferenceException inside TeeChart.WPF.dll, is this supposed to happen?
No, it isn't. I discovered this issue a few weeks ago and it will not happen in the next maintenance release. Unfortunately there is no simple workaround to the issue, apologies for the inconvenience caused.