Mastering Qlik Sense
by Ralf Becher, Karl Pover, Jason Michaelides, Dilyana Ivanova, David Alcobero, Martin Mahler, Juan Ignacio Vitantonio
Data preparation
To visualize data, you first need data. This is done by reading the returned qHyperCube and mapping the results to a convenient scope.data.
Furthermore, we will also leverage the same underlying dataset to return the names of the bar dimension values, which will then be used to populate the x-axis domain using scope.x.domain(scope.bars). Remember, the x-axis has an ordinal structure, so it can assume and work with discrete values.
To define the domain of the y-axis, we will assume 0 (zero) as the minimum value, and take the maximum available value from the data set, using d3.max. Bear in mind that you can also use layout.qHyperCube.qMeasureInfo[0].qMax to obtain the same amount directly from the qHyperCube.
The last bit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access