[]
        
(Showing Draft Content)

Sparkline

Sparklines are the miniature charts visually representing a series of values to show trends such as periodic fluctuations, or to highlight maximum or minimum values of the data series. In grids, sparklines are specially useful as they easily fit in a single cell and can help identify the data patterns at a glance.


Add sparkline


FlexGrid for WinForms lets you display sparklines in columns by setting ShowSparkline property of the Column class to true. You can also set the type of sparkline using SparklineType property of the Sparkline class. FlexGrid supports three types of sparklines which are:

  • Line: Similar to line chart, line sparkline indicates change in values over a period of time with the help of a line.

  • Column: Similar to column charts, column sparkline uses vertical columns to demonstrate pattern across different categories.

  • Win/Loss: Similar to column sparkline, win/loss sparkline uses vertical columns to represent values. However, it does not indicate the magnitude and is generally used to indicate the binary data.

To display the data markers on sparkline, you can set the ShowMarkers property to true. The Sparkline class also provides properties to highlight the first, last, highest, lowest or negative data points by displaying them in different format. You can even style the sparklines using the Styles property.


Below code shows how to add sparkline to the WinForms FlexGrid columns.


// Set properties to display WinLoss Sparkline
   c1FlexGrid1.Cols[2].ShowSparkline = true;
c1FlexGrid1.Cols[2].Sparkline.SparklineType = SparklineType.WinLoss;
c1FlexGrid1.Cols[2].Sparkline.Styles.SeriesColor = Color.Green;
c1FlexGrid1.Cols[2].Sparkline.ShowNegative = true;
' Set properties to display WinLoss Sparkline
    c1FlexGrid1.Cols(2).ShowSparkline = True
c1FlexGrid1.Cols(2).Sparkline.SparklineType = SparklineType.WinLoss
c1FlexGrid1.Cols(2).Sparkline.Styles.SeriesColor = Color.Green
c1FlexGrid1.Cols(2).Sparkline.ShowNegative = True      

See Also

Documentation


Editors