Charts

The Encodian population engine enables JSON data to be manipulated to produce charts. 

The article provides detailed examples for creating the following charts.

Pie Chart

Scatter Graph

This is just a showcase of the functionality. If a chart you would like to use is missing please contact us via the usual support channels and if it is possible we will advise on the syntax. 

 

Pie Chart

Example JSON data:

{
"Manager": [
   {
     "Name": "Steve",
     "Contract": [
       {"Client": "PulsePoint Technologies", "Price": "10000"},
       {"Client": "SwiftSpark Innovations", "Price": "5000"}
     ]},
   {
     "Name": "Caroline",
     "Contract": [
       {"Client": "Everglow Enterprises", "Price": "60000"},
       {"Client": "Alpha Catalysts", "Price": "1000"}
     ]},
   {
     "Name": "Adam",
     "Contract": [
       {"Client": "AlphaLink Dynamics", "Price": "20000"},
       {"Client": "OptiGlobe Solutions", "Price": "10000"}
     ]}
  ]}

For this example we will show a pie chart with the contract prices summed for the individual managers. 

Add a Pie Chart to your document and then configure it as follows:

1.  <<foreach [in  Manager]>> <<x [Name]>>

Please note this doesn't need a closing tag.

2. <<y [Contract.Sum(c => c.Price)]>>

This uses enumeration to get the total of each managers prices

This generates the following output:

Scatter Graph

Example JSON data

{
"Sales": [
{"Item": "Table", "SalePrice": 1500, "Month": "06"},
{"Item": "Chair", "SalePrice": 500, "Month": "01"},
{"Item": "Sofa", "SalePrice": 5000, "Month": "02"},
{"Item": "Table", "SalePrice": 200, "Month": "04"},
{"Item": "Bed", "SalePrice": 2000, "Month": "02"},
{"Item": "Chair", "SalePrice": 2000, "Month": "05"}
]
}

For this example a scatter chart will be used to show summed sales across months. 

Add a Scatter Chart to your document and then configure it as follows:

1. <<foreach [in Sales.GroupBy(c=> c.Month)]>>

Using enumeration this groups the data by the Month number

2.  <<x [Key]>><<y [Sum(c =>c.SalePrice)]>>

The sales prices of each month are summed together. 

This generates the following output:

 

 

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk