Hello,
is it possible to create a popup chart in arcade, that shows X/Y coordinates, and not only Y numerical value for each X field.
Explanation : in the mapviewer, I can create a chart by referencing a numerical field and the corresponding numerical values :
Here you can see that the X values are correctly distributed along the X axis.
However, when trying to replicate such a chart in Arcade, I cannot get the same result. Here is my code :
var rels = FeatureSetByRelationshipName($feature, "mesures")
var attributes = {}
var fieldNames = [];
for (var rel in rels){
var X = text(rel.X)
attributes[X] = rel.Z
Push(fieldNames, rel.X)
};
return {
type: 'media',
title : 'title',
description : 'desc',
attributes : attributes, // replace this dictionary with your own key-value pairs,
mediaInfos: [{
type : 'linechart', //linechart | barchart | piechart | columnchart
//title : '',
//caption : '',
altText : '', //altText will be read by screen readers
value : {
fields: fieldNames, // choose what attributes to use in the chart
//normalizeField : '', // the name of the attribute to normalize by or value
}
}]
}
As far as I understand, I have to create a dictionary of key/value pairs for the attributes, and then a field name list for the fieldNames. Since the keys in my attributes' dictionary have to be a string, then the result (X values) is not distributed along the X axis, but only put side by side.
Is there a way to achieve that ?
I am having the same problem. My data has decimal values and I want to distribute them on a uniform scale on the x-axis. Additionally, it only shows the first 10 out of 20 data points. Have you been able to solve it in any way?
Hi,
no, I did not find any solution yet