<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Documentation – Sparklines in Aspose.Cells for Go via C&#43;&#43;</title>
    <link>https://docs.aspose.com/cells/go-cpp/creating-sparklines/</link>
    <description>Recent content in Sparklines in Aspose.Cells for Go via C&#43;&#43; on Documentation</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    
	  <atom:link href="https://docs.aspose.com/cells/go-cpp/creating-sparklines/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Gocpp: Using Sparklines and Settings 3D Format with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/using-sparklines-and-settings-3d-format/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/using-sparklines-and-settings-3d-format/</guid>
      <description>
        
        
        &lt;h2 id=&#34;using-sparklines&#34;&gt;&lt;strong&gt;Using Sparklines&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Microsoft Excel 2010 can analyze information in more ways than ever before. It allows users to track and highlight important data trends with new data analysis and visualization tools. Sparklines are mini‑charts that you can place inside cells so that you can view data and a chart on the same table. When sparklines are used properly, data analysis is quicker and more to the point. They also provide a simple view of information, avoiding overcrowded worksheets with a lot of busy charts.&lt;/p&gt;
&lt;p&gt;Aspose.Cells provides an API for manipulating sparklines in spreadsheets.&lt;/p&gt;
&lt;h3 id=&#34;sparklines-in-microsoft-excel&#34;&gt;&lt;strong&gt;Sparklines in Microsoft Excel&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;To insert sparklines in Microsoft Excel 2010:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the cells where you want the sparklines to appear. To make them easy to view, select cells at the side of the data.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Insert&lt;/strong&gt; on the ribbon and then choose &lt;strong&gt;Column&lt;/strong&gt; in the &lt;strong&gt;Sparklines&lt;/strong&gt; group.&lt;/li&gt;
&lt;li&gt;Select or enter the range of cells in the worksheet that contain the source data. The charts will appear.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Sparklines help you to see trends, for example, the win or loss record for a softball league. Sparklines can even sum up the entire season of each team in the league.&lt;/p&gt;
&lt;h3 id=&#34;sparklines-using-asposecells&#34;&gt;&lt;strong&gt;Sparklines using Aspose.Cells&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;Developers can create, delete, or read sparklines (in the template file) using the API provided by Aspose.Cells. The classes that manage sparklines are contained in the &lt;a href=&#34;https://reference.aspose.com/cells/go-cpp/aspose.cells.charts/&#34;&gt;Aspose.Cells.Charts&lt;/a&gt; namespace, so you need to import this namespace before using these features.&lt;/p&gt;
&lt;p&gt;By adding custom graphics for a given data range, developers have the freedom to add different types of tiny charts to selected cell areas.&lt;/p&gt;
&lt;p&gt;The example below demonstrates the Sparklines feature. The example shows how to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open a simple template file.&lt;/li&gt;
&lt;li&gt;Read sparklines information for a worksheet.&lt;/li&gt;
&lt;li&gt;Add new sparklines for a given data range to a cell area.&lt;/li&gt;
&lt;li&gt;Save the Excel file to disk.&lt;/li&gt;
&lt;/ol&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-UsingSparklinesAndSettings3dFormat.go&#34;&gt;&lt;/script&gt;

&lt;h2 id=&#34;setting-3d-format&#34;&gt;&lt;strong&gt;Setting 3D Format&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;You might need 3D charting styles to obtain the results required for your scenario. Aspose.Cells provides the relevant API to apply Microsoft Excel 2007 3D formatting.&lt;/p&gt;
&lt;p&gt;A complete example is given below to demonstrate how to create a chart and apply Microsoft Excel 2007 3D formatting. After executing the example code, a column chart (with 3D effects) will be added to the worksheet.&lt;/p&gt;
&lt;p&gt;&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-UsingSparklinesAndSettings3dFormat-1.go&#34;&gt;&lt;/script&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;
&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Gocpp: Convert Sparkline to Image and HTML in Aspose.Cells for Go via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/convert-sparkline-to-image-and-html/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/convert-sparkline-to-image-and-html/</guid>
      <description>
        
        
        

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

Sparklines are miniature charts placed inside worksheet cells. Aspose.Cells lets you extract each sparkline as a standalone image (for embedding into another cell or an external report) and also export the entire sparkline-rich worksheet to HTML for browser-based distribution. The &lt;code&gt;Cell.EmbeddedImage&lt;/code&gt; property used in this article is available in &lt;strong&gt;Aspose.Cells 26.5 and later&lt;/strong&gt;.
&lt;/div&gt;

