To make charts appear on the dashboard, you have to configure them.
The configuration is done in the JSON file of
castor (e.g.data.json
),
it's a file with the same name as the data directory
(besides that directory), appended with .json
.
.
├── data
│ └── data.csv
└── data.json
The fields are set separated from the dashboard and its charts itself. They
form the documentFields
, corpusFields
and flyingFields
parts.
The whole dashboard configuration is done inside the dashboard
key of the
JSON configuration file.
Each chart has to be described in the dashboard.charts
key.
Below is an example with an histogram, and a pie chart. There are two types of
charts: histogram
and pie
.
{
"documentFields": {
"$fields.Themes" : {
"path" : "content.json.DiscESI",
"parseCSV" : ";",
"foreach": {
"trim": true
}
},
},
"dashboard" : {
"charts": [
{
"fields": ["content.json.Py"],
"type": "histogram"
},
{
"fields": ["fields.Themes"],
"type": "pie"
}
]
}
}
Tip: to make
documentFields
, andcharts
configuration easier, you can setaddlinkstojbj
totrue
. This will add links from charts, documents list, and document display to the JBJ Playground, filling theinput
area with JSON data useful to configuration.