Line Series not shown when values at borders of the chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Line Series not shown when values at borders of the chart

Post by MVB » Thu Jun 07, 2012 9:35 am

Hi,

I am having an issue with line series when the values are to be displayed at the borders of the chart.
A screenshot will illustrate my problem.

The first screenshot shows the problem. The blue line does not show all the values in the series.
The second screenshot shows the chart when I enabled point markers. It has exactly the same data points, but in this case the entire line is shown.

Any idea what I can do about this?

Thanks,
Marijke.
Attachments
Chart2.png
this is the same data but with point markers enabled
Chart2.png (8.16 KiB) Viewed 15721 times
Chart1.png
illustrates the problem in my line series
Chart1.png (8.81 KiB) Viewed 15718 times

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Thu Jun 07, 2012 9:37 am

apparently, when posting the topic, the screenshots are twisted.

So, what I mean is that
- when point markers are not shown (in the chart with the blue line) part of the line is missing. when the line touches the boundaries of the chart section.
- when there are point markers shown, the entire line is shown as it should (in the chart with the red line).

I hope that my explanation is a bit clear.

Marijke.

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Thu Jun 07, 2012 9:56 am

Even with the latest version (4.1.2012.5103) I have this issue.

Marijke

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by Sandra » Thu Jun 07, 2012 11:13 am

Hello Marijke,

I have made a simple code, where I am using two lines series and your problem doesn't appears for me.

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Line line,line2;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            DateTime dt = DateTime.Now;
            Random rnd = new Random(1000);

            line.XValues.DateTime = true;
            for (int i = 0; i < 10; i  )
            {
                line.Add(dt, rnd.Next(1000));
                dt = dt.AddDays(1);
            }
            line2.DataSource = line;
            line2.Active = false;
            checkBox1.CheckedChanged  = new EventHandler(checkBox1_CheckedChanged);
        }

        void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (!checkBox1.Checked)
            {
                line.Active = false;
                line2.Active = true;
                line2.Pointer.Visible = true;
            }
            else
            {
                line.Active = true;
                line2.Active = false;
            }
        }

For these reason, would be very helpful if you can try to modify it so I can reproduce your problem here. On the other hand, you need know that when you active the pointer of series to default property inflateMargins sets true and the values of axes scale are changed. To achieve the same effect in series that doesn't have visible the pointer, you can use SetMinMax() to rescale axes.

Thanks,
Best Regards,
Sandra Pazos / 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

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Thu Jun 07, 2012 1:57 pm

Here is a simple class where I can reproduce the problem

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Steema.TeeChart;

namespace TeeChartTest
{
    class ChartTester
    {
        private TChart chut; // chart under test

        private Steema.TeeChart.Styles.Line line;


        public ChartTester(TChart chartToTest)
        {
            chut = chartToTest;

            ConfigChart();
            AddTestData();
        }

        public void ConfigChart()
        {
            chut.Axes.Left.Grid.Visible = false;
            chut.Axes.Bottom.Grid.Visible = false;
            chut.Walls.Back.Visible = false;
            chut.Header.Visible = false;
        }

        public void AddTestData()
        {
            chut.Aspect.View3D = false;
            line = new Steema.TeeChart.Styles.Line(chut.Chart);
            line.Add(1, 10);
            line.Add(2, 15);
            line.Add(3, 15);
            line.Add(4, 10);
        }
    }
}
The result of this class shows the chart in the attachment of this post.
Attachments
chart_reproduced.png
chart_reproduced.png (27.78 KiB) Viewed 15675 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by Sandra » Thu Jun 07, 2012 3:03 pm

Hello MVB,

Ok, in this case I suggest you change the MaximumOffset of left axis to achieve show all of series as I do in next lines of code:

Code: Select all

Steema.TeeChart.Styles.Line line;
        public Form1()
        {
            InitializeComponent();
            tChart1.Aspect.View3D = false;
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line.Add(1, 10);
            line.Add(2, 15);
            line.Add(3, 15);
            line.Add(4, 10);
            tChart1.Axes.Left.MaximumOffset = 5;
        }
Can you tell us if previous code works as you expect?

I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Fri Jun 08, 2012 7:12 am

This works only when I switch the automatic values off.

So, the offset works only when I do this:

Code: Select all

TChart chut;

chut.Aspect.View3D = false;                        

chut.Axes.Left.Grid.Visible = false;                           
chut.Axes.Left.AutomaticMaximum = false;           
chut.Axes.Left.MaximumOffset = 5;                  
chut.Axes.Left.Maximum = 15;                       
                                             
chut.Axes.Bottom.Grid.Visible = false;             
                                             
chut.Walls.Back.Visible = false;                   
                                             
