When new data is added to the legend it may become too long to display in the control canvas. This is why you may wish to alter the legend layout strategy or in other words the way the legend expands when new items are added. The ExpandMode property of the legend controls this. The following table list the possible strategies:
ENLegendExpandMode | Description |
RowsOnly | The legend expands by rows only. The legend has one column. |
ColsOnly | The legend expands by columns only. The legend has one row. |
RowsFixed | Yhe legend has a fixed number of rows and expands in columns. |
ColsFixed | The legend has a fixed number of columns and expands in rows. |
The following example shows how to change the legend expand mode to a fixed number of rows:
C# |
Copy Code
|
---|---|
legend.ExpandMode = ENLegendExpandMode.RowsFixed; legend.RowCount = 4; |