MultiLine Marks
MultiLine Marks
I can set the Marks MultiLine property to true but it has no efect. Do I need to set clip to false as well. What drives the mark text to appear on multiple lines?
Also on the ColorGrid Control I want to add Multiple cells with custom colors. I can do this with add(x,z,y,text,color). But how can I modify what labels are shown on the Bottom axis. If I have say a 10 by 10 grid I want to display years 1998-2007 along the bottom axis.
Thx
Also on the ColorGrid Control I want to add Multiple cells with custom colors. I can do this with add(x,z,y,text,color). But how can I modify what labels are shown on the Bottom axis. If I have say a 10 by 10 grid I want to display years 1998-2007 along the bottom axis.
Thx
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
You can also make marks having multiple lines adding line breaks into them, for example:
Using GetMarkText event you can automatically parse marks text too. You could replace blank spaces for line brakes or implement any customization you wish.
Alternatively you can do this:
Marks are split in lines when you choose a "compound" mark style like: MarksStyles.LabelPercent, MarksStyles.LabelPercentTotal or MarksStyles.XY.I can set the Marks MultiLine property to true but it has no efect. Do I need to set clip to false as well. What drives the mark text to appear on multiple lines?
You can also make marks having multiple lines adding line breaks into them, for example:
Code: Select all
line1.Add(25, "mark line 1\nmark line 2");
In that case you can do something like this:Also on the ColorGrid Control I want to add Multiple cells with custom colors. I can do this with add(x,z,y,text,color). But how can I modify what labels are shown on the Bottom axis. If I have say a 10 by 10 grid I want to display years 1998-2007 along the bottom axis.
Code: Select all
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
Random y = new Random();
for (int x = 0; x < 10; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid1.Add(x, y.Next(), z , Convert.ToString(1997+x));
}
}
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Text;
Code: Select all
Steema.TeeChart.Styles.ColorGrid colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
int year = DateTime.Now.Year-11;
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid1.Add(x, y.Next(), z );
}
}
//tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
Adding x values as DateTime values as in the second code snippet I posted should solve this problem. There you can set a label for each point.
Adding x values as DateTime values as in the second code snippet I posted should solve this problem. There you can set a label for each point.
Best Regards,
Narcís Calvet / 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 |
Hi I tried your code with slight mod
int year = DateTime.Now.Year - 11;
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid.Add(x, y.Next(), z,"Test" + x.ToString() + "-" + z.ToString(),Color.Yellow);
}
}
colorGrid.Marks.Visible = true;
colorGrid.Marks.Font.Size = 6;
colorGrid.Marks.Transparent = true;
colorGrid.Marks.Style = MarksStyles.LabelPercent;
colorGrid.Marks.MultiLine = true;
tChart.Axes.Bottom.Labels.Style = AxisLabelStyle.Text;
tChart.Series.Add(colorGrid);
Ths first column has no colours and I am unable to see the bottom axis as year?
int year = DateTime.Now.Year - 11;
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid.Add(x, y.Next(), z,"Test" + x.ToString() + "-" + z.ToString(),Color.Yellow);
}
}
colorGrid.Marks.Visible = true;
colorGrid.Marks.Font.Size = 6;
colorGrid.Marks.Transparent = true;
colorGrid.Marks.Style = MarksStyles.LabelPercent;
colorGrid.Marks.MultiLine = true;
tChart.Axes.Bottom.Labels.Style = AxisLabelStyle.Text;
tChart.Series.Add(colorGrid);
Ths first column has no colours and I am unable to see the bottom axis as year?
Extended but first column still has no colour.
int year = DateTime.Now.Year - 11;
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid.Add(x, y.Next(), z,"Test" + x.ToString() + "-" + z.ToString(),Color.Yellow);
}
}
colorGrid.Marks.Visible = true;
colorGrid.Marks.Font.Size = 6;
colorGrid.Marks.Transparent = true;
colorGrid.Marks.Style = MarksStyles.LabelPercent;
colorGrid.Marks.MultiLine = true;
colorGrid.HorizAxis = HorizontalAxis.Bottom;
tChart.Axes.Visible = true;
tChart.Axes.Bottom.Visible = true;
tChart.Axes.Left.Visible = false;
tChart.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
tChart.Axes.Bottom.Labels.ValueFormat = "0000";
tChart.Axes.Bottom.Increment = 1;
tChart.Series.Add(colorGrid);
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid.Add(x, y.Next(), z,"Test" + x.ToString() + "-" + z.ToString(),Color.Yellow);
}
}
colorGrid.Marks.Visible = true;
colorGrid.Marks.Font.Size = 6;
colorGrid.Marks.Transparent = true;
colorGrid.Marks.Style = MarksStyles.LabelPercent;
colorGrid.Marks.MultiLine = true;
colorGrid.HorizAxis = HorizontalAxis.Bottom;
tChart.Axes.Visible = true;
tChart.Axes.Bottom.Visible = true;
tChart.Axes.Left.Visible = false;
tChart.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
tChart.Axes.Bottom.Labels.ValueFormat = "0000";
tChart.Axes.Bottom.Increment = 1;
tChart.Series.Add(colorGrid);
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
This solves first column issue.
Regarding bottom axis labels you already found the solution setting bottom axis labels style to AxisLabelStyle.Value.
Sorry, I forgot to set IrregularGrid=true in my example:Ths first column has no colours and I am unable to see the bottom axis as year?
Code: Select all
colorGrid.IrregularGrid = true;
Regarding bottom axis labels you already found the solution setting bottom axis labels style to AxisLabelStyle.Value.
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
Adding this line:
To your code works fine for me here using latest TeeChart for .NET v3 release available at the client area. Which TeeChart version are you using?
Adding this line:
Code: Select all
colorGrid.CenteredPoints = true;
Best Regards,
Narcís Calvet / 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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Luke,
I'm not able to reproduce it here using this code:
Can you please modify it so that I can reproduce the issue here?
Thanks in advance.
I'm not able to reproduce it here using this code:
Code: Select all
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Steema.TeeChart.Styles.ColorGrid colorGrid = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
colorGrid.IrregularGrid = true;
int year = DateTime.Now.Year - 11;
Random y = new Random();
for (int x = year; x < DateTime.Now.Year; x++)
{
for (int z = 0; z < 10; z++)
{
colorGrid.Add(x, y.Next(), z, "Test" + x.ToString() + "-" + z.ToString(), Color.Yellow);
}
}
colorGrid.Marks.Visible = true;
colorGrid.Marks.Font.Size = 6;
colorGrid.Marks.Transparent = true;
colorGrid.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent;
colorGrid.Marks.MultiLine = true;
colorGrid.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Bottom;
tChart1.Axes.Visible = true;
tChart1.Axes.Bottom.Visible = true;
tChart1.Axes.Left.Visible = false;
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
tChart1.Axes.Bottom.Labels.ValueFormat = "0000";
tChart1.Axes.Bottom.Increment = 1;
//tChart1.Series.Add(colorGrid);
colorGrid.CenteredPoints = true;
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |