Scrollbar Scaling

You can use scaling while you are scrolling through large amounts of data to zoom in on important data.

Scaling can be implemented at run time by clicking on the scroll bar buttons, or in code, using the ScaleMenuItems property.

 

 

A built-in scale menu appears when the Buttons property is set to ScaleAndScrollButtons (default).

The following table includes the values' descriptions for the Buttons property:

 

Value

Description

NoButtons

No buttons appear on the scrollbar.

ScrollButtons

Scroll buttons appear on the scrollbar.

ScaleButton

A scale dropdown button appears. When the dropdown button is clicked a built-in scale menu appears with default scale items.

ScaleAndScrollButtons

The default setting. Both the scroll buttons and scale button appears on the scrollbar.

 

If you prefer your own menu for the scale menu, you can create it and assign it to the ScaleMenu property.

Individual members of the ScaleMenuItem collection can be accessed through design-time using the ScaleMenuItem Collection Editor or through code by using the ScaleMenuItems property to tie the new collection for the scale menu items to the axis scrollbar.

Using the Designer

To add scale items to the scale menu at design time, complete the following:

1.   Right-click on the C1Chart control and select Properties from its context menu.

2.   In the Properties window, expand the ChartArea node, expand the AxisX, AxisY, or AxisY2 node, and then expand the ScrollBar.

3.   Click on the ellipsis button next to the ScaleMenuItems property. The ScaleMenuItem Collection Editor appears.

 

 

4.   Click Add to add a new item to the collection and then set its Scale and Text properties to the desired value.

5.   Click OK when you are finished.

Using Code

To add custom menu items to the scale menu, you can clear the existing collection and add the scale items to the collection like the following:

      Visual Basic

      C#

The example given in the code above will clear the existing collection and add new scale menu items to the scrollbar on the x-axis. The ScaleMenuItems property is used to tie the new collection to the axis scrollbar on the chart. The first parameter to the Add method is the scale, which must be a double value between 0 and 1 inclusive. The second parameter, text, is the text that appears in the menu.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.