chut.Header.Visible = false;                       
                                             
line = new Steema.TeeChart.Styles.Line(chut.Chart);
line.Add(1, 10);                                   
line.Add(2, 15);                                   
line.Add(3, 15);                                   
line.Add(4, 10);                                   
But I really need to have the Left Axis scaled automatically. And as soon as I enable automatic axes, the offset does not do anything anymore.

Marijke

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Fri Jun 08, 2012 7:17 am

So, if I change this line

Code: Select all

chut.Axes.Left.AutomaticMaximum = false; 
into this line:

Code: Select all

chut.Axes.Left.AutomaticMaximum = true; 
The issue appears again.

Many thanks for your help.
Marijke

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by Sandra » Fri Jun 08, 2012 10:07 am

Hello Marijke,

I can not reproduce your issue using your code and last version of TeeChartFor.Net.

If I use your code setting the tChart1.Axes.Left.AutomaticMaximum to false

Code: Select all

   Steema.TeeChart.Styles.Line line;
        public Form1()
        {
            InitializeComponent();
            //Chart
            tChart1.Aspect.View3D = false;
            tChart1.Axes.Left.Grid.Visible = false;
            tChart1.Axes.Left.AutomaticMaximum = false;
            tChart1.Axes.Left.MaximumOffset = 5;
            tChart1.Axes.Left.Maximum = 15;
            tChart1.Axes.Bottom.Grid.Visible = false;
            tChart1.Walls.Back.Visible = false;
            tChart1.Header.Visible = false;
            //Series
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line.Add(1, 10);
            line.Add(2, 15);
            line.Add(3, 15);
            line.Add(4, 10);    
            checkBox1.CheckedChanged +=new EventHandler(checkBox1_CheckedChanged);
        }
I get next result:
AutoMaximumSetFalse.jpg
AutoMaximumSetFalse.jpg (28.39 KiB) Viewed 15661 times
If I use your code setting the tChart1.Axes.Left.AutomaticMaximum to true:

Code: Select all

     Steema.TeeChart.Styles.Line line;
        public Form1()
        {
            InitializeComponent();
            //Chart
            tChart1.Aspect.View3D = false;
            tChart1.Axes.Left.Grid.Visible = false;
            tChart1.Axes.Left.AutomaticMaximum = true;
            tChart1.Axes.Left.MaximumOffset = 5;
            tChart1.Axes.Left.Maximum = 15;
            tChart1.Axes.Bottom.Grid.Visible = false;
            tChart1.Walls.Back.Visible = false;
            tChart1.Header.Visible = false;
            //Series
            line = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            line.Add(1, 10);
            line.Add(2, 15);
            line.Add(3, 15);
            line.Add(4, 10);  
}
I get next result:
AutoMaximumSetTrue.jpg
AutoMaximumSetTrue.jpg (28.24 KiB) Viewed 15656 times
As you see I have gotten the same result, independently if I set true or false the AutomaticMaximum of Axis. For this reason, if you can attach me your project so we can try to find where is the problem. On the other hand, you need know, if you want work with automatic axes is not necessary use next lines of code, so to default TChart use automatic values in Axes:

Code: Select all

    tChart1.Axes.Left.AutomaticMaximum = true;
            tChart1.Axes.Left.Maximum = 15;
Thanks,
Best Regards,
Sandra Pazos / 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

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Fri Jun 08, 2012 10:19 am

This is the project I made for this test program.
Attachments
teeChartTest.rar
(32.16 KiB) Downloaded 532 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by Sandra » Fri Jun 08, 2012 3:27 pm

Hello MVB,

I am afraid your problem doesn't appear for me using last version 4 and your project and would be very greatful if you can check the same test in other computers and tell us what results you are achieved.

On the other hand, we consider that the problem that you have with Line Series that not shown when values at borders of the chart is a bug and we added it in bug list report wit number [TF02016217]. We try to fix it for next maintenance release of TeeChartFor.Net.

Thanks,
Best Regards,
Sandra Pazos / 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

MVB
Newbie
Newbie
Posts: 11
Joined: Fri Dec 09, 2011 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by MVB » Mon Jun 11, 2012 7:10 am

I changed my project to use the very last release of TeeChart .NET (4.1.2012.5103). The problem seems to be solved. In the project I have sent to you, I still used the older version (4.0.2009.42282).

Many thanks for your help.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Line Series not shown when values at borders of the chart

Post by Sandra » Mon Jun 11, 2012 7:54 am

Hello MVB,

Thanks for your information. I am glad that your problem have been solved, using last version of TeeChartFor.Net.

Thanks,
Best Regards,
Sandra Pazos / 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