Changing appearance of points in Points series
Changing appearance of points in Points series
I have (many) points in stored in a points series and I also have some custom drawing done connecting some of the points. I now want the ability to switch the points on or off. Using the series.visibility property does not work, because the (auto) X and Y axes extreme values reset to nothing when series is set to invisible, so my custom drawing no longer works. I then tried to change the appearance of the points (e.g. make points width/height =0 or color=transparent) but this only seems to be possible in the Tchart editor? Is it possible to change a the points appearance of a a Points series with code (e.g. the style, colour, widht, etc)?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Changing appearance of points in Points series
Hello,
yes, the Points series has a Pointer property which you can use to change the color, style, and width of the Points series pointer. However, to simply make the series invisible without using the Series.Visible property - which means that Axis labels and Legend(s) continue to be rendered - an elegant way is to use the Series.Transparency property, e.g.
yes, the Points series has a Pointer property which you can use to change the color, style, and width of the Points series pointer. However, to simply make the series invisible without using the Series.Visible property - which means that Axis labels and Legend(s) continue to be rendered - an elegant way is to use the Series.Transparency property, e.g.
Code: Select all
private void InitializeChart(TChart chart)
{
var points = new Points(tChart1.Chart);
void Chart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
var onepoint = new Point(points.CalcXPos(100), points.CalcYPos(100));
var twopoint = new Point(points.CalcXPos(120), points.CalcYPos(120));
g.Pen.Width = 3;
g.Pen.Color = Color.Red;
g.Line(onepoint, twopoint);
}
chart.AfterDraw += Chart_AfterDraw;
points.FillSampleValues(1000);
chart.Axes.Bottom.SetMinMax(50, 150);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
tChart1[0].Transparency = checkBox1.Checked ? 0 : 100;
}
Best Regards,
Christopher Ireland / 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 |