axis labels and title overlaping for many vertical axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Chinfot
Newbie
Newbie
Posts: 9
Joined: Wed Sep 02, 2015 12:00 am

axis labels and title overlaping for many vertical axes

Post by Chinfot » Wed Mar 30, 2016 9:25 am

hello
I hava two Problems,please help me.
Frist,Look the picture axis labels and title overlaping for many vertical axes.I want title on the left all the time,What should I do ?
Second,I want to draw a curve.when I set line.Smoothed = true; the Interface is not refresh. What should I do ?
Attachments
无标题.png
无标题.png (17.14 KiB) Viewed 9618 times

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

Re: axis labels and title overlaping for many vertical axes

Post by Christopher » Wed Mar 30, 2016 1:14 pm

Chinfot wrote: Frist,Look the picture axis labels and title overlaping for many vertical axes.I want title on the left all the time,What should I do ?
You can use the CustomSize property, e.g.

Code: Select all

    private void InitializeChart()
    {
      tChart1.Series.Add(typeof(Line)).FillSampleValues();

      tChart1.Axes.Left.Title.Text = "Left Title";
      tChart1.Axes.Left.Title.Angle = 90;
      tChart1.Axes.Left.Labels.CustomSize = 100;
    }
Chinfot wrote: Second,I want to draw a curve.when I set line.Smoothed = true; the Interface is not refresh. What should I do ?
This seems to work as expected here, e.g.

Code: Select all

	Line line;
    private void InitializeChart()
    {
      line = new Line(tChart1.Chart);
      line.FillSampleValues();
    }

    private void button4_Click(object sender, EventArgs e)
    {
      line.Smoothed = true;
    }
Can you please post some code with which we can reproduce your problem?
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

Chinfot
Newbie
Newbie
Posts: 9
Joined: Wed Sep 02, 2015 12:00 am

Re: axis labels and title overlaping for many vertical axes

Post by Chinfot » Thu Mar 31, 2016 9:48 am

the Line's Datasource is not fixed.when I set line.Smoothed = true; Interface cannot refresh. The following code.

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
line = new Line(tChart1.Chart);
timer1 = new Timer();
timer1.Interval = 2000;
timer1.Tick += new System.EventHandler(this.timer1_Tick_1);
timer1.Enabled = true;
timer1.Start();
}
Random rd = new Random(400);
Line line;
Timer timer1;

private void timer1_Tick_1(object sender, EventArgs e)
{
PointModel buffer = new PointModel();
for (int i = 0; i < 50; i++)
{
buffer.X = i;
if (i % 2 == 0)
{
buffer.Y = i + Convert.ToDouble(rd.Next(10, 50).ToString());
}
else
{
buffer.Y = i + Convert.ToDouble(rd.Next(10, 50).ToString());
}
}
line.Add(buffer.X, buffer.Y);
}

private void simpleButton1_Click(object sender, EventArgs e)
{
line.Smoothed = true;
}
}
public class PointModel
{
public double[] X=new double[50];

public double[] Y = new double[50];
}

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

Re: axis labels and title overlaping for many vertical axes

Post by Christopher » Thu Mar 31, 2016 10:18 am

Chinfot wrote:the Line's Datasource is not fixed.when I set line.Smoothed = true; Interface cannot refresh.
Okay, I can now see the problem, thank you. The solution is to set Smoothed to true every time you make a change to the series data, e.g.

Code: Select all

    private void timer1_Tick(object sender, EventArgs e)
    {
      PointModel buffer = new PointModel();
      for (int i = 0; i < 50; i++)
      {
        buffer.X[i] = i;
        if (i % 2 == 0)
        {
          buffer.Y[i] = i + Convert.ToDouble(rd.Next(10, 50).ToString());
        }
        else
        {
          buffer.Y[i] = i + Convert.ToDouble(rd.Next(10, 50).ToString());
        }
      }

      line.Smoothed = false;
      line.DataSource = null;
      line.Add(buffer.X, buffer.Y);
      line.Smoothed = true;
    }
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

Chinfot
Newbie
Newbie
Posts: 9
Joined: Wed Sep 02, 2015 12:00 am

Re: axis labels and title overlaping for many vertical axes

Post by Chinfot » Tue Apr 05, 2016 3:06 am

OK,thank you!

Post Reply