Is it possible to fetch the number of items with a certain property against the property from a CSVLayer in ArcGIS Javascript API?
This is the csv file.
My intent is to
- Category 0 - 1
- Category 1 - 0
- Category 2 - 1
- Category 3 - 0
if we are showing Legends from the "Category" property and all the documents are in the view.
Also is it possible to filter the items based on the same property?
Also is it possible to show the details in a Pie Chart?
You can use client side queries to retrieve information about the visible data. Using the CSVLayer and SceneView in the Codepen, the following code counts the number of features where
Category = 0
orCategory = 2
:The following Codepen runs this code whenever the view changes and prints a new line of results to the console: https://codepen.io/arnofiva/pen/b835cc7b626965332e802fd3385056e9
To see other query options or how to show the results as pie chart, checkout the following resources: