Dear Support team,
I have a question about Teechart Increment. I just want to display 2 labels at Min and Max. So I code as below:
//Line 1
for (int i = 0; i < 300; i++ )
{
this.line1.Add(i % 100);
}
this.tChart1.Axes.Bottom.Visible = true;
this.tChart1.Axes.Left.Visible = true;
this.tChart1.Axes.Left.Automatic = false;
this.tChart1.Axes.Left.Minimum = 0;
this.tChart1.Axes.Left.Maximum = 100;
this.tChart1.Axes.Left.Increment = this.tChart1.Axes.Left.Maximum - this.tChart1.Axes.Left.Minimum;
//Line 2
for (int i = 0; i < 300; i++)
{
if(i>100)
this.line2.Add(-i % 100);
else
this.line2.Add(i % 100);
}
this.tChart2.Axes.Bottom.Visible = true;
this.tChart2.Axes.Left.Visible = true;
this.tChart2.Axes.Left.Automatic = false;
this.tChart2.Axes.Left.Minimum = -100;
this.tChart2.Axes.Left.Maximum = 100;
this.tChart2.Axes.Left.Increment = this.tChart2.Axes.Left.Maximum - this.tChart2.Axes.Left.Minimum;
And the result is
Could you please let me know where where are lables of Min and Max in second chart?
Why does not it display Min label and Max label like chart1?
Thank you very much!
Increment issue.
Re: Increment issue.
Hello tomking,
Testing your code I can see that when you assign increment in second chart, this is zero because Maximum is 100 and Minimum is -100 and difference is zero and the value of label in this case only would be zero. I recommend, if you want of Left axis increments well do next:
Could you confirm us if this change solve your problem?
Testing your code I can see that when you assign increment in second chart, this is zero because Maximum is 100 and Minimum is -100 and difference is zero and the value of label in this case only would be zero. I recommend, if you want of Left axis increments well do next:
Code: Select all
this.tChart2.Axes.Left.Increment = 100;
Best Regards,
Sandra Pazos / 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 |
Re: Increment issue.
Hi Sandra,
Thanks for your reply!
I just want to display only 2 labels at MIN and MAX position. That 's why I set:
this.tChart2.Axes.Left.Increment = this.tChart2.Axes.Left.Maximum - this.tChart2.Axes.Left.Minimum;
If I set
this.tChart2.Axes.Left.Increment = 100; It will display 3 labels that don't want.
Could you please hepl me to figure out this?
Thanks
Thanks for your reply!
I just want to display only 2 labels at MIN and MAX position. That 's why I set:
this.tChart2.Axes.Left.Increment = this.tChart2.Axes.Left.Maximum - this.tChart2.Axes.Left.Minimum;
If I set
this.tChart2.Axes.Left.Increment = 100; It will display 3 labels that don't want.
Could you please hepl me to figure out this?
Thanks
Re: Increment issue.
What about custom labels. Will that solve your problem?
*I have not checked that piece of code myself. I use it to place logarithmic labels on a linear axis like this:
Code: Select all
TChart1.Axes.Left.Labels.Items.Clear()
TChart1.Axes.Left.Labels.Items.Add(MIN, MIN.ToString())'or Format(
TChart1.Axes.Left.Labels.Items.Add(MIN, MAX.ToString())
Code: Select all
TChart2.Axes.Left.Labels.Items.Clear()
Chart2.Axes.Left.CalcMinMax(min, max)
imin = Math.Truncate(min)
imax = Math.Ceiling(max)
For i As Double = imin To imax Step 1
TChart2.Axes.Left.Labels.Items.Add(i, Math.Pow(10, i).ToString())
Next
Re: Increment issue.
Hi Anton,
I have solved this problem by custom labels.
Thank you very much!
I have solved this problem by custom labels.
Thank you very much!
Re: Increment issue.
This should also work
Code: Select all
this.tChart2.Axes.Left.Increment = 200