Version

Defining Markers

Purpose

This topic demonstrates, with code examples, how to define the markers for XamSparkline™ control.

Required Background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic Purpose

This topic provides an overview of the XamSparkline control, its benefits, and the supported chart types.

This topic provides an overview of the possible ways to configure the XamSparkline control. Links to the detailed configurations (available in separate topics) are provided as well.

Defining Markers – Conceptual Overview

Introduction

Markers are symbols (circular colored icons) overlaid on the Sparkline to indicate the individual data points based on X/Y coordinates. Markers can be set on Sparkline of types Line , Area and Column . The WinLoss type of Sparkline does not accept markers.

Markers can be displayed on the first, last, highest, lowest and negative data points and as any combination of these.

By default, markers are not displayed.

Property settings

The following table maps the tasks related to displaying markers to the property settings that configure them.

Note: The Collapsed setting indicates the default state of any marker in which they are not visible.

In order to: Use this property: And set it to:

Display all markers

Visible

Hide all markers

Collapsed

Display the marker on the first data point

Visible

Hide the marker on the first data point

Collapsed

Display the marker on the last data point

Visible

Hide the marker on the last data point

Collapsed

Display the marker on the highest data point

Visible

Hide the marker on the highest data point

Collapsed

Display the marker on the lowest data point

Visible

Hide the marker on the lowest data point

Collapsed

Display the markers on the negative data points

Visible

Hide the markers on the negative data points

Collapsed

Example

The screenshot below demonstrates how the Sparkline looks as a result of the following settings:

Property Value

Visible

15

sparkline visual elements 2.png

Configuring Markers

Markers can be configured in the following aspects:

  • Selecting the data points to indicate, individually or in combination such as the first, last, highest, lowest and the negative values; for details, refer to the Property settings block.

  • Size

  • Color

For details on how to configure the markers’ size and color, refer to the Configuring Markers topic.

Defining Markers - Code Example

Description

The code below demonstrates how to display markers on the following data points:

  • The first data point

  • The last data point

  • On all negative data points

Preview

Sparkline Defining Markers 2.png

Code

In XAML:

    <igSparkline:XamSparkline
                MarkerVisibility="Collapsed"
                HighMarkerVisibility="Collapsed"
                LowMarkerVisibility="Collapsed"
                FirstMarkerVisibility="Visible"
                LastMarkerVisibility="Visible"
                NegativeMarkerVisibility="Visible" />

In C#:

this.XamSparkline1.MarkerVisibility = System.Windows.Visibility.Collapsed;
this.XamSparkline1.LowMarkerVisibility = System.Windows.Visibility.Collapsed;
this.XamSparkline1.HighMarkerVisibility = System.Windows.Visibility.Collapsed;
this.XamSparkline1.FirstMarkerVisibility = System.Windows.Visibility.Visible;
this.XamSparkline1.LastMarkerVisibility = System.Windows.Visibility.Visible;
this.XamSparkline1.NegativeMarkerVisibility = System.Windows.Visibility.Visible;

In Visual Basic:

Me.XamSparkline1.MarkerVisibility = System.Windows.Visibility.Collapsed
Me.XamSparkline1.LowMarkerVisibility = System.Windows.Visibility.Collapsed
Me.XamSparkline1.HighMarkerVisibility = System.Windows.Visibility.Collapsed
Me.XamSparkline1.FirstMarkerVisibility = System.Windows.Visibility.Visible
Me.XamSparkline1.LastMarkerVisibility = System.Windows.Visibility.Visible
Me.XamSparkline1.NegativeMarkerVisibility = System.Windows.Visibility.Visible

Related Content

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides an overview of the XamSparkline control, its benefits, and the supported chart types.

This topic provides an overview of the possible ways to configure the XamSparkline control. Links to the detailed configurations (available in separate topics) are provided as well.

This topic demonstrates, with code examples, how to configure and customize the markers for XamSparkline control.

This topic explains the featured properties of the XamSparkline control.