Hi team.
I use the example (with hierarchies) from:
https://www.flexmonster.com/doc/managing-data-presentation-json
I add 2 row in data of the sample:
<script type="text/javascript">
var jsonData = [
{
"Color": { type: "string" },
"Country": {
type: "level", hierarchy: "Geography",
level: "Country"
},
"State": {
type: "level", hierarchy: "Geography",
level: "State", parent: "Country"
},
"City": {
type: "level", hierarchy: "Geography",
parent: "State"
},
"Price": { type: "number" },
"Quantity": { type: "number" }
},
{
"Color": "green",
"Country": "Canada",
"State": "Ontario",
"City": "Toronto",
"Price": 174,
"Quantity": 22
},
{
"Color": "red",
"Country": "USA",
"State": "California",
"City": "Los Angeles",
"Price": 166,
"Quantity": 19
},
{
"Color": "blue",
"Country": "USA",
"State": "California",
"City": "Los Angeles 2",
"Price": 101,
"Quantity": 13
}
,
{
"Color": "sky",
"Country": "USA",
"State": "California",
"City": "Los Angeles 3",
"Price": 121,
"Quantity": 17
}
];
var slice = {
rows: [
{ uniqueName: "Color" },
{ uniqueName: "[Measures]" }
],
columns: [
{ uniqueName: "Country" }
],
measures: [
{ uniqueName: "Price", aggregation: "sum" }
]
};
var report = {
viewType: "grid",
dataSourceType: "json",
localSettingsUrl: "localizations/loc.xml",
licenseKey: "......",
jsPivotCreationCompleteHandler: function () {
flexmonster.addJSON(jsonData);
flexmonster.runQuery(slice);
}
};
flexmonster.embedPivotComponent(
"http://localhost:42993/flexmonster/",
"anyTestArea",
"100%",
"800",
report,
false,
FlexMonsterLabels
);
</script>
Version of Flexmonster is 2.2
In the data of this pivot table is not displayed Los Angeles 3 and Los Angeles 2.
In the hierarchy of a pivot table, those values are in another branch (Canada).
How can I make these values appear in USA/California?
Hello Vsevolod,
Thank you for the interest in our component. We recommend you to update to the version 2.3. This is our current major version and the data with the hierarchies is displayed correctly here. Our team is no longer delivering fixes for version 2.2. You can follow the migration guide. Please note, if the hierarchy Country
was named Geography
, you should define it as Geography
in slice
:
columns: [
{ uniqueName: "Geography" }
]
We would be grateful for your feedback.
Regards,
Tanya