MarkerLine
import {MarkerLine} from 'cx/charts';Marker lines can be used to highlight important values such as minimum or maximum.
<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, deadZone: 20}
}}
>
<Gridlines/>
<MarkerLine y-bind="$page.extremes.min" colorIndex={6}>
<Text anchors="0 0 0 0" offset="5 0 0 5" dy="0.8em">Min</Text>
</MarkerLine>
<MarkerLine y-bind="$page.extremes.max" colorIndex={3}>
<Text anchors="0 0 0 0" offset="-5 0 0 5">Max</Text>
</MarkerLine>
<LineGraph data-bind="$page.points" colorIndex={0}/>
</Chart>
</Svg>
<Legend />
<Button onClick="generate">
Generate
</Button>
</div>Note how
deadZoneis used on the vertical axis to reserve space for min/max labels.
Configuration
| Property | Description | Type |
|---|---|---|
affectsAxes | Used to indicate if the data should affect axis span. | boolean |
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 |
x | Shared | number |
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 |
y | Shared | number |
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 |
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 |