&lt;h2 id=&#34;introduction&#34;&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Sparklines are a compact way to visualize trends directly inside a worksheet. While Excel users see them in place, many real-world scenarios require a sparkline to leave the cell — for example, to be embedded into a different cell as a static picture, attached to an automated email, or rendered as part of an HTML report published to the web.
Aspose.Cells supports both of these operations. The &lt;code&gt;Sparkline.ToImage&lt;/code&gt; method renders an individual sparkline to a &lt;code&gt;Vector&amp;lt;uint8_t&amp;gt;&lt;/code&gt; byte array, and the resulting bytes can be assigned to &lt;code&gt;Cell.EmbeddedImage&lt;/code&gt; so the picture is stored inside a single cell of the workbook. Separately, &lt;code&gt;HtmlSaveOptions&lt;/code&gt; lets you convert the entire workbook — sparklines and all — into a self-contained HTML file. This article walks through both workflows end to end.&lt;/p&gt;
&lt;h2 id=&#34;workflow-1--render-sparklines-to-images-and-embed-them-into-cells&#34;&gt;&lt;strong&gt;Workflow 1 — Render Sparklines to Images and Embed Them into Cells&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;In this workflow you will build a worksheet that contains a small range of source values, attach three different sparkline groups (Line, Column, and Stacked/Win-Loss) to that range, render each group as a PNG, and write those PNG bytes into adjacent cells as embedded images. The final result is a single &lt;code&gt;.xlsx&lt;/code&gt; file that contains both the live sparklines and their rendered picture counterparts.&lt;/p&gt;
&lt;h3 id=&#34;step-by-step-instructions&#34;&gt;&lt;strong&gt;Step-by-Step Instructions&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Define a working directory and ensure it exists on disk.&lt;/li&gt;
&lt;li&gt;Create a new &lt;code&gt;Workbook&lt;/code&gt; and obtain a reference to the first &lt;code&gt;Worksheet&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Populate cells &lt;code&gt;A1&lt;/code&gt; through &lt;code&gt;E1&lt;/code&gt; with five sample numeric values (for example, daily sales or temperature readings).&lt;/li&gt;
&lt;li&gt;Add three &lt;code&gt;SparklineGroup&lt;/code&gt; objects to the worksheet by calling &lt;code&gt;worksheet.SparklineGroups.Add(...)&lt;/code&gt;:
&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;SparklineType.Line&lt;/code&gt; group anchored at &lt;code&gt;F1&lt;/code&gt;, with data range &lt;code&gt;A1:E1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;SparklineType.Column&lt;/code&gt; group anchored at &lt;code&gt;G1&lt;/code&gt;, with data range &lt;code&gt;A1:E1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;SparklineType.Stacked&lt;/code&gt; (win/loss) group anchored at &lt;code&gt;H1&lt;/code&gt;, with data range &lt;code&gt;A1:E1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Build an &lt;code&gt;ImageOrPrintOptions&lt;/code&gt; instance and set its &lt;code&gt;ImageType&lt;/code&gt; to &lt;code&gt;ImageType.Png&lt;/code&gt; so each sparkline is rendered as a transparent PNG.&lt;/li&gt;
&lt;li&gt;Save the workbook as &lt;code&gt;output_with_sparklines.xlsx&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-ConvertSparklineToImageAndHtml.go&#34;&gt;&lt;/script&gt;

&lt;p&gt;The code above produces a workbook where each visual representation of a sparkline is duplicated in two forms: the live, native sparkline anchored at row 1, and a static PNG picture embedded directly into a neighboring cell on row 2. Because the pictures live inside the file itself, the workbook remains a single self-contained artifact that can be emailed or archived without breaking the embedded image references. Render each sparkline group as a PNG — &lt;code&gt;Sparkline.ToImage(ImageOrPrintOptions)&lt;/code&gt; returns the picture bytes directly as a &lt;code&gt;Vector&amp;lt;uint8_t&amp;gt;&lt;/code&gt; — and assign the array to the &lt;code&gt;EmbeddedImage&lt;/code&gt; property of the target cell — the assignment is what makes the picture part of the cell&amp;rsquo;s stored contents.&lt;/p&gt;


&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

