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 ?
axis labels and title overlaping for many vertical axes
axis labels and title overlaping for many vertical axes
- Attachments
-
- 无标题.png (17.14 KiB) Viewed 9618 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: axis labels and title overlaping for many vertical axes
You can use the CustomSize property, e.g.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 ?
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;
}
This seems to work as expected here, e.g.Chinfot wrote: Second,I want to draw a curve.when I set line.Smoothed = true; the Interface is not refresh. What should I do ?
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;
}
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 |
Re: axis labels and title overlaping for many vertical axes
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];
}
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];
}
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: axis labels and title overlaping for many vertical axes
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.Chinfot wrote:the Line's Datasource is not fixed.when I set line.Smoothed = true; Interface cannot refresh.
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 |