Markers and Points

You can show markers or points in the sparkline graphs. You can specify different colors for low or negative, high, first, and last points.

The high point is the point for the largest value. The low point is the smallest value. The negative point represents negative values. The first point is the first point that is drawn on the graph. The last point is the last point that is drawn on the graph. The MarkersColor property only applies to the line sparkline type.

Using Code

This example specifies points and marker colors.

CS
Copy Code
GrapeCity.Xaml.SpreadSheet.Data.CellRange cellr = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 1, 5);
GrapeCity.Xaml.SpreadSheet.Data.SparklineSetting ex = new GrapeCity.Xaml.SpreadSheet.Data.SparklineSetting();
ex.AxisColor = Windows.UI.Colors.Magenta;
ex.LineWeight = 1;
ex.ShowMarkers = true;
ex.MarkersColor = Windows.UI.Colors.Lavender;
ex.ShowFirst = true;
ex.ShowHigh = true;
ex.ShowLast = true;
ex.ShowNegative = true;
ex.FirstMarkerColor = Windows.UI.Colors.Aqua;
ex.HighMarkerColor = Windows.UI.Colors.Crimson;
ex.LastMarkerColor = Windows.UI.Colors.GreenYellow;
ex.NegativeColor = Windows.UI.Colors.HotPink;
gcSpreadSheet1.Sheets[0].Cells[0, 0].Value = 2;
gcSpreadSheet1.Sheets[0].Cells[0, 1].Value = 5;
gcSpreadSheet1.Sheets[0].Cells[0, 2].Value = 4;
gcSpreadSheet1.Sheets[0].Cells[0, 3].Value = -1;
gcSpreadSheet1.Sheets[0].Cells[0, 4].Value = 3;
gcSpreadSheet1.Sheets[0].SetSparkline(0, 5, cellr, GrapeCity.Xaml.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Xaml.SpreadSheet.Data.SparklineType.Line, ex);
VB
Copy Code
Dim cellr As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 1, 5)
Dim ex As New GrapeCity.Xaml.SpreadSheet.Data.SparklineSetting()
ex.AxisColor = Windows.UI.Colors.Magenta
ex.LineWeight = 1
ex.ShowMarkers = True
ex.MarkersColor = Windows.UI.Colors.Lavender
ex.ShowFirst = True
ex.ShowHigh = True
ex.ShowLast = True
ex.ShowNegative = True
ex.FirstMarkerColor = Windows.UI.Colors.Aqua
ex.HighMarkerColor = Windows.UI.Colors.Crimson
ex.LastMarkerColor = Windows.UI.Colors.GreenYellow
ex.NegativeColor = Windows.UI.Colors.HotPink
gcSpreadSheet1.Sheets(0).Cells(0, 0).Value = 2
gcSpreadSheet1.Sheets(0).Cells(0, 1).Value = 5
gcSpreadSheet1.Sheets(0).Cells(0, 2).Value = 4
gcSpreadSheet1.Sheets(0).Cells(0, 3).Value = -1
gcSpreadSheet1.Sheets(0).Cells(0, 4).Value = 3
gcSpreadSheet1.Sheets(0).SetSparkline(0, 5, cellr, GrapeCity.Xaml.SpreadSheet.Data.DataOrientation.Horizontal, GrapeCity.Xaml.SpreadSheet.Data.SparklineType.Line, ex)
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.