TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
-
Justin
- Newbie
- Posts: 1
- Joined: Wed Jun 22, 2005 4:00 am
-
Contact:
Post
by Justin » Thu May 03, 2007 2:49 pm
How can I change the "border color" and "border visibility" properties programmatically?
These properties can be seen at design time, using an asp.net chart which has got a line with at least 1 series:
Open the Teechart editor (from the properties pane of the component, in design view).
Click on "Series" at the top of the dialogue box
Click on the point tab
Click on the border... button (under the height field)
This includes visible and color properties (among others)
These in particular are the two properties I want to change, along with point height and width. I want to change them at run time, on a chart that has been loaded from a template file. I don't want to use events (because the series are added at run time).
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu May 03, 2007 3:17 pm
Hi Justin,
You can set those properties programmatically as shown in the example below.
Also notice that events can be also created and assigned at run-time as shown in the example. In fact, Visual Studio's code completion is very handy in such cases. Just try typing the code below and you'll see it's much easier than you expected.
In
this thread it's discussed how GetPointerStyle event can be used.
Code: Select all
protected void Page_Load(object sender, EventArgs e)
{
Steema.TeeChart.Chart ch1 = WebChart1.Chart;
ch1.Aspect.View3D = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(ch1);
line1.Pointer.Visible = true;
line1.Pointer.Color = System.Drawing.Color.Red;
line1.Pointer.Pen.Color = System.Drawing.Color.Blue;
line1.Pointer.Pen.Visible = true;
line1.GetPointerStyle += new Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventHandler(line1_GetPointerStyle);
line1.FillSampleValues();
}
void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs e)
{
if (series.YValues[e.ValueIndex] > 500)
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Circle;
}
else
{
e.Style = Steema.TeeChart.Styles.PointerStyles.Rectangle;
}
}