ComponentOne Chart for .NET (2.0) Search HelpCentral 

Setting a Default Label Style

The DefaultLabelStyle property of the ChartLabels object sets a default style for all current and future ChartLabels. This property can be useful in many ways, but two are outlined here. 

First, this property sets default style properties that all future Labels will inherit. Secondly, since all labels inherit this default style, if a default style property is changed, all of the ChartLabels will then take on this attribute. For instance, suppose 100 ChartLabels created at design time should have had green as the BackColor, the following code could be inserted into the application:

·      Visual Basic

C1Chart1.ChartLabels.DefaultLabelStyle.BackColor = Color.Green

·      C#

C1Chart1.ChartLabels.DefaultLabelStyle.BackColor = Color.Green;

·      Delphi

begin

  C1Chart1.ChartLabels.DefaultLabelStyle.BackColor := Color.Green;

end;

If style attributes for individual ChartLabels have to be changed, then these attributes can be set on the specific ChartLabel object manually.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.