Range
import {Range} from 'cx/charts';The Range component can be used to highlight important zones on the chart.
<div class="widgets" controller={PageController}>
<Svg style="width:600px; height:400px;">
<Chart offset="20 -10 -40 40" axes={{ x: { type: NumericAxis }, y: { type: NumericAxis, vertical: true } }}>
<Gridlines/>
<Range x1-bind="$page.p1.x" x2-bind="$page.p2.x" colorIndex={11} name="X Range" active-bind="$page.yrange">
<Text anchors="0 0.5 0 0.5" offset="5 0 0 0" ta="middle" dy="0.8em">X Range</Text>
</Range>
<Range y1-bind="$page.p1.y" y2-bind="$page.p2.y" colorIndex={8} name="Y Range" active-bind="$page.xrange">
<Text anchors="0.5 0 0.5 0" dy="0.4em" dx={5}>Y Range</Text>
</Range>
<LineGraph data-bind="$page.points" colorIndex={0} />
<Marker colorIndex={11} x-bind="$page.p1.x" size={10} draggableX />
<Marker colorIndex={11} x-bind="$page.p2.x" size={10} draggableX />
<Marker colorIndex={8} y-bind="$page.p1.y" size={10} draggableY />
<Marker colorIndex={8} y-bind="$page.p2.y" size={10} draggableY />
</Chart>
</Svg>
<Legend />
</div>| Property | Description | Type |
|---|---|---|
colorIndex | Index of a color from the standard palette of colors. 0-15. | number |
colorMap | Used to automatically assign a color based on the | string |
colorName | Name used to automatically resolve color based from the contextual | string |
name | Name of the item as it will appear in the legend. | string |
x1 | The | number |
x2 | The | number |
xAxis | Name of the horizontal axis. The value should match one of the horizontal axes set in the | string |
y1 | The | number |
y2 | The | number |
yAxis | Name of the vertical axis. The value should match one of the vertical axes set in the | string |
active | Used to indicate if an item is active or not. Inactive items are shown only in the legend. | boolean |
anchors | Anchor defines how child bounds are tied to the parent. Zero aligns with the top/left edge. One aligns with the bottom/right edge. See Svg for more information. | string/number/rect |
class | Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list. | string/object |
constrain | Setting | boolean |
constrainX | Constrain the range position during drag operations to min/max values of the X axis. | boolean |
constrainY | Constrain the range position during drag operations to min/max values of the Y axis. | boolean |
draggable | Set to | boolean |
draggableX | Set to | boolean |
draggableY | Set to | boolean |
hidden | Set to true to skip rendering of visual elements and only render children instead. | boolean |
items | List of child elements. | array |
legend | Name of the legend to be used. Default is | string | false |
legendAction | Action to be performed if the user clicks on the legend entry. Default value is | string |
legendShape | Shape of the icon in the the legend. Default value is based on the chart type.
Additional shapes can be registered using the | string |
margin | Apply margin to the given boundaries. See Svg for more information. | string/number/rect |
mod | Appearance modifier. For example, | string/array |
offset | Move boundaries specified by the offset. See Svg for more information. | string/number/rect |
outerLayout | Defines the outer layout which wraps the widget. | widget |
padding | Padding to be applied to the boundaries rectangle before passing to the children. | string/number/rect |
plainText | Set to | boolean |
preserveWhitespace | Keep whitespace in text based children. Default is | boolean |
putInto | Used with outer layouts. Specifies the name of the content placeholder which should render the widget. | string |
style | Style object applied to the wrapper div. Used for setting the dimensions of the element. | string/object |
trimWhitespace | Remove all whitespace in text based children. Default is | boolean |
vdomKey | Key that will be used as the key when rendering the React component. | string |
visible | Visibility of the widget. Defaults to | boolean |