Hi qcrnd,
I think that now I understand the problem. Let me explain you some issues:
2D lines
- Only the LinePen is drawn by default and it's drawn using the series color.
- If you want to see a border you have to set OuterLine visible.
3D lines
- It is drawn a plane and a border line by default. The plane is drawn with the series color and the border line is the LinePen (black by default).
- If you have OuterLine visible, you'll see two border lines.
Knowing this, if you want to change from 2D to 3D and see something similar you'll have to copy some properties because the LinePen in 2D will be the border in 3D and the OuterLine in 2D will disappear in 3D.
The only problem I see is that the OuterLine seems to grow as LinePen grows.
I the other hand, note that the legend symbol changes automatically from 2D to 3D because, by default, lines have no border in 2D but in 3D. So to avoid this I'm afraid that you should draw your custom symbols directly to the legend. Here there is an example of everything:
Code: Select all
int FirstItemTopLegend;
private void InitializeChart()
{
chartController1.Chart = tChart1;
tChart1.Aspect.View3D = false;
tChart1.Walls.Back.Gradient.Visible = false;
tChart1.Walls.Back.Color = Color.Black;
for (int i = 0; i < 4; i++)
{
new Line(tChart1.Chart);
tChart1.Series[i].FillSampleValues(5);
((Line)tChart1.Series[i]).LinePen.Width = 4;
((Line)tChart1.Series[i]).OutLine.Visible = true;
((Line)tChart1.Series[i]).OutLine.Color = Color.White;
((Line)tChart1.Series[i]).OutLine.Width = 0;
}
tChart1.GetLegendRect += new Steema.TeeChart.GetLegendRectEventHandler(tChart1_GetLegendRect);
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int SymbolTop, SymbolLeft, SymbolBottom, SymbolRight;
int SymbolsTopMargin = 3;
int SymbolsLeftMargin = 5;
int SymbolsSize = 10;
int SymbolsSeparation = 14;
for (int i = 0; i < tChart1.Series.Count; i++)
{
SymbolLeft = tChart1.Legend.Left + SymbolsLeftMargin;
SymbolRight = tChart1.Legend.Left + SymbolsLeftMargin + SymbolsSize;
SymbolTop = FirstItemTopLegend + (i * SymbolsSeparation) + SymbolsTopMargin;
SymbolBottom = FirstItemTopLegend + (i * SymbolsSeparation) + SymbolsSize + SymbolsTopMargin;
tChart1.Graphics3D.Brush.Color = tChart1.Series[i].Color;
tChart1.Graphics3D.Pen.Color = Color.Gray;
tChart1.Graphics3D.Rectangle(tChart1.Legend.Left + SymbolsLeftMargin,
FirstItemTopLegend + (i * SymbolsSeparation) + SymbolsTopMargin,
tChart1.Legend.Left + SymbolsLeftMargin + SymbolsSize,
FirstItemTopLegend + (i * SymbolsSeparation) + SymbolsSize + SymbolsTopMargin);
}
}
void tChart1_GetLegendRect(object sender, Steema.TeeChart.GetLegendRectEventArgs e)
{
FirstItemTopLegend = e.Rectangle.Top;
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
tChart1.Aspect.View3D = checkBox1.Checked;
for (int i = 0; i < tChart1.Series.Count; i++)
{
((Line)tChart1.Series[i]).OutLine.Visible = !tChart1.Aspect.View3D;
if (tChart1.Aspect.View3D)
{
((Line)tChart1.Series[i]).LinePen.Width = 1;
((Line)tChart1.Series[i]).LinePen.Color = Color.White;
}
else
{
((Line)tChart1.Series[i]).LinePen.Width = 4;
((Line)tChart1.Series[i]).LinePen.Color = tChart1.Series[i].Color;
}
}
}