{
    "componentChunkName": "component---src-templates-doc-page-jsx",
    "path": "/angular-data-grid/integrated-charts-range-chart/",
    "result": {"data":{"markdownRemark":{"htmlAst":{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This section covers how charts can be created directly from a range of selected cells."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Range charts provide a quick and easy way for users to create charts from inside the grid."}]},{"type":"element","tagName":"h2","properties":{"id":"creating-chart-ranges","style":"position:relative;"},"children":[{"type":"text","value":"Creating Chart Ranges"},{"type":"element","tagName":"a","properties":{"href":"#creating-chart-ranges","ariaLabel":"creating chart ranges 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":"When a chart is created from a selected range of cells in the grid, or via the charting API, the underlying cell range is replaced by a chart range."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To see how chart ranges are created from a cell range, using our "},{"type":"element","tagName":"a","properties":{"href":"../../example"},"children":[{"type":"text","value":"demo page"}]},{"type":"text","value":" do the following:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Select a "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/range-selection/"},"children":[{"type":"text","value":"Cell Range"}]},{"type":"text","value":" of numeric values in the grid by dragging the mouse over a range of cells."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Bring up the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/context-menu/"},"children":[{"type":"text","value":"Context Menu"}]},{"type":"text","value":" and select the desired chart type from the 'Chart Range' sub menu."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"gif","properties":{"src":"charting-ranges.gif","alt":"Charting Ranges"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"As illustrated above, the resulting chart range can subsequently be modified by dragging on the chart range handle, located in the bottom right corner of the chart range."}]},{"type":"element","tagName":"h2","properties":{"id":"category-and-series-ranges","style":"position:relative;"},"children":[{"type":"text","value":"Category and Series Ranges"},{"type":"element","tagName":"a","properties":{"href":"#category-and-series-ranges","ariaLabel":"category and series ranges 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":"There are two types of charting ranges: a category range that is highlighted in green and a series range that is highlighted in blue."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A category range can only contain cells from a single column, whereas a series range can contain values from many columns."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Chart ranges can be adjusted from within the grid by dragging on the chart range handle located at the bottom right of the series range. Both the category and series ranges are connected so when the chart range is dragged in an up or down direction they will be updated together."}]},{"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 chart range handle will only appear when all series columns are contiguous. However, it is possible to move columns around in the grid to connect the series range."}]}]}]},{"type":"element","tagName":"h2","properties":{"id":"defining-categories-and-series","style":"position:relative;"},"children":[{"type":"text","value":"Defining categories and series"},{"type":"element","tagName":"a","properties":{"href":"#defining-categories-and-series","ariaLabel":"defining categories and series 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":"There are several ways for columns to be classified as chart categories or series. Columns can be explicitly configured or left for the grid to infer the type based on the data contained in the cells."}]},{"type":"element","tagName":"div","properties":{"className":["custom-block","note","warning"]},"children":[{"type":"element","tagName":"div","properties":{"className":["custom-block-body"]},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"It is recommended that "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ColDef.chartDataType"}]},{"type":"text","value":" is specified rather than relying on the grid to infer the chart data type as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"null"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"undefined"}]},{"type":"text","value":" values can yield unexpected results. "}]}]}]},{"type":"element","tagName":"h3","properties":{"id":"coldefchartdatatype","style":"position:relative;"},"children":[{"type":"text","value":"ColDef.chartDataType"},{"type":"element","tagName":"a","properties":{"href":"#coldefchartdatatype","ariaLabel":"coldefchartdatatype 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":"When defining column definitions the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ColDef.chartDataType"}]},{"type":"text","value":" property can be used to define how the column should be considered within the context of charting."}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"api-documentation","properties":{"source":"column-properties/properties.json","section":"charts","names":"[\"chartDataType\"]"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Columns defined as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"excluded"}]},{"type":"text","value":" will not be included in charts or charting ranges."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following column definitions show how the different "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ColDef.chartDataType"}]},{"type":"text","value":" values are applied:"}]},{"type":"element","tagName":"snippet","properties":{},"children":[{"type":"text","value":"\n| const gridOptions = {\n|     columnDefs: [\n|         // 'category' columns\n|         { field: 'athlete', chartDataType: 'category' },\n|         { field: 'age', chartDataType: 'category' },\n|         { field: 'country' },\n| \n|         // 'excluded' from charts\n|         { field: 'date', chartDataType: 'excluded' },\n| \n|         // 'series' columns\n|         { field: 'gold', chartDataType: 'series' },\n|         { field: 'silver' }\n|     ]\n| }\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Note from the snippet above that the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"age"}]},{"type":"text","value":" column contains numbers but explicitly defined as a category, however as the\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"country"}]},{"type":"text","value":" column contains strings it can be inferred correctly as a category column without needing to specify the\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartDataType"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"See the "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/integrated-charts-time-series/"},"children":[{"type":"text","value":"Time Series"}]},{"type":"text","value":" section for details on the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'time'"}]},{"type":"text","value":" chart data type."}]},{"type":"element","tagName":"h3","properties":{"id":"inferred-by-the-grid","style":"position:relative;"},"children":[{"type":"text","value":"Inferred by the Grid"},{"type":"element","tagName":"a","properties":{"href":"#inferred-by-the-grid","ariaLabel":"inferred by the grid 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":"If none of the above "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"ColDef"}]},{"type":"text","value":" properties are present then the grid will infer the charting column type based on the data contained in the cells of the first row. Columns containing "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"number"}]},{"type":"text","value":" values will map to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'series'"}]},{"type":"text","value":" charting columns, and columns containing anything else will map to "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"'category'"}]},{"type":"text","value":"."}]},{"type":"element","tagName":"h3","properties":{"id":"example-defining-categories-and-series","style":"position:relative;"},"children":[{"type":"text","value":"Example: Defining categories and series"},{"type":"element","tagName":"a","properties":{"href":"#example-defining-categories-and-series","ariaLabel":"example defining categories and series 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 example below demonstrates the different ways columns can be defined for charting:"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Athlete"}]},{"type":"text","value":": defined as a 'category' as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartType='category'"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Age"}]},{"type":"text","value":": defined as a 'category' as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartType='category'"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Sport"}]},{"type":"text","value":": considered a 'category' as data is a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"string"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Year"}]},{"type":"text","value":": defined 'excluded' from charting as data is of type "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartType='excluded'"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Gold"}]},{"type":"text","value":": defined as 'series' as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartType='series'"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Silver"}]},{"type":"text","value":": defined as 'series' as "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"chartType='series'"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Bronze"}]},{"type":"text","value":": considered a 'series' as data is a "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"number"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"element","tagName":"div","properties":{},"children":[{"type":"element","tagName":"grid-example","properties":{"title":"Defining categories and series","name":"defining-categories-and-series","type":"generated","options":"{ \"exampleHeight\": 710, \"enterprise\": true, \"modules\": [\"clientside\", \"menu\", \"charts\", \"rowgrouping\"] }"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Cell ranges from which categories and data are taken will be highlighted on the grid. The highlight colours can be customised using the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--ag-range-selection-chart-category-background-color"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"--ag-range-selection-chart-background-color"}]},{"type":"text","value":" CSS variables. See "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"style.css"}]},{"type":"text","value":" in the example above."}]},{"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 the: "},{"type":"element","tagName":"a","properties":{"href":"/archive/29.3.3/integrated-charts-pivot-chart/"},"children":[{"type":"text","value":"Pivot Chart"}]},{"type":"text","value":"."}]}]},"frontmatter":{"title":"Range Chart","version":null,"enterprise":true,"sideMenu":null,"description":null},"headings":[{"id":"creating-chart-ranges","depth":2,"value":"Creating Chart Ranges"},{"id":"category-and-series-ranges","depth":2,"value":"Category and Series Ranges"},{"id":"defining-categories-and-series","depth":2,"value":"Defining categories and series"},{"id":"coldefchartdatatype","depth":3,"value":"ColDef.chartDataType"},{"id":"inferred-by-the-grid","depth":3,"value":"Inferred by the Grid"},{"id":"example-defining-categories-and-series","depth":3,"value":"Example: Defining categories and series"},{"id":"next-up","depth":2,"value":"Next Up"}]}},"pageContext":{"frameworks":["javascript","react","angular","vue"],"framework":"angular","srcPath":"/integrated-charts-range-chart","pageName":"integrated-charts-range-chart"}},
    "staticQueryHashes": ["1766026005","699667431","940729948"]}