Data storytelling - create a story
With data storytelling you can create a presentation based on the data in your app. You can take snapshots of selected visualizations and use them in your narrative together with text, shapes, and effects. You create slides and design the story with your particular audience in mind. In your narrative you focus on key elements and create a convincing story to make your message clear.
An additional, useful feature of data storytelling is that you can easily switch between a snapshot in the presentation and its context in the app. In the app context, you can make new selections and continue the analysis from where you left off in the presentation. After the analysis, you can resume the presentation.
This data storytelling example illustrates how you can create a Qlik Sense story using the Qlik Sense .NET SDK.
We recommend that you download and run the appropriate example before you continuing reading. The sample code for the data storytelling example is available on GitHub.
Source code found on GitHub (only in English)
Take a snapshot
Before you create your story you must take a snapshot. To take a snapshot, do the following:
-
Connect to Qlik Sense Desktop.
For more information, see Getting started with the Qlik Sense .NET SDK.
-
Go to the Dashboard sheet and get Sales per Region on the sheet.
var sheet = app.GetSheets().FirstOrDefault(sheet => sheet.MetaAttributes.Title.ToLower() == title.ToLower()); //Locate "Sales per Region" by comparing the title foreach (var cell in sheet.Cells) { var child = sheet.GetChild(cell.Name); if (child.GetLayout().As<VisualizationBaseLayout>().().Title == title) salesPerRegion = child; }
-
Take a snapshot.
// Take a snapshot of SalesPerRegion if (salesPerRegion != null) app.CreateSnapshot("SDK_SalesPerRegion", sheet.Id, salesPerRegion.Id);
Create a story
You can now create a short and simple story, where the focus is on creating a few slides with snapshots and titles. Do the following:
-
Create a new story and enter a title.
// 1 Create a new story var storyProps = new StoryProperties(); // 2 Enter the title storyProps.MetaDef.Title = "SDK Created - Three largest regions"; var story = app.CreateStory("ThreelargestregionsStory", storyProps);
-
Create a slide.
var slideProps = new SlideProperties(); var slide1 = story.CreateSlide("ThreelargestregionsSlide", slideProps);
-
Take snapshots and add them to the slide.
Locate “Top 5 Customers” by comparing the title foreach (var cell in sheet.Cells) { var child = sheet.GetChild(cell.Name); if (child.GetLayout().As<VisualizationBaseLayout>().Title == title) salesPerRegion = child; }
The story is complete.