Wijmo UI for the Web
Use In-Line Data
Wijmo User Guide > Widgets > SparkLine > SparkLine How To > Use In-Line Data

Building on the Quick Start example, you can move the data from the script to the markup, to provide data in line.

  1. In the <head> section of your HTML file, replace the script that includes the document ready function with this one, which does not contain data. 
    Script
    Copy Code
    <script id="scriptInit" type="text/javascript">
    require(["wijmo.wijsparkline"], function () {
    $(document).ready(function () {
        $("#wijsparkline").wijsparkline({
            type: "area"
        });
    });
    });
    </script>
  2. In the <body> section of your HTML file, the <div> tag is changed to contain the data in line.
    Markup
    Copy Code
    <div id="wijsparkline" style="height:50px;width:200px">
    33, 11, 15, 26, 16, 27, 37, -13, 8, -8, -3, 17, 0, 22, -13, -29, 19, 8
    <div/> 
  3. Save your HTML file and open it in a browser. The widget appears like the one in the live widget below, the same as the quick start. Only the location of the data is changed.

See Also

Reference

Widgets