- Notifications
You must be signed in to change notification settings - Fork 80
docs(chart):add waterfall chart docs #1582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 29 commits
Commits
Show all changes
35 commits Select commit Hold shift + click to select a range
f320999 docs(chart):add waterfall chart docs
yanisslav 9ab468e Update components/chart/types/waterfall.md
yanisslav 9ce70c9 Update components/chart/types/waterfall.md
yanisslav 7b3d045 Update components/chart/types/waterfall.md
yanisslav 5a46306 Update components/chart/types/waterfall.md
yanisslav 2d2492b Update components/chart/types/waterfall.md
yanisslav 9d2bd97 Update components/chart/types/waterfall.md
yanisslav 0e8b7f4 Update components/chart/types/waterfall.md
yanisslav 3f7b53e Update components/chart/types/waterfall.md
yanisslav ac769e4 Update components/chart/types/waterfall.md
yanisslav fc34af8 Update components/chart/types/waterfall.md
yanisslav 9018abc Update components/chart/types/waterfall.md
yanisslav 94ca362 Update components/chart/types/waterfall.md
yanisslav f6c947d Update components/chart/types/waterfall.md
yanisslav 2bcd34d Update components/chart/types/waterfall.md
yanisslav 13d00b8 Update components/chart/types/waterfall.md
yanisslav 4f9f97c Update components/chart/types/waterfall.md
yanisslav 219bf65 Update components/chart/types/waterfall.md
yanisslav 5c4e7db Update components/chart/types/waterfall.md
yanisslav 7023295 Update components/chart/types/waterfall.md
yanisslav b122e5b Update components/chart/types/waterfall.md
yanisslav d5c1a25 Update components/chart/types/waterfall.md
yanisslav 1d44b3f chore: applying suggested changes
yanisslav 1b185e0 minor changes
yordan-mitev e1e9de8 Update components/chart/types/waterfall.md
dimodi abc8151 Update components/chart/types/waterfall.md
dimodi 2558b1b Update components/chart/types/waterfall.md
dimodi aabbde4 Update components/chart/types/waterfall.md
dimodi cbf8f6d Update components/chart/types/waterfall.md
dimodi bcb7fa2 Update components/chart/types/waterfall.md
dimodi 134f3ae Update components/chart/types/waterfall.md
dimodi a3dba1a Update components/chart/types/waterfall.md
dimodi f833d78 Update components/chart/types/waterfall.md
dimodi 38f11b0 Update components/chart/types/waterfall.md
dimodi d55d713 Update components/chart/types/waterfall.md
dimodi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| --- | ||
| title: Waterfall | ||
| page_title: Chart - Waterfall | ||
| description: The Telerik UI for Blazor Waterfall Chart illustrates the cumulative effects of positive or negative values from a starting point. Its purpose is to enhance comprehension of how an initial amount is impacted by subsequently added positive or negative values. | ||
| slug: components/chart/types/waterfall | ||
| tags: telerik,blazor,chart,waterfall | ||
| published: True | ||
| position: 0 | ||
| --- | ||
| | ||
| # Waterfall Chart | ||
| | ||
| The Blazor Waterfall Chart is a form of data visualization that helps users understand the cumulative effect of sequentially introduced positive or negative values. These values can be either time-based or category-based. | ||
| | ||
| A Waterfall Chart is useful for different types of quantitative analysis related to inventory, cash flows, performance, etc. | ||
| | ||
|  | ||
| | ||
| @[template](/_contentTemplates/chart/link-to-basics.md#understand-basics-and-databinding-first) | ||
| | ||
| ## Creating a Waterfall Chart | ||
| | ||
| 1. Add a `ChartSeries` tag to the `ChartSeriesItems` collection. | ||
| 2. Set its `Type` parameter to `ChartSeriesType.Waterfall` or `ChartSeriesType.HorizontalWaterfall`. | ||
| 3. Provide a data collection to its `Data` property | ||
| 4. Optionally, set the `SummaryField` to add a summary column. Summary columns can be classified into two types: | ||
dimodi marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| * `runningTotal`—This column shows the cumulative sum of all items since the last running total point. | ||
| * `total`—This column displays the sum of all preceding items. | ||
| | ||
| To define a data item as a running total or total, include a corresponding data point in the data source and set the `SummaryField` value as either `runningTotal` or `total`. | ||
| | ||
| >caption A Waterfall Chart that shows cash flow | ||
| | ||
| ````CSHTML | ||
| | ||
dimodi marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| <TelerikChart Width="100%" | ||
| Height="400px"> | ||
| <ChartTitle Text="Cash flow"></ChartTitle> | ||
dimodi marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| <ChartSeriesItems> | ||
| <ChartSeries Type="ChartSeriesType.Waterfall" | ||
| Data="@ChartData" | ||
| ColorField="@nameof(CashFlowData.Color)" | ||
| Field="@nameof(CashFlowData.Amount)" | ||
| CategoryField="@nameof(CashFlowData.Period)" | ||
| SummaryField="@nameof(CashFlowData.Summary)"> | ||
| <ChartSeriesLabels Visible="true" | ||
| Format="C0" | ||
| Position="@ChartSeriesLabelsPosition.InsideEnd"/> | ||
dimodi marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| </ChartSeries> | ||
| </ChartSeriesItems> | ||
| <ChartValueAxes> | ||
| <ChartValueAxis Type="ChartValueAxisType.Numeric"> | ||
| <ChartValueAxisLabels Format="C0" /> | ||
| </ChartValueAxis> | ||
| </ChartValueAxes> | ||
| </TelerikChart> | ||
| | ||
| @code { | ||
| private CashFlowData[] ChartData { get; set; } | ||
| | ||
| protected override Task OnInitializedAsync() | ||
| { | ||
| ChartData = GetWaterfallData(); | ||
| | ||
| return base.OnInitializedAsync(); | ||
| } | ||
| | ||
| private CashFlowData[] GetWaterfallData() | ||
| { | ||
| return new CashFlowData[] { | ||
| new CashFlowData | ||
| { | ||
| Period = "Beginning\nBalance", | ||
| Amount = 50000, | ||
| Color = "green" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Jan", | ||
| Amount = 17000, | ||
| Color = "green" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Feb", | ||
| Amount = 14000, | ||
| Color = "green" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Mar", | ||
| Amount = -12000, | ||
| Color = "red" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Q1", | ||
| Summary = "runningTotal", | ||
| Color = "gray" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Apr", | ||
| Amount = -22000, | ||
| Color = "red" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "May", | ||
| Amount = -18000, | ||
| Color = "red" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Jun", | ||
| Amount = 10000, | ||
| Color = "green" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Q2", | ||
| Summary = "runningTotal", | ||
| Color = "gray" | ||
| }, | ||
| new CashFlowData | ||
| { | ||
| Period = "Ending\nBalance", | ||
| Summary = "total", | ||
| Color = "#555" | ||
| } | ||
| }; | ||
| } | ||
| | ||
| private class CashFlowData | ||
| { | ||
| public string Period { get; set; } | ||
| public decimal? Amount { get; set; } | ||
| public string Summary { get; set; } | ||
| public string Color { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
| | ||
| ## Waterfall Chart Specific Appearance Settings | ||
yanisslav marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| The Waterfall Chart provides dedicated properties that allow you to customize its appearance by controlling its [orientation](#orientation), [labels](#labels), and [color](#color). | ||
| | ||
| ### Orientation | ||
| | ||
| Waterfall Charts fall into two types: | ||
dimodi marked this conversation as resolved. Show resolved Hide resolved | ||
| * Traditional Waterfall Charts—They display changes vertically. To use this Waterfall Chart, set the series type to `ChartSeriesType.Waterfall`. | ||
|  | ||
| * Horizontal Waterfall Charts—They present changes horizontally. To use this type of Waterfall Chart, set the series type to `ChartSeriesType.HorizontalWaterfall`. | ||
|  | ||
| | ||
| ### Labels | ||
| | ||
| Each data item is decorated with a text label. To control and customize these labels, use the `<ChartCategoryAxisLabels />` tag and its children, which accept the following parameters: | ||
| | ||
| * `Visible`—When set to `false`, this parameter hides all labels. | ||
| * `Step`—Renders every n-th label, where n is the value (double number) passed to the parameter. | ||
| * `Skip`—Skips the first n number of labels, where n is the value (double number) passed to the parameter. | ||
| * `Angle`—Rotates the labels with the desired angle by n degrees, where n is the value passed to the parameter. It can take positive and negative numbers. To set this parameter, use the `< ChartCategoryAxisLabelsRotation />` child tag. | ||
| | ||
| ### Color | ||
| | ||
| The color of a series is controlled through the `Color` property that can take any valid CSS color (for example, `#abcdef`, `#f00`, or `blue`). | ||
| | ||
| @[template](/_contentTemplates/chart/link-to-basics.md#color-field-bar-column) | ||
| | ||
| @[template](/_contentTemplates/chart/link-to-basics.md#gap-and-spacing) | ||
| | ||
| @[template](/_contentTemplates/chart/link-to-basics.md#configurable-nested-chart-settings) | ||
| | ||
| @[template](/_contentTemplates/chart/link-to-basics.md#configurable-nested-chart-settings-categorical) | ||
| | ||
| ## See Also | ||
| | ||
| * [Live Demo: Column Chart](https://demos.telerik.com/blazor-ui/chart/waterfall) | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.