TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
AuerAhellwig
- Newbie
- Posts: 5
- Joined: Wed Mar 25, 2015 12:00 am
Post
by AuerAhellwig » Thu Mar 17, 2016 3:53 pm
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
-
Christopher
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Post
by Christopher » Fri Mar 18, 2016 11:34 am
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 (7.36 KiB) Viewed 9128 times
and
- wpf_2.PNG (7.59 KiB) Viewed 9126 times
do you get the same results?
-
AuerAhellwig
- Newbie
- Posts: 5
- Joined: Wed Mar 25, 2015 12:00 am
Post
by AuerAhellwig » Thu Mar 31, 2016 4:09 pm
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
}
-
Christopher
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Post
by Christopher » Fri Apr 01, 2016 8:43 am
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;
-
AuerAhellwig
- Newbie
- Posts: 5
- Joined: Wed Mar 25, 2015 12:00 am
Post
by AuerAhellwig » Mon Apr 04, 2016 9:38 am
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?
-
Christopher
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Post
by Christopher » Mon Apr 04, 2016 12:53 pm
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.