locked
Sparkline column Chart in a cell RRS feed

  • Question

  • Hi,

    I'm looking for adding a chart(Spartkline column) in a cell of a worksheet, gone through the api explorer but couldn't find any help. I would appreciate if anybody out there guide me on this.

    Below is the sample of what i'm look for.

    Just to mention, that i'm working latest officjs https://github.com/OfficeDev/office-js-docs/tree/master/excel

    the application is a store app which has a task pane.

    thanks
    noor syed




    Tuesday, May 3, 2016 2:54 PM

Answers

  • Hi noor,

    I think there is no office add in api to achieve this requirement, if this is a new feature you want to include in the future version of Office add in, I suggest you submit a feedback in the link below:

    http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 6, 2016 1:41 AM

All replies

  • Hi noor,

    >>I'm looking for adding a chart(Spartkline column) in a cell of a worksheet

    For adding a Spartkline column chart, you could use SparklineGroups.Add. Here is a simple code:

    Sub Chart()
    Range("$A$1:$A$4").SparklineGroups.Add Type:=xlSparkColumn, SourceData:= _
     "Sheet1!B1:E4"
    End Sub
    

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, May 4, 2016 1:33 AM
  • Try this:

    using Spire.Xls;
    
    namespace SparklineChart
    {
        class Program
        {
            static void Main(string[] args)
            {
                Workbook wb = new Workbook();
                wb.LoadFromFile("sample.xlsx");
                Worksheet ws = wb.Worksheets[0];
    
                SparklineGroup sparklineGroup = ws.SparklineGroups.AddGroup(SparklineType.Column);
                SparklineCollection sparklines = sparklineGroup.Add();
                sparklines.Add(ws["B2:D2"], ws["E2"]);
                sparklines.Add(ws["B3:D3"], ws["E3"]);
                sparklines.Add(ws["B4:D4"], ws["E4"]);
                sparklines.Add(ws["B5:D5"], ws["E5"]);
    
                wb.SaveToFile("SparklineChart.xlsx", ExcelVersion.Version2010);
            }
        }
    }


    Wednesday, May 4, 2016 2:07 AM
  • HI Edward and Jacky, 

    I'm sorry i didn't mention that i'm working on officerjs for office store app with task pane.

    https://github.com/OfficeDev/office-js-docs/tree/master/excel

    would appreciate if you could help in that area.

    thanks
    noor


    • Edited by noor syed Thursday, May 5, 2016 10:31 AM
    Thursday, May 5, 2016 10:28 AM
  • Hi noor,

    I think there is no office add in api to achieve this requirement, if this is a new feature you want to include in the future version of Office add in, I suggest you submit a feedback in the link below:

    http://officespdev.uservoice.com

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 6, 2016 1:41 AM