Part 4: Add a line chart
As a representative of Buttercup Games, you need to present a breakdown of the store's purchase trends. In Splunk Dashboard Studio, you can add a line chart visualization to showcase trends. You will create a line chart that demonstrates purchase trends over time for different game categories.
- Select the add chart icon () in the editing toolbar, and then select Line.
- In the Search section of the Select data source panel, select + Create search.
- Name the data source Purchase Trends by Category.
- Add your search. For this tutorial, copy and paste the following search into the SPL query field:
index=main sourcetype=access_* status=200 action=purchase categoryId!=NULL | fields _time categoryId clientip | timechart count by categoryId
This creates a chart where all purchases within each game category are added up and shown as a line chart. The x-axis represents time and all the lines demonstrating trends for each individual game category are overlaid on the same line chart.
- Select Apply & Close. At this point, you've created a new data source and assigned it to a line chart.
- Select the line chart and title it Purchase Trends by Category.
- In the Color and style section of the Configuration panel, change the Background to transparent.
- In the Legend section of the Configuration panel, select Top from the Legend display drop-down menu.
- In the X-axis grid and labels section of the Configuration panel, turn off Axis title.
- In the Y-axis grid and labels section of the Configuration panel, title the Y-axis Purchases.
- Move and resize your line chart to center it on the top right rectangle.
After completing Part 4, your line chart looks similar to the following:
Next step
You've completed Part 4 of the Splunk Dashboard Studio tutorial and your dashboard has a line chart. Next, you'll show total revenue from Buttercup Games by adding a single value visualization. Continue to Part 5: Add a single value visualization.
Part 3: Add a table with column formatting | Part 5: Add a single value visualization |
This documentation applies to the following versions of Splunk® Enterprise: 9.1.0, 9.1.1, 9.1.2, 9.1.3, 9.1.4, 9.1.5, 9.1.6, 9.1.7, 9.2.0, 9.2.1, 9.2.2, 9.2.3, 9.2.4, 9.3.0, 9.3.1, 9.3.2, 9.4.0
Feedback submitted, thanks!