&lt;p&gt;Because each sparkline group is anchored to a single cell, you can address it through the indexer &lt;code&gt;group.Sparklines[0]&lt;/code&gt; instead of enumerating with &lt;code&gt;foreach&lt;/code&gt;. This keeps the rendering code short and matches the typical &amp;ldquo;one sparkline per anchor cell&amp;rdquo; pattern. Storing the picture bytes via &lt;code&gt;Cell.EmbeddedImage&lt;/code&gt; requires Aspose.Cells 26.5 or later.&lt;/p&gt;
&lt;h2 id=&#34;workflow-2--export-the-sparkline-worksheet-to-html&#34;&gt;&lt;strong&gt;Workflow 2 — Export the Sparkline Worksheet to HTML&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Once the workbook contains live sparklines (and optionally embedded picture counterparts), the entire worksheet can be published to the web by saving it as HTML. The &lt;code&gt;HtmlSaveOptions&lt;/code&gt; class exposes the knobs you need to control this export; in this workflow you will reuse the &lt;code&gt;output_with_sparklines.xlsx&lt;/code&gt; file produced by Workflow 1 and convert it to a clean, single-page HTML document.&lt;/p&gt;
&lt;h3 id=&#34;step-by-step-instructions&#34;&gt;&lt;strong&gt;Step-by-Step Instructions&lt;/strong&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Ensure the &lt;code&gt;output_with_sparklines.xlsx&lt;/code&gt; file produced by Workflow 1 is available on disk in your working directory.&lt;/li&gt;
&lt;li&gt;Load that file into a new &lt;code&gt;Workbook&lt;/code&gt; instance.&lt;/li&gt;
&lt;li&gt;Instantiate &lt;code&gt;HtmlSaveOptions&lt;/code&gt; and set its &lt;code&gt;ExportActiveWorksheetOnly&lt;/code&gt; property to &lt;code&gt;true&lt;/code&gt; so the resulting HTML file contains only the active worksheet rather than the entire workbook.&lt;/li&gt;
&lt;li&gt;Call &lt;code&gt;workbook.Save(&amp;quot;sparklines.html&amp;quot;, htmlOptions)&lt;/code&gt; to write the HTML output to disk.&lt;/li&gt;
&lt;/ol&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-ConvertSparklineToImageAndHtml-1.go&#34;&gt;&lt;/script&gt;
&lt;p&gt;The code above takes the sparkline-rich workbook from Workflow 1 and turns it into a portable HTML file. Sparklines are preserved as inline SVG or PNG renderings inside the generated HTML, depending on the export mode, so end users can view the trends in any modern browser without needing Excel installed. By setting &lt;code&gt;ExportActiveWorksheetOnly&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, you avoid accidentally publishing hidden sheets or auxiliary data — only the worksheet currently visible to the user is exported.&lt;/p&gt;

&lt;/div&gt;



&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

&lt;p&gt;The &lt;code&gt;HtmlSaveOptions&lt;/code&gt; class offers additional properties for fine-tuning the output, such as &lt;code&gt;ExportHiddenWorksheet&lt;/code&gt;, &lt;code&gt;ExportImagesAsBase64&lt;/code&gt;, and &lt;code&gt;Encoding&lt;/code&gt;. Adjust these as needed for your deployment target.&lt;/p&gt;
&lt;h2 id=&#34;api-summary&#34;&gt;&lt;strong&gt;API Summary&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;The workflows above rely on a small set of Aspose.Cells APIs working together.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SparklineGroup&lt;/code&gt; and the collection accessor &lt;code&gt;worksheet.SparklineGroups&lt;/code&gt; are used to declare the type (Line, Column, Stacked), the data range, and the anchor cell for each sparkline group. In this article each group is anchored to a single cell, so the group is reached through &lt;code&gt;worksheet.SparklineGroups[i]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sparkline&lt;/code&gt; and the indexer &lt;code&gt;group.Sparklines[0]&lt;/code&gt; return the individual sparkline inside a group. Because every group in the example contains exactly one sparkline, no &lt;code&gt;foreach&lt;/code&gt; loop is required.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Sparkline.ToImage(ImageOrPrintOptions)&lt;/code&gt; is the rendering method that returns a picture of the sparkline directly as a &lt;code&gt;Vector&amp;lt;uint8_t&amp;gt;&lt;/code&gt; byte array.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HtmlSaveOptions.ExportActiveWorksheetOnly&lt;/code&gt; (a &lt;code&gt;bool&lt;/code&gt;) restricts HTML export to the active worksheet. It is one of the most commonly used properties on &lt;code&gt;HtmlSaveOptions&lt;/code&gt; when generating single-page reports.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ImageOrPrintOptions.ImageType&lt;/code&gt; lives in the &lt;code&gt;Aspose.Cells.Drawing&lt;/code&gt; namespace and selects the picture format (for example, &lt;code&gt;ImageType.Png&lt;/code&gt;) used when rendering with &lt;code&gt;ToImage&lt;/code&gt; and when printing worksheets to images.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;related-articles&#34;&gt;&lt;strong&gt;Related Articles&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.aspose.com/cells/cells/go-cpp/inserting-an-image-into-a-cell/&#34;&gt;Inserting an Image into a Cell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;button class=&#34;floating-button&#34; id=&#34;openModalBtn&#34;&gt;AI Document Assistant&lt;/button&gt;

