I have an application in which the Area Series is behaving strangely. I've spent some time to analyse this strange behavior. You can use the source code below in a standard Windows Forms Application project in Visual Studio 2008.
If you run this code, you will see the problem right away. The area series is transparent. If you zoom in far enough, the transparency will be gone. Also, if you turn on the chart's 3D mode, the transparency is also gone, without having to zoom in.
The TeeChart.dll i am using is version 3.5.3146.24805
If anybody wants the project in a zip file, just let me know
Code: Select all
public partial class Form1 : Form
{
private TChart myChart;
public Form1()
{
InitializeComponent();
InitializeChart();
DrawLines();
}
private void DrawLines()
{
Area area = new Area(myChart.Chart);
area.UseOrigin = true;
area.Origin = 10;
area.Stairs = true;
Color lineColor = Color.Orange;
area.AreaLines.Color = lineColor;
for (int i = 0; i < 400; i++)
{
area.Add(i, ((i % 2) * 10) + 25, lineColor);
}
area.Add(450, 35, Color.Transparent);
for (int i = 500; i < 1000; i++)
{
area.Add(i, ((i % 2) * 10) + 25, lineColor);
}
}
private void InitializeChart()
{
// Set colors and layout
myChart = new TChart();
myChart.Dock = DockStyle.Fill;
myChart.Aspect.View3D = false;
//// Set background
myChart.Walls.Back.Transparent = false;
myChart.Walls.Back.Brush.Color = Color.FromArgb(64, 64, 64);
myChart.Walls.Back.Brush.Gradient.Visible = false;
//// Set up the bottom Axis
myChart.Axes.Bottom.Automatic = false;
myChart.Axes.Bottom.Visible = true;
myChart.Axes.Bottom.Minimum = 0;
myChart.Axes.Bottom.Maximum = 1000;
myChart.Axes.Left.Automatic = false;
myChart.Axes.Left.Horizontal = false;
myChart.Axes.Left.Minimum = -1;
myChart.Axes.Left.Maximum = 101;
this.Controls.Add(myChart);
}
}