{ "cells": [ { "cell_type": "markdown", "id": "63396492-2899-4862-8cfb-84e812a844cc", "metadata": {}, "source": [ "# Parameter `base` of the Waterfall Plot" ] }, { "cell_type": "code", "execution_count": 1, "id": "b1b75d26-0fde-4591-af27-677b5d807b5f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%useLatestDescriptors\n", "%use lets-plot" ] }, { "cell_type": "code", "execution_count": 2, "id": "7137dd20-92ce-4b54-87d1-a1088285f1d0", "metadata": {}, "outputs": [], "source": [ "val dataMap = mapOf(\n", " \"Accounts\" to listOf(\"Product revenue\", \"Services revenue\", \"Fixed costs\", \"Variable costs\"),\n", " \"Values\" to listOf(830_000, 290_000, -360_000, -150_000),\n", ")" ] }, { "cell_type": "markdown", "id": "1f861d4a-b5df-429e-b4e0-a2a925c4cb28", "metadata": {}, "source": [ "## Default View" ] }, { "cell_type": "code", "execution_count": 3, "id": "201f8210-dfc1-4df2-b1eb-3e6c5cc1a92b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "waterfallPlot(dataMap, \"Accounts\", \"Values\", hline = elementLine()) + themeMinimal()" ] }, { "cell_type": "markdown", "id": "0f428414-25a3-49ec-b358-b04c89c80586", "metadata": {}, "source": [ "## Change Base" ] }, { "cell_type": "code", "execution_count": 4, "id": "30a03d80-e4c6-4e42-8467-a4f3e1e33778", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "val prevPeriodTotal = 400_000\n", "waterfallPlot(dataMap, \"Accounts\", \"Values\", base = prevPeriodTotal, hline = elementLine()) + themeMinimal()" ] } ], "metadata": { "kernelspec": { "display_name": "Kotlin", "language": "kotlin", "name": "kotlin" }, "language_info": { "codemirror_mode": "text/x-kotlin", "file_extension": ".kt", "mimetype": "text/x-kotlin", "name": "kotlin", "nbconvert_exporter": "", "pygments_lexer": "kotlin", "version": "1.9.23" } }, "nbformat": 4, "nbformat_minor": 5 }