corelibraries-devexpress-dot-xtracharts-dot-printing-dot-chartoptionsprint-15ec473b.md
Gets or sets the value specifying whether to draw the crosshair when printing/exporting the chart.
Namespace : DevExpress.XtraCharts.Printing
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public bool PrintCrosshair { get; set; }
Public Property PrintCrosshair As Boolean
| Type | Description |
|---|---|
| Boolean |
true , if the crosshair should be printed/exported with a chart; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to PrintCrosshair |
|---|---|
| ChartControl |
.OptionsPrint .PrintCrosshair
|
Refer to the Print and Export help topic for more information on printing/exporting the chart.
This example demonstrates how the Print and Export functionality relies upon the ChartOptionsPrint.PrintCrosshair property. The Ribbon control contains two items: the Show Print Preview button and the Print Crosshair check button. The Chart Control displays the Crosshair Cursor on mouse click. When the check button is checked, the Crosshair Cursor that the Chart Control currently shows will be printed:
private void OnChartControlMouseUp(object sender, MouseEventArgs e) {
var diagram = (XYDiagram)chartControl.Diagram;
diagram.ShowCrosshair(e.Location.X, e.Location.Y);
}
private void OnShowPrintPreviewItemClick(object sender, ItemClickEventArgs e) {
chartControl.ShowPrintPreview();
}
private void OnPrintCrosshairItemClick(object sender, ItemClickEventArgs e) {
chartControl.OptionsPrint.PrintCrosshair = bciPrintCrosshair.Checked;
}
Private Sub OnChartControlMouseUp(sender As Object, e As MouseEventArgs)
var diagram = CType(chartControl.Diagram, XYDiagram)
diagram.ShowCrosshair(e.Location.X, e.Location.Y)
End Sub
Private Sub OnShowPrintPreviewItemClick(sender As Object, e As ItemClickEventArgs)
chartControl.ShowPrintPreview()
End Sub
Private Sub OnPrintCrosshairItemClick(sender As Object, e As ItemClickEventArgs)
chartControl.OptionsPrint.PrintCrosshair = bciPrintCrosshair.Checked
End Sub
See Also