Not able to change axis scale as well as time.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
biji
Newbie
Newbie
Posts: 35
Joined: Wed Jul 02, 2008 12:00 am

Not able to change axis scale as well as time.

Post by biji » Thu Nov 19, 2015 10:00 am

Hi all,

I am trying to update chart with live data, I have drwan four series, each series have its own custum vertical axis. I have to assign time values as x-axis(bottom) for all series.
I was able to draw all series. I have two issues.
1) I was not able to change custum vertical axis scale values(min or max), once i start the chart updating. I have default setting in .xml file and i was able to assign those scales by at start but i need change while updating as well. i am trying like this (just for one series)

Code: Select all

           _chart.Series[0].CustomVertAxis.Automatic = false;
            _chart.Series[0].CustomVertAxis.Minimum = SystemNames.GetSignalInfo("Density").MinimumScaleValue;
            _chart.Series[0].CustomVertAxis.Maximum = SystemNames.GetSignalInfo("Density").MaximumScaleValue;
At starting it was working perfect but while i try to change when running and i can see update values in MinimumScaleValue and MaximumScaleValue variables but it is not updating in the cart.
Even i tried to set like

Code: Select all

  _chart.Axes.Custom[0].SetMinMax(Convert.ToDouble(DMin.Text), Convert.ToDouble(DMax.Text));
2) I am trying to assign time as x-axis(bottom) values for series. I am getting diffrent time format like 15.01.19989.....

Code: Select all

             // _chart.Series[0].XValues.DataMember = DateTime.Now.ToShortDateString(); 
              _chart.Series[0].XValues.DateTime = true;
              _chart.Series[0].XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;

                //_chart.Walls.Back.Visible = true;
                _chart.Axes.Bottom.Title.Text = "Time";
                _chart.Axes.Bottom.AutomaticMaximum = true;
                _chart.Axes.Bottom.AutomaticMinimum = true;
Can anyone suggest me what i am doing wrong? how can i update these two?
Thanks,

Regards.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Not able to change axis scale as well as time.

Post by Christopher » Thu Nov 19, 2015 1:17 pm

Hello!
biji wrote: Can anyone suggest me what i am doing wrong? how can i update these two?
There will be a way to resolve your issue, but to do so we need a little more information. Would you please be so kind as to read the instructions on posting here and provide us with a simple example project, as mentioned in point 2?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

biji
Newbie
Newbie
Posts: 35
Joined: Wed Jul 02, 2008 12:00 am

Re: Not able to change axis scale as well as time.

Post by biji » Fri Nov 20, 2015 4:06 pm

Hi Christopher,

Thanks for your reply,

After a day strugle with it i was able to change scale values of vertical custoum axis. But still i have issue in setting Time values as x-axis(bottom).

is it possible to explain me how can i do basically? if not i can send my entire project even though it is confidential..

Regards,
Biji.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Not able to change axis scale as well as time.

Post by Christopher » Mon Nov 23, 2015 9:13 am

Hello,

Have you seen the features demo under:
%ProgramFiles(x86)%\Steema Software\Steema TeeChart for .NET 2015 4.1.2015.08060\Examples\DemoProject\bin\ExecutableDemo\TeeChartNetExamples.exe ?

There is a section on how to work with Axes:
All Features -> Welcome !\Axes

Are any of those examples helpful?

BTW, we don't need you to send us your entire project, what we need is a Short, Self-Contained, Correct (Compilable) Example as explained here.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

biji
Newbie
Newbie
Posts: 35
Joined: Wed Jul 02, 2008 12:00 am

Re: Not able to change axis scale as well as time.

Post by biji » Mon Nov 23, 2015 6:13 pm

Hi Cristopher,

I have sent my project with zip file(TruboPVT2)uploaded into mypage or steema server.. If you run the program then you can see chart and series what i am doing. Code for updating chart will be located in "Log.cs" file. "Updatechart" function is called in a timer to update chart. I was not able to get time as x-values of series(0), or bottom axis.

I am getting time format as different than current time?

Can you have a look and suggest me.

Regards,
Biji.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Not able to change axis scale as well as time.

Post by Christopher » Tue Nov 24, 2015 10:37 am

Biji,
biji wrote: I have sent my project with zip file(TruboPVT2)uploaded into mypage or steema server.. If you run the program then you can see chart and series what i am doing..
Thank you for your project. Just to point out that in the link I sent you to the creation of a Short, Self-Contained, Correct (Compilable) Example (here) it says,
Short
This depends on the group or forum. For a public forum, most readers will stop reading by 100 lines of code, and start complaining at 250-300 lines of code.
I note that your example contains 5119 lines of code. For this reason I have been unable to fully understand your problem.

Using this code:

Code: Select all

    Line line1;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      line1  = new Line(tChart1.Chart);
      line1.FillSampleValues();
    }

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
      line1.XValues.DateTime = checkBox1.Checked;
    }
when checkBox1.Checked is true I get the following chart:
export635839576911781099.png
export635839576911781099.png (23.89 KiB) Viewed 10848 times
This could be similar to the problem you are getting. Using this code:

Code: Select all

    Line line1;
    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      line1  = new Line(tChart1.Chart);
      Random rnd = new Random();
      DateTime today = DateTime.Today;
      for (int i = 0; i < 20; i++)
      {
        line1.Add(today, rnd.Next(0, 1000));
        today = today.AddDays(1);
      }
    }

    private void checkBox1_CheckedChanged(object sender, EventArgs e)
    {
      line1.XValues.DateTime = checkBox1.Checked;
    }
I get the following chart with checkBox1.Checked = true:
export635839578928058695.png
export635839578928058695.png (36.14 KiB) Viewed 10847 times
and the following chart with checkBox1.Checked = false:
export635839578971891074.png
export635839578971891074.png (33.03 KiB) Viewed 10857 times
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply