Chart view
The Chart view draws a chart from an array of objects, for example the number of orders per status or the price of each item over time. It works on JSON files and on NDJSON files, where each record is a row.
Select Chart in the view switcher. The chart uses the same array as the Table view: the document root, or the array you chose with View Array as Table. When it uses an array inside the document, the chart reads Chart of followed by its path; select the × to return to the root.
Choose the data
Section titled “Choose the data”The chart reads up to 5,000 rows, spread evenly over the whole array from the first row to the last. A longer array is sampled, and the chart says so, for example “5,000 of 2,000,000 rows sampled”. The table’s filters and sort do not apply to the chart.
The fields you can pick are the keys of the first 50 rows, as in the Table view. Y Axis and other numeric fields offer only the columns whose values are numbers in those rows.
When you open the view, JSON Digger picks a starting chart from the columns, usually a bar chart of a column such as a status. Change any field to chart something else.
Chart types
Section titled “Chart types”Choose a Type:
| Type | Fields | Shows |
|---|---|---|
| Bar | X Axis, Y Axis, Aggregate | One bar per value of X, with the number of rows or a total of Y |
| Pie | Labels, Values, Aggregate | One slice per value of Labels. Negative values count as 0. |
| Line | X Axis, Y Axis | One point per row, in the array’s order. X Axis can be Row index. |
| Scatter | X (numeric), Y (numeric) | One dot per row that has a number in both fields |
Bar and line charts start their Y axis at 0, so negative values are not visible.
Aggregation
Section titled “Aggregation”In bar and pie charts, the rows are grouped by the value of X. Set Y Axis (or Values) to Count to count the rows in each group, or pick a numeric column and an Aggregate: Sum, Average, Minimum, or Maximum. Hover over a bar or slice to see its value and its number of rows.
- Many groups: a bar chart shows the 20 largest groups and a pie chart the 10 largest. The rest are combined into one other bar or slice, and a note says how many, for example “Grouped by country: top 20 shown, 35 more in other”.
- Numeric X: when X is a numeric column with more than 20 distinct values, the rows are grouped into about 20 ranges instead, labeled like
100 – 200. A note shows the number of ranges. - Missing values: rows without a value for X, or with
null, form a (null) group.
Export a chart
Section titled “Export a chart”Select Export SVG or Export PNG below the chart and choose where to save it. The image keeps the theme’s colors on a solid background, and a PNG is twice the size shown on screen. A pie chart’s legend is not part of the image.
You can also press Ctrl+Shift+E (Capture View (SVG/PNG)…); see Capture the view.