Prerequisite: A chart CH01 has been created with two dimensions (Dimension01 and Dimension02) and one measure (Measure01). The chart has 2 as a handle.
The first step in this example is to check the number of values in the chart, by invoking the GetHyperCubeData method. The first 100 values (if any) should be returned (qHeight is 100).
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetHyperCubeData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 100,
"qWidth": 3
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "O"
},
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "O"
},
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "2",
"qNum": 2,
"qElemNumber": 1,
"qState": "O"
},
{
"qText": "2",
"qNum": 2,
"qElemNumber": 1,
"qState": "O"
},
{
"qText": "2",
"qNum": 2,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "O"
},
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "O"
},
{
"qText": "3",
"qNum": 3,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "4",
"qNum": 4,
"qElemNumber": 3,
"qState": "O"
},
{
"qText": "4",
"qNum": 4,
"qElemNumber": 3,
"qState": "O"
},
{
"qText": "4",
"qNum": 4,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "O"
},
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "O"
},
{
"qText": "5",
"qNum": 5,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "6",
"qNum": 6,
"qElemNumber": 5,
"qState": "O"
},
{
"qText": "6",
"qNum": 6,
"qElemNumber": 5,
"qState": "O"
},
{
"qText": "6",
"qNum": 6,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "7",
"qNum": 7,
"qElemNumber": 6,
"qState": "O"
},
{
"qText": "7",
"qNum": 7,
"qElemNumber": 6,
"qState": "O"
},
{
"qText": "7",
"qNum": 7,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "8",
"qNum": 8,
"qElemNumber": 7,
"qState": "O"
},
{
"qText": "8",
"qNum": 8,
"qElemNumber": 7,
"qState": "O"
},
{
"qText": "8",
"qNum": 8,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "9",
"qNum": 9,
"qElemNumber": 8,
"qState": "O"
},
{
"qText": "9",
"qNum": 9,
"qElemNumber": 8,
"qState": "O"
},
{
"qText": "9",
"qNum": 9,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "10",
"qNum": 10,
"qElemNumber": 9,
"qState": "O"
},
{
"qText": "10",
"qNum": 10,
"qElemNumber": 9,
"qState": "O"
},
{
"qText": "10",
"qNum": 10,
"qElemNumber": 0,
"qState": "L"
}
]
],
"qTails": [
{
"qUp": 0,
"qDown": 0
},
{
"qUp": 0,
"qDown": 0
}
],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 3,
"qHeight": 10
}
}
]
}
}
The chart contains 10 values (as returned by qArea and by the number of values in matrix qMatrix). The values are handled internally by the engine as a straight table.
GetHyperCubeData method.
2. Reduce the data of the chart so that it contains five values instead of 10. Let the engine decide the zoom factor (qZoomFactor is -1). The reduction mode is set to D1 . The paging is composed of the first three columns (qWidth is 3) and five lines (qHeight is 5) starting from the top left (qTop and qLeft set to 0).
The client sends:
{
"jsonrpc": "2.0",
"id": 6,
"method": "GetHyperCubeReducedData",
"handle": 2,
"params": [
"/qHyperCubeDef",
[
{
"qTop": 0,
"qLeft": 0,
"qHeight": 5,
"qWidth": 3
}
],
-1,
"D1"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"qDataPages": [
{
"qMatrix": [
[
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "L"
},
{
"qText": "1",
"qNum": 1,
"qElemNumber": 0,
"qState": "L"
},
{
"qNum": 1,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "L"
},
{
"qText": "3",
"qNum": 3,
"qElemNumber": 2,
"qState": "L"
},
{
"qNum": 2.9259926247077019,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "L"
},
{
"qText": "5",
"qNum": 5,
"qElemNumber": 4,
"qState": "L"
},
{
"qNum": 5.2485732698690972,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "7",
"qNum": 7,
"qElemNumber": 6,
"qState": "L"
},
{
"qText": "7",
"qNum": 7,
"qElemNumber": 6,
"qState": "L"
},
{
"qNum": 7.5711539150304921,
"qElemNumber": 0,
"qState": "L"
}
],
[
{
"qText": "9",
"qNum": 9,
"qElemNumber": 8,
"qState": "L"
},
{
"qText": "9",
"qNum": 9,
"qElemNumber": 8,
"qState": "L"
},
{
"qNum": 10,
"qElemNumber": 0,
"qState": "L"
}
]
],
"qTails": [],
"qArea": {
"qLeft": 0,
"qTop": 0,
"qWidth": 3,
"qHeight": 5
},
"qIsReduced": true
}
]
}
}
The chart was reduced (qIsReduced is set to true). After reduction, the chart contains five values (as returned by qArea and by the number of values in matrix qMatrix). The engine has chosen a zoom factor of 2.