&lt;div class=&#34;modal&#34; id=&#34;modal&#34;&gt;
    &lt;button class=&#34;close-btn&#34; id=&#34;closeModalBtn&#34;&gt;Close&lt;/button&gt;
    &lt;iframe src=&#34;https://products.aspose.ai/cells/chat/document/go?source=docs&#34; frameborder=&#34;0&#34; width=&#34;100%&#34; height=&#34;100%&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;style&gt;
    .floating-button {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #007bff;
        color: white;
        border: none;
        padding: 15px 20px;
        border-radius: 50px;
        cursor: pointer;
        font-size: 16px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 999;
    }

    .modal {
        display: none;
        position: fixed;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        padding: 20px;
        box-sizing: border-box;
    }

    .close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: #f44336;
        color: white;
        border: none;
        padding: 5px 10px;
        cursor: pointer;
        font-size: 16px;
        border-radius: 3px;
    }
&lt;/style&gt;

&lt;script&gt;
    const openModalBtn = document.getElementById(&#39;openModalBtn&#39;);
    const closeModalBtn = document.getElementById(&#39;closeModalBtn&#39;);
    const modal = document.getElementById(&#39;modal&#39;);

    openModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;block&#39;;
    });

    closeModalBtn.addEventListener(&#39;click&#39;, function() {
        modal.style.display = &#39;none&#39;;
    });

    window.addEventListener(&#39;click&#39;, function(event) {
        if (event.target === modal) {
            modal.style.display = &#39;none&#39;;
        }
    });
&lt;/script&gt;


      </description>
    </item>
    
    <item>
      <title>Gocpp: Copy Sparkline by Specifying Data Range and Location of Sparkline Group with Golang via C&#43;&#43;</title>
      <link>https://docs.aspose.com/cells/go-cpp/copy-sparkline-by-specifying-data-range-and-location-of-sparkline-group/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://docs.aspose.com/cells/go-cpp/copy-sparkline-by-specifying-data-range-and-location-of-sparkline-group/</guid>
      <description>
        
        
        

&lt;div class=&#34;alert alert-primary&#34; role=&#34;alert&#34;&gt;

Microsoft Excel allows you to copy a sparkline by specifying the data range and location of a sparkline group. Aspose.Cells supports this feature.
&lt;/div&gt;

&lt;p&gt;To copy a sparkline to other cells in Microsoft Excel:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the cell containing the sparkline.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Edit Data&lt;/strong&gt; from the &lt;strong&gt;Sparkline&lt;/strong&gt; section of the &lt;strong&gt;Design&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Edit Group Location &amp;amp; Data&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Specify the data range and location.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Aspose.Cells provides the &lt;code&gt;SparklineCollection.Add(dataRange, row, column)&lt;/code&gt; method to specify a sparkline group&amp;rsquo;s data range and location. The following sample code loads the source Excel file (as shown in the screenshot above), accesses the first sparkline group, and adds data ranges and locations to the sparkline group. Finally, it writes the output Excel file to disk, which is also shown in the screenshot above.&lt;/p&gt;
&lt;script type=&#34;application/javascript&#34; src=&#34;https://gist.github.com/aspose-cells-gists/b414abd53259bbc47d2c3c0fe985395b.js?file=Examples-Go-CPP-CopySparklineBySpecifyingDataRangeAndLocationOfSparklineGroup.go&#34;&gt;&lt;/script&gt;


      </description>
    </item>
    
  </channel>
</rss>
