1. Create a chart with 2 dimensions ( "qFieldDefs": [
"ProductName"
] and "qFieldDefs": [
"CategoryName"
]) and one measure ( "qDef": "ProductID"). The handle of the request is 1 because the CreateSessionObject method applies at the app level.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "",
"qType": "Chart"
},
"qHyperCubeDef": {
"qStateName": "$",
"qDimensions": [
{
"qLibraryId": "",
"qNullSuppression": false,
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"ProductName"
],
"qFieldLabels": [
""
]
}
},
{
"qLibraryId": "",
"qNullSuppression": false,
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"CategoryName"
],
"qFieldLabels": [
""
]
}
}
],
"qMeasures": [
{
"qLibraryId": "",
"qSortBy": {
"qSortByState": 0,
"qSortByFrequency": 0,
"qSortByNumeric": 0,
"qSortByAscii": 0,
"qSortByLoadOrder": 1,
"qSortByExpression": 0,
"qExpression": {
"qv": ""
}
},
"qDef": {
"qLabel": "",
"qDescription": "",
"qTags": [
"tags"
],
"qGrouping": "N",
"qDef": "ProductID"
}
}
],
"qInitialDataFetch": [
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
},
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
},
{
"qTop": 0,
"qLeft": 0,
"qHeight": 0,
"qWidth": 0
}
]
}
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The chart is created and has 2 as a handle.
2. Select the first value (qValues is [0]) in the dimension CategoryName (qDimNo is 1).
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "SelectHyperCubeValues",
"handle": 2,
"params": [
"/qHyperCubeDef",
1,
[
0
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The selection is successful.
3. Select the value that has the number 8 as (qValues is [8]) in the dimension ProductName (qDimNo is 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "SelectHyperCubeValues",
"handle": 2,
"params": [
"/qHyperCubeDef",
0,
[
8
],
false
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qSuccess": true
},
"change": [
2
]
}
The selection is successful.
4. Retrieve the values of the chart. It is enough to retrieve the first 10 values ( (in qPages) since the biggest element number that has been selected is 8.
The client sends:
{
"jsonrpc": "2.0",
"id": 4,
"method": "GetHyperCubeData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 10,
"qWidth": 2
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Lakkalikööri",
"qNum": "NaN",
"qElemNumber": 8,
"qState": "S"
},
{
"qText": "Beverages",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
]
],
"qTails": [
{
"qUp": 0,
"qDown": 0
},
{
"qUp": 0,
"qDown": 0
}
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 2,
"qHeight": 1
}
}
]
}
}
Beverages and Lakkalikööri are selected. Only the selected values are returned because the chart is not in selected mode. If the chart was in selected mode, selected and excluded values would be returned.
5. Clear the selections in the dimension 0 (ProductName).
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "ClearSelections",
"handle": 2,
"params": [
"/qHyperCubeDef",
[0]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {},
"change": [
2
]
}
Lakkalikööri is no longer selected.
6. Retrieve the data of the chart.qLeft is set to 0 and qWidth is set to 2 in order to retrieve the data from the first two dimensions.
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetHyperCubeData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 10,
"qWidth": 2
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "Chartreuse verte",
"qNum": "NaN",
"qElemNumber": 2,
"qState": "O"
},
{
"qText": "Beverages",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
],
[
{
"qText": "Lakkalikööri",
"qNum": "NaN",
"qElemNumber": 8,
"qState": "O"
},
{
"qText": "Beverages",
"qNum": "NaN",
"qElemNumber": 0,
"qState": "S"
}
]
],
"qTails": [
{
"qUp": 0,
"qDown": 0
},
{
"qUp": 0,
"qDown": 0
}
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 2,
"qHeight": 2
}
}
]
}
}
Beverages is selected but Lakkalikööri is no longer selected.