{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/react-data-grid/sparklines-axis-types/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This section compares the different axis types that are available to all sparklines."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In order to select an appropriate sparkline axis type, it is important to consider the data the sparkline is displaying.\nThis ensures that X values are scaled correctly along the axis."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following axis types are available to all sparklines:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#category-axis"},"children":[{"type":"text","value":"Category Axis"}]},{"type":"text","value":" - data points are evenly spread along the axis."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#number-axis"},"children":[{"type":"text","value":"Number Axis"}]},{"type":"text","value":" - data is spaced based on the magnitude of the X values."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#time-axis"},"children":[{"type":"text","value":"Time Axis"}]},{"type":"text","value":" - data is spaced according to the time between data points."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{"className":["custom-block","note"]},"children":[{"type":"element","tagName":"div","properties":{"className":["custom-block-body"]},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Y values supplied in the sparkline data will always be plotted using the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#number-axis"},"children":[{"type":"text","value":"Number Axis"}]},{"type":"text","value":" on a continuous scale."}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Here's an illustration showing how sparklines can look visually different when different axis types are configured."}]},{"type":"element","tagName":"div","properties":{"style":"display: flex; justify-content: center;"},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"image-caption","properties":{"src":"resources/time-axis.png","alt":"Time axis","width":"250px","constrained":"true"},"children":[{"type":"text","value":"Time Axis"}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"image-caption","properties":{"src":"resources/category-axis.png","alt":"Category axis","width":"250px","constrained":"true"},"children":[{"type":"text","value":"Category Axis"}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Note that the same data is used for both sparklines."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"On the left, X values are plotted using a Time Axis, whereas on the right, X values are plotted using a Category Axis."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"h2","properties":{"id":"category-axis","style":"position:relative;"},"children":[{"type":"text","value":"Category Axis"},{"type":"element","tagName":"a","properties":{"href":"#category-axis","ariaLabel":"category axis permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Category Axis is the default axis. X values will be plotted on a band scale which means the data points\nwill be evenly spaced out along the axis making it ideal for small datasets with discrete values or\ncategories."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Category Axis is configured through the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#sparklineaxisoptions"},"children":[{"type":"text","value":"SparklineAxisOptions"}]},{"type":"text","value":" as follows:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        {\n            field: 'rateOfChange',\n            cellRenderer: 'agSparklineCellRenderer',\n            cellRendererParams: {\n                sparklineOptions: {\n                    axis: {\n                        // use Category Axis (Optional)\n                        type: 'category'\n                    }\n                }\n            },\n        },\n        // other column definitions ...\n    ],\n};\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the snippet above, the axis type is set to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'category'"}]},{"type":"text","value":" but this is optional as the axis uses the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'category'"}]},{"type":"text","value":" axis by default."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example below demonstrates the Category Axis used in an Area Sparkline. Note the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Rate Of Change"}]},{"type":"text","value":" column is mapped to data containing an "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-data/#array-of-tuples"},"children":[{"type":"text","value":"Array of Tuples"}]},{"type":"text","value":" of type "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"[string, number][]"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]},{"type":"text","value":" X values are evenly spaced across the axis using a fixed width between each data point."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]},{"type":"text","value":" X values are included in the tooltip."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Sparkline Category Axis","name":"sparkline-category-axis","type":"generated","options":"{ \"enterprise\": true, \"exampleHeight\": 585, \"modules\": [\"clientside\", \"sparklines\"] }"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"number-axis","style":"position:relative;"},"children":[{"type":"text","value":"Number Axis"},{"type":"element","tagName":"a","properties":{"href":"#number-axis","ariaLabel":"number axis permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Number Axis is used as a value axis. When the Number Axis is used, the distance between the data points\ndepends on the magnitude of the X values. X values must be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"number"}]},{"type":"text","value":" values as they are plotted on a continuous scale\nwith numeric intervals."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Number Axis is configured through the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#sparklineaxisoptions"},"children":[{"type":"text","value":"SparklineAxisOptions"}]},{"type":"text","value":" as follows:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        {\n            field: 'history',\n            cellRenderer: 'agSparklineCellRenderer',\n            cellRendererParams: {\n                sparklineOptions: {\n                    axis: {\n                        // use Number Axis\n                        type: 'number'\n                    }\n                }\n            },\n        },\n        // other column definitions ...\n    ],\n};\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the snippet above, the axis type is set to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'number'"}]},{"type":"text","value":" to select a Number Axis instead of the default\n"},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#category-axis"},"children":[{"type":"text","value":"Category Axis"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example below demonstrates the Number Axis used in an Area Sparkline. Note the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Rate Of Change"}]},{"type":"text","value":" column is mapped to data containing an "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-data/#array-of-tuples"},"children":[{"type":"text","value":"Array of Tuples"}]},{"type":"text","value":" of type "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"[number, number][]"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The numeric X values are placed and spread along the axis based on the magnitude of the value."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The numeric X values are included in the tooltip."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Sparkline Number Axis","name":"sparkline-number-axis","type":"generated","options":"{ \"enterprise\": true, \"exampleHeight\": 585, \"modules\": [\"clientside\", \"sparklines\"] }"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"time-axis","style":"position:relative;"},"children":[{"type":"text","value":"Time Axis"},{"type":"element","tagName":"a","properties":{"href":"#time-axis","ariaLabel":"time axis permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Time Axis is similar to the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#number-axis"},"children":[{"type":"text","value":"Number Axis"}]},{"type":"text","value":" in that it is also used\nto plot continuous values. X values can be "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"number"}]},{"type":"text","value":" or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Date"}]},{"type":"text","value":" objects, where "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"number"}]},{"type":"text","value":" values are interpreted as\ntimestamps derived from Unix time."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Time Axis is configured through the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#sparklineaxisoptions"},"children":[{"type":"text","value":"SparklineAxisOptions"}]},{"type":"text","value":" as follows:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\nconst gridOptions = {\n    columnDefs: [\n        {\n            field: 'rateOfChange',\n            cellRenderer: 'agSparklineCellRenderer',\n            cellRendererParams: {\n                sparklineOptions: {\n                    axis: {\n                        // use Time Axis\n                        type: 'time'\n                    }\n                }\n            },\n        },\n        // other column definitions ...\n    ],\n};\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the snippet above, the axis type is set to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'time'"}]},{"type":"text","value":" to select a Time Axis instead of the default\n"},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-axis-types/#category-axis"},"children":[{"type":"text","value":"Category Axis"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The example below demonstrates the Time Axis used in an Area Sparkline. Note the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Rate Of Change"}]},{"type":"text","value":" column is mapped to data containing an "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-data/#array-of-tuples"},"children":[{"type":"text","value":"Array of Tuples"}]},{"type":"text","value":" of type "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"[Date, number][]"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Date"}]},{"type":"text","value":" X values are placed in chronological order and spread along the axis based on the time between data points."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"Date"}]},{"type":"text","value":" X values are included in the tooltip."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Sparkline Time Axis","name":"sparkline-time-axis","type":"generated","options":"{ \"enterprise\": true, \"exampleHeight\": 585, \"modules\": [\"clientside\", \"sparklines\"] }"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"interfaces","style":"position:relative;"},"children":[{"type":"text","value":"Interfaces"},{"type":"element","tagName":"a","properties":{"href":"#interfaces","ariaLabel":"interfaces permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"h3","properties":{"id":"sparklineaxisoptions","style":"position:relative;"},"children":[{"type":"text","value":"SparklineAxisOptions"},{"type":"element","tagName":"a","properties":{"href":"#sparklineaxisoptions","ariaLabel":"sparklineaxisoptions permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"interface-documentation","properties":{"interfacename":"SparklineAxisOptions"},"children":[]}]},{"type":"element","tagName":"h2","properties":{"id":"next-up","style":"position:relative;"},"children":[{"type":"text","value":"Next Up"},{"type":"element","tagName":"a","properties":{"href":"#next-up","ariaLabel":"next up permalink","className":["docs-header-icon","after"]},"children":[{"type":"element","tagName":"svg","properties":{"id":"icon","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 32 32"},"children":[{"type":"element","tagName":"path","properties":{"d":"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"},"children":[]},{"type":"element","tagName":"path","properties":{"d":"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"},"children":[]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Continue to the next section to learn about: "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/sparklines-tooltips/"},"children":[{"type":"text","value":"Sparkline Tooltips"}]},{"type":"text","value":"."}]}]},"frontmatter":{"title":"Sparklines - Axis Types","version":null,"enterprise":true,"sideMenu":null,"description":null},"headings":[{"id":"category-axis","depth":2,"value":"Category Axis"},{"id":"number-axis","depth":2,"value":"Number Axis"},{"id":"time-axis","depth":2,"value":"Time Axis"},{"id":"interfaces","depth":2,"value":"Interfaces"},{"id":"sparklineaxisoptions","depth":3,"value":"SparklineAxisOptions"},{"id":"next-up","depth":2,"value":"Next Up"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"react","srcPath":"/sparklines-axis-types","pageName":"sparklines-axis-types"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}