The first label display incomplete in x axis.
The first label display incomplete in x axis.
I plot the graph using some points as the first attachment, including x1, y1, y2 axis. But when I remove some points in y1 axis, the graph changed as the second attachment, and first label in x1 axis displayed incomplete. Please help me to resolve it or give me a solution?
- Attachments
-
- The labels is complete
- label_appear.jpg (186.56 KiB) Viewed 12456 times
-
- The first label is incomplete
- label_disappear.jpg (152.97 KiB) Viewed 12446 times
Re: The first label display incomplete in x axis.
Hello sim,
I suggest you try to change your Minimum and Maximum Offset using something as next line of code:
Can you tell us if my suggestion help you to solve the problem?
Thank,
I suggest you try to change your Minimum and Maximum Offset using something as next line of code:
Code: Select all
tChart1.Axes.Bottom.MinimumOffset = 20;
Thank,
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: The first label display incomplete in x axis.
Thanks, i resolved it as you said.
But I have a new question, when I remove the points in y1 axis, the y1 axis title is disappear as the attachment, I want that the y1 title display.
Please help me again, thanks.
But I have a new question, when I remove the points in y1 axis, the y1 axis title is disappear as the attachment, I want that the y1 title display.
Please help me again, thanks.
- Attachments
-
- title_disappear.jpg (146.87 KiB) Viewed 12391 times
Re: The first label display incomplete in x axis.
Hello sim,
If you disable the Left axis the title of axis disappears, so it depends if its axis is visible or not. I think you can do something as do in next code, where I have used the GetAxisLabels to add a empty string in the Left Axis labels:
Can you please, tell us if previous code works as you want?
Thanks,
If you disable the Left axis the title of axis disappears, so it depends if its axis is visible or not. I think you can do something as do in next code, where I have used the GetAxisLabels to add a empty string in the Left Axis labels:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1, Series2;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Series1 = new Line(tChart1.Chart);
Series2 = new Line(tChart1.Chart);
Series1.Add(1.0, 1.0);
Series1.Add(1.0e+3, 1.0e+1);
Series1.Add(1.0e+5, 1.0e+2);
Series1.Add(1.0e+6, 1.0e+3);
Series1.Add(1.0e+1, 1.0e+4);
Series1.Add(1.0e+8, 1.0e+5);
Series1.Add(1.0e+7, 1.0e+6);
Series2.Add(-1.0);
Series2.Add(-1.0e+1);
Series2.Add(-1.0e+2);
Series2.Add(-1.0e+3);
Series2.Add(-1.0e+4);
Series2.Add(-1.0e+5);
Series2.Add(-1.0e+6);
Series2.RefreshSeries();
Series2.VertAxis = VerticalAxis.Right;
Series1.VertAxis = VerticalAxis.Left;
tChart1.Axes.Left.Labels.Exponent = true;
tChart1.Axes.Right.Labels.Exponent = true;
//Axis Left
tChart1.Axes.Left.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Left.Ticks.Visible = false;
tChart1.Axes.Left.Title.Text = "Axis Y1";
//Axis Right
tChart1.Axes.Right.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Right.Title.Text = "Axis Y2";
tChart1.Axes.Bottom.Labels.Exponent = true;
//Axis Bottom
tChart1.Axes.Bottom.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Bottom.Title.Text = "Axis X1";
tChart1.Axes.Bottom.MinimumOffset = 20;
tChart1.GetAxisLabel += new GetAxisLabelEventHandler(tChart1_GetAxisLabel);
}
void tChart1_GetAxisLabel(object sender, GetAxisLabelEventArgs e)
{
if (sender == tChart1.Axes.Left)
{
e.LabelText = "";
}
}
Thanks,
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: The first label display incomplete in x axis.
Sorry, the question have not been resolved yet. Perhaps what i said is not clear.
I want that left axis title display, but the points on left axis is disappear. Please help me, thanks.
I want that left axis title display, but the points on left axis is disappear. Please help me, thanks.
Re: The first label display incomplete in x axis.
Hello sim,
I have understand you want that the values of axis aren't visible but title yes. So, I made a simple example where appears the title but not the values. Can you tell us which you don't like of my code, so we can try to find a good solution for you?
Thanks,
I have understand you want that the values of axis aren't visible but title yes. So, I made a simple example where appears the title but not the values. Can you tell us which you don't like of my code, so we can try to find a good solution for you?
Thanks,
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: The first label display incomplete in x axis.
Hi Sandra,
I want the series disappear on left axis, not values. Please see the red line in the first attachment(left_appear).
After remove the series, the graph will changed as the second attachment(left_disappear), but I want the left axis title display.
Please again, thanks.
I want the series disappear on left axis, not values. Please see the red line in the first attachment(left_appear).
After remove the series, the graph will changed as the second attachment(left_disappear), but I want the left axis title display.
Please again, thanks.
- Attachments
-
- Left_appear.jpg (171.36 KiB) Viewed 12360 times
-
- Left_disappear.jpg (198.31 KiB) Viewed 12350 times
Re: The first label display incomplete in x axis.
Hello sim,
Ok. I have modified my previous project to third series disappears when the values of axes not appear. To do it I have used the property transparency of Series.
Can you tell if previous code help you to achieve as you want?
Thanks,
Ok. I have modified my previous project to third series disappears when the values of axes not appear. To do it I have used the property transparency of Series.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1, Series2, Series3;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//CheckBox
checkBox1.Checked = true;
// checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
Series1 = new Line(tChart1.Chart);
Series2 = new Line(tChart1.Chart);
Series3 = new Line(tChart1.Chart);
Series1.Add(1.0, 1.0);
Series1.Add(1.0e+3, 1.0e+1);
Series1.Add(1.0e+5, 1.0e+2);
Series1.Add(1.0e+6, 1.0e+3);
Series1.Add(1.0e+1, 1.0e+4);
Series1.Add(1.0e+8, 1.0e+5);
Series1.Add(1.0e+7, 1.0e+6);
Series2.Add(1.0e+3, 3.0e+1);
Series2.Add(1.0e+5, 1.0e+2);
Series2.Add(1.0e+6, 2.0e+3);
Series2.Add(1.0e+1, 1.0e+4);
Series2.Add(1.0e+8, 1.0e+5);
Series2.Add(1.0e+7, 3.0e+6);
Series3.Add(1.0);
Series3.Add(3.0e+1);
Series3.Add(-2.0e+2);
Series3.Add(3.0e+6);
Series3.Add(-2.0e+1);
Series3.Add(-3.0e+2);
Series2.VertAxis = VerticalAxis.Right;
Series1.VertAxis = VerticalAxis.Right;
Series3.VertAxis = VerticalAxis.Left;
tChart1.Axes.Left.Labels.Exponent = true;
tChart1.Axes.Right.Labels.Exponent = true;
//Axis Left
tChart1.Axes.Left.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Left.Title.Text = "Axis Y1";
//Axis Right
tChart1.Axes.Right.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Right.Title.Text = "Axis Y2";
tChart1.Axes.Bottom.Labels.Exponent = true;
//Axis Bottom
tChart1.Axes.Bottom.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Bottom.Title.Text = "Axis X1";
tChart1.Axes.Bottom.MinimumOffset = 20;
tChart1.GetAxisLabel += new GetAxisLabelEventHandler(tChart1_GetAxisLabel);
}
void tChart1_GetAxisLabel(object sender, GetAxisLabelEventArgs e)
{
if (sender == tChart1.Axes.Left)
{
if (!checkBox1.Checked)
{
e.LabelText = "";
}
}
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (Series3!= null)
{
if (checkBox1.Checked)
{
tChart1.Axes.Left.Ticks.Visible = true;
Series3.Transparency = 0;
Series3.ShowInLegend = true;
}
else
{
tChart1.Axes.Left.Ticks.Visible = false;
Series3.Transparency = 100;
Series3.ShowInLegend = false;
}
}
}
Thanks,
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: The first label display incomplete in x axis.
Hi sandra,
Sorry, the issue had not been resolved yet. I can not do it as you said. Because the points which combined the series3 is on the graph yet as you said, I want only series1 and series2 on there.
And I think the issus is not easy to solve.
Sorry, the issue had not been resolved yet. I can not do it as you said. Because the points which combined the series3 is on the graph yet as you said, I want only series1 and series2 on there.
And I think the issus is not easy to solve.
Re: The first label display incomplete in x axis.
Hello sim,
Ok. I suggest other solution, where I have drawn the title of vertical axes directly in the canvas.
Can you tell us if previous code works as you expect?
Thanks,
Ok. I suggest other solution, where I have drawn the title of vertical axes directly in the canvas.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line Series1, Series2, Series3;
Steema.TeeChart.Tools.Annotation ann;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Panel.MarginLeft = 10;
//CheckBox
checkBox1.Checked = true;
checkBox1.CheckedChanged += new EventHandler(checkBox1_CheckedChanged);
Series1 = new Line(tChart1.Chart);
Series2 = new Line(tChart1.Chart);
Series3 = new Line(tChart1.Chart);
Series1.Add(1.0, 1.0);
Series1.Add(1.0e+3, 1.0e+1);
Series1.Add(1.0e+5, 1.0e+2);
Series1.Add(1.0e+6, 1.0e+3);
Series1.Add(1.0e+1, 1.0e+4);
Series1.Add(1.0e+8, 1.0e+5);
Series1.Add(1.0e+7, 1.0e+6);
Series2.Add(1.0e+3, 3.0e+1);
Series2.Add(1.0e+5, 1.0e+2);
Series2.Add(1.0e+6, 2.0e+3);
Series2.Add(1.0e+1, 1.0e+4);
Series2.Add(1.0e+8, 1.0e+5);
Series2.Add(1.0e+7, 3.0e+6);
Series3.Add(1.0);
Series3.Add(3.0e+1);
Series3.Add(-2.0e+2);
Series3.Add(3.0e+6);
Series3.Add(-2.0e+1);
Series3.Add(-3.0e+2);
Series2.VertAxis = VerticalAxis.Right;
Series1.VertAxis = VerticalAxis.Right;
Series3.VertAxis = VerticalAxis.Left;
tChart1.Axes.Left.Labels.Exponent = true;
tChart1.Axes.Right.Labels.Exponent = true;
//Axis Left
tChart1.Axes.Left.Labels.ValueFormat = "#.0 x10 E+0";
//Axis Right
tChart1.Axes.Right.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Bottom.Labels.Exponent = true;
//Axis Bottom
tChart1.Axes.Bottom.Labels.ValueFormat = "#.0 x10 E+0";
tChart1.Axes.Bottom.Title.Text = "Axis X1";
tChart1.Axes.Bottom.MinimumOffset = 20;
tChart1.AfterDraw += new PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Graphics3D g)
{
string sleft = "Axis Y1";
string sright = "Axis Y2";
string sbottom = "Axis X1";
//Title Axis Left
g.TextAlign = StringAlignment.Far;
Rectangle rect = tChart1.Chart.ChartRect;
g.RotateLabel(rect.Left-(tChart1.Axes.Left.MaxLabelsWidth()+20), (rect.Height+ sleft.Length) / 2 ,sleft,90);
//Title Axis Right
g.TextAlign = StringAlignment.Near;
g.RotateLabel( rect.Right+(tChart1.Axes.Right.MaxLabelsWidth()+20), (rect.Height+sright.Length) / 2 , sright, -90);
//Title Axis Bottom
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (Series3 != null)
{
if (checkBox1.Checked)
{
tChart1.Axes.Left.Visible = true;
Series3.Active = true;
}
else
{
tChart1.Axes.Left.Visible = false;
Series3.Active = false;
}
}
}
Thanks,
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: The first label display incomplete in x axis.
Hi sandra,
Ok, thank you very much, I achieve as you said.
Ok, thank you very much, I achieve as you said.
Re: The first label display incomplete in x axis.
Hello sim,
I am glad that your problem are solved
Thanks,
I am glad that your problem are solved
Thanks,
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 |