type of sparkline in the active cell

Posted by: red60man on 8 September 2017, 2:57 pm EST

  • Posted 8 September 2017, 2:57 pm EST

    i need to find out the sparkline type (Line, column, win loss) present in the active cell.

    fpSpread1.ActiveSheet.ActiveCell.Sparkline.ToString()
    just gives me the "FarPoint.Win.Spread.Sparkline"  .....it doesn't give
    the type of sparkline

    is there a way to find out the type of sparkline in the activecell

     

    Thanks

    Red

     

  • Replied 8 September 2017, 2:57 pm EST

    Hi,

    The sparkline type is not exposed from the Sparkline class but you can get the type from the Renderer property of the ISparklineGroup:

            ISparklineGroup spGroup = null;
            ISparkline spLine = null;
            FpSpread1.ActiveSheet.SparklineContainer.GetSparkline(FpSpread1.ActiveSheet.ActiveCell.Row.Index, FpSpread1.ActiveSheet.ActiveCell.Column.Index, out spGroup, out spLine);
            if (spGroup != null)
            {
              ISparklineRenderer renderer = spGroup.Renderer;
              MessageBox.Show(renderer.GetType().ToString());
            }

    The types of built-in ISparklineRenderers are LineSparklineRenderer, ColumnSparklineRenderer, and WinLossSparklineRenderer.

    Hope that help!

  • Replied 8 September 2017, 2:57 pm EST

    Thank you
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels