Page 1 of 1

Line Series not shown when values at borders of the chart

Posted: Thu Jun 07, 2012 9:35 am
by 15660987
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.

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

Posted: Thu Jun 07, 2012 9:37 am
by 15660987
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.

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

Posted: Thu Jun 07, 2012 9:56 am
by 15660987
Even with the latest version (4.1.2012.5103) I have this issue.

Marijke

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

Posted: Thu Jun 07, 2012 11:13 am
by 10050769
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,

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

Posted: Thu Jun 07, 2012 1:57 pm
by 15660987
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.

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

Posted: Thu Jun 07, 2012 3:03 pm
by 10050769
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,

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

Posted: Fri Jun 08, 2012 7:12 am
by 15660987
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

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

Posted: Fri Jun 08, 2012 7:17 am
by 15660987
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

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

Posted: Fri Jun 08, 2012 10:07 am
by 10050769
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 15782 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 15777 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,

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

Posted: Fri Jun 08, 2012 10:19 am
by 15660987
This is the project I made for this test program.

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

Posted: Fri Jun 08, 2012 3:27 pm
by 10050769
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,

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

Posted: Mon Jun 11, 2012 7:10 am
by 15660987
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.

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

Posted: Mon Jun 11, 2012 7:54 am
by 10050769
Hello MVB,

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

Thanks,