Series getting overlapped with another series on chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Series getting overlapped with another series on chart

Post by VarUser » Wed Jun 22, 2011 9:32 am

Hi

We are displaying multiple series on chart and the series have custom axis. PFA herewith the snapshot of problem we are describing.
The problem is that when you scroll the data in one of the series, the series data gets drawn in the area of another series. Actually if series data goes out of series range it should not display anything.

Below is the sample code depicting the problem.

Regards
- JC

private const byte AlphaChanel = 64;
private void Window_Loaded(object sender, RoutedEventArgs e)
{


tChart.Aspect.View3D = false;
tChart.Aspect.Orthogonal = false;

//ltangL UseGuildLines improves performance but creating drawing gaps (TeeChart bug?)
//tChart.Aspect.UseGuidelines = true;
//tChart.Aspect.UseGuidelines = true;

tChart.ClipToBounds = true;
tChart.Aspect.ClipPoints = true;

//tChart.Axes.Left.Grid.Visible = false;
//tChart.Axes.Bottom.Grid.Visible = false;

//tChart.Axes.Bottom.MaximumOffset = 8;
//tChart.Axes.Bottom.MinimumOffset = 8;

//ltang: Insert gap between bottom axis and series
//tChart.Axes.Left.MaximumOffset = 8;
//tChart.Axes.Left.MinimumOffset = 8;

//ltang: Make rooms for displaying axes' labels
tChart.Panel.MarginUnits = PanelMarginUnits.Pixels;
tChart.Panel.MarginLeft = 45;
tChart.Panel.MarginBottom = 30;
tChart.Panel.MarginRight = 45;
tChart.Panel.MarginTop = 5;


Color color = Colors.White;
color.A = AlphaChanel;

tChart.Panel.Color = color;
tChart.Panel.Shadow.Visible = false;
tChart.Walls.Back.Color = color;
tChart.Panel.Bevel.ColorOne = Colors.Transparent;
tChart.Panel.Bevel.ColorTwo = Colors.Transparent;
tChart.Panel.Gradient = null;

tChart.Walls.Visible = false;
tChart.Legend.Visible = false;

tChart.Axes.Bottom.Grid.Visible = false;
tChart.Axes.Left.Grid.Visible = false;

tChart.Header.Font.Size = 16;

//tChart.Zoom.Direction = ZoomDirections.Horizontal;
//tChart.Zoom.Allow = true;

tChart.Panning.MouseButton = MouseButton.Left;



FastLine series1 = AddSeries(1);
FastLine series2 = AddSeries(2);

series1.Cursor = Cursors.Hand;

series1.GetVertAxis.StartPosition = 0;
series1.GetVertAxis.EndPosition = 50;
series1.GetVertAxis.Visible = true;
//series1.GetHorizAxis.Visible = false;

series2.GetVertAxis.StartPosition = 61;
series2.GetVertAxis.EndPosition = 100;
series2.GetVertAxis.Visible = true;
series2.GetHorizAxis.Visible = true;

tChart.Zoom.Direction = ZoomDirections.Both;
//tChart.Zoom.Animated = true;
tChart.Zoom.History = true;

//tChart.Series.Add(series);

//SeriesMarks marks = new SeriesMarks(series2);
//marks.Clip = true;
//marks.Transparent = true;





AxisScroll scrollTool1 = new AxisScroll(series1.GetHorizAxis);
AxisScroll scrollTool2 = new AxisScroll(series2.GetHorizAxis);

AxisScroll scrollTool3 = new AxisScroll(series1.GetVertAxis);
AxisScroll scrollTool4 = new AxisScroll(series2.GetVertAxis);


//tChart.Zoomed += new EventHandler(tChart_Zoomed);
}

private FastLine AddSeries(int i)
{
FastLine series = new FastLine(tChart.Chart);
series.Add(new Point(1, 10 * i));
series.Add(new Point(2, -10 * i));
series.Add(new Point(3, 20 * i));
series.Add(new Point(4, 40 * i));
series.Add(new Point(5, 40 * i));
series.Add(new Point(6, 10 * i));
//series.CustomVertAxis = new Axis(tChart.Chart);
//series.GetVertAxis = series.CustomVertAxis;

Axis xAxis, yAxis;
xAxis = (Axis)tChart.Axes.Bottom.Clone();
yAxis = (Axis)tChart.Axes.Left.Clone();

series.CustomHorizAxis = xAxis;
series.CustomVertAxis = yAxis;

tChart.Axes.Custom.Add(xAxis);
tChart.Axes.Custom.Add(yAxis);

xAxis.Automatic = false;
yAxis.Automatic = false;

xAxis.Minimum = 1;
xAxis.Maximum = 7;

yAxis.Minimum = -40;
yAxis.Maximum = 60;

//xAxis.Minimum = xAxis.Maximum = 0;

xAxis.Visible = false;
yAxis.Visible = false;


tChart.Series.Add(series);

return series;
}
Attachments
overlappedseries.JPG
showing overlapped series problem
overlappedseries.JPG (17.46 KiB) Viewed 4031 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Series getting overlapped with another series on chart

Post by Sandra » Thu Jun 23, 2011 9:48 am

Hello VarUser,

I recommend that you take a look in the Demo project concretely in the All Features\Welcome !\Axes\Opaque zones where works with custom axes and doesn't allow that series are drawn in the area of another series.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply