Skip to content

Commit db1b114

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent a81fe65 commit db1b114

File tree

10 files changed

+562
-0
lines changed

10 files changed

+562
-0
lines changed
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Bullet Charts
3+
page_title: Bullet Charts | Kendo UI Charts HtmlHelper for ASP.NET Core
4+
description: "Learn how to define and configure Kendo UI Bullet Charts."
5+
slug: bulletcharts_aspnetcore_htmlhelper
6+
---
7+
8+
# Bullet Charts
9+
10+
The [Kendo UI Bullet Chart HtmlHelper for ASP.NET Core](https://demos.telerik.com/aspnet-core/bullet-charts/index) is a variation of a Bar chart. You can use it to visualize a comparison between an expected (target) and actual (current) value. For example, with a Bullet Chart you can display company profit, employee performance, weather data and so on.
11+
## Configuration
12+
13+
Use `Bullet` and `VerticalBullet` in the Series configuration to create a Bullet series in the Chart helper.
14+
15+
### Axes
16+
17+
Axes are configured through the `CategoryAxis` and `ValueAxis` settings. Multiple value axes are supported.
18+
19+
###### Example
20+
21+
@(Html.Kendo().Chart()
22+
.Name("chart")
23+
.Legend(legend => legend
24+
.Visible(false)
25+
)
26+
.Series(series => {
27+
series.Bullet(new double[][] { new double[] { 750, 762.5 }});
28+
})
29+
.ChartArea(chartArea => chartArea.Margin(0))
30+
.CategoryAxis(axis => axis
31+
.MajorGridLines(lines => lines.Visible(false))
32+
.MajorTicks(lines => lines.Visible(false))
33+
)
34+
.ValueAxis(axis => axis
35+
.Numeric()
36+
.Min(715)
37+
.Max(795)
38+
.MinorTicks(lines => lines.Visible(true))
39+
.MajorGridLines(lines => lines.Visible(false))
40+
.PlotBands(bands => {
41+
bands.Add().From(715).To(752).Color("#ccc").Opacity(0.6);
42+
bands.Add().From(752).To(772).Color("#ccc").Opacity(0.3);
43+
})
44+
)
45+
.Tooltip(tooltip => tooltip
46+
.Visible(true)
47+
.Shared(true)
48+
.Template("Maximum: #= value.target # <br /> Average: #= value.current #")
49+
)
50+
)
51+
52+
53+
This configuration results in the Bullet Chart below.
54+
55+
**Figure 1: A sample Bullet Chart**
56+
57+
![Bullet Chart](/html-helpers/charts/chart-types/chart-bullet.png)
58+
59+
### Target Line Customization
60+
61+
You can customize the line that represents the target value using the series `Target` configuration. It exposes three main settings - `Border`, `Color` and `Line` that control the line appearance. Below, you can see an example that uses all three options to customize the target line:
62+
63+
```
64+
.Series(series =>
65+
{
66+
series
67+
.Bullet(new double[][] { new double[] { 780, 762.5 } })
68+
.Color("darkblue")
69+
.Target(target=>target
70+
.Color("green")
71+
.Border(b=>b
72+
.Color("turquoise")
73+
.Width(2)
74+
)
75+
.Line(l=>l.Width(6))
76+
);
77+
})
78+
```
79+
80+
**Figure 2: A Bullet Chart with custom target line**
81+
82+
![Bullet Chart with Custom Line](/html-helpers/charts/chart-types/chart-bullet-target.png)
83+
84+
85+
## See Also
86+
87+
Other articles on Kendo UI Charts and chart types:
88+
89+
* [Overview of the Kendo UI Chart Html Helper for ASP.NET Core ]({% slug htmlhelpers_charts_aspnetcore %})
90+
* [Area Charts]({% slug areacharts_aspnetcore_htmlhelper %})
91+
* [Bubble Charts]({% slug bubblecharts_aspnetcore_htmlhelper %})
92+
* [BoxPlot Charts]({% slug boxplotcharts_aspnetcore_htmlhelper %})
93+
* [Bar Charts]({% slug barcharts_aspnetcore_htmlhelper %})
94+
* [Line Charts]({% slug linecharts_aspnetcore_htmlhelper %})
95+
* [Pie Charts]({% slug piecharts_aspnetcore_htmlhelper %})
96+
* [Stock Charts]({% slug overview_stockcharthelper_aspnetcore %})
97+
* [TreeMap]({% slug overview_treemaphelper_aspnetcore %})
98+
* [Chart JavaScript API Reference](https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart)
3.81 KB
Loading
4.02 KB
Loading
5.16 KB
Loading
20.6 KB
Loading
19.8 KB
Loading
19.2 KB
Loading
10.6 KB
Loading
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: Line Charts
3+
page_title: Line Charts | Kendo UI Charts HtmlHelper for ASP.NET Core
4+
description: "Learn how to define and configure Kendo UI Line Charts."
5+
slug: linecharts_aspnetcore_htmlhelper
6+
---
7+
8+
# Line Charts
9+
10+
The [Kendo UI Line Chart HtmlHelper for ASP.NET Core](https://demos.telerik.com/aspnet-core/line-charts/index) is suitable for displaying quantitative data by using continuous lines passing through points defined by the values of their items. It is useful for rendering a trend over time and comparing several sets of similar data.
11+
## Configuration
12+
13+
Use `Line` and `VerticalLine` in the Series configuration to create a Line series in the Chart helper.
14+
15+
### Axes
16+
17+
Axes are configured through the `CategoryAxis` and `ValueAxis` settings. Multiple value axes are supported.
18+
19+
###### Example
20+
21+
@(Html.Kendo().Chart()
22+
.Name("chart")
23+
.Title("Internet Users")
24+
.Legend(legend => legend
25+
.Position(ChartLegendPosition.Bottom)
26+
)
27+
.Series(series =>
28+
{
29+
series.Line(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World");
30+
series.Line(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
31+
})
32+
.CategoryAxis(axis => axis
33+
.Categories("2005", "2006", "2007", "2008", "2009")
34+
.MajorGridLines(lines => lines.Visible(false))
35+
)
36+
.ValueAxis(axis => axis
37+
.Numeric().Labels(labels => labels.Format("{0}%"))
38+
)
39+
)
40+
41+
42+
This configuration results in the Line Chart below.
43+
44+
**Figure 1: A sample Line Chart**
45+
46+
![Line Chart](/html-helpers/charts/chart-types/chart-line.png)
47+
48+
### Line Styles
49+
50+
Kendo UI Line Charts support rendering of the lines between points using different styles. You can set the line style using the `Style` configuration in the `SeriesDefaults` common settings:
51+
52+
```
53+
.SeriesDefaults(seriesDefaults =>
54+
seriesDefaults.Line().Style(ChartLineStyle.Smooth)
55+
)
56+
```
57+
58+
or for each Line series individually:
59+
60+
```
61+
.Series(series =>
62+
{
63+
series.Line(new double[] { 15.7, 26.7, 20, 23.5, 26.6 }).Name("World").Style(ChartLineStyle.Smooth);
64+
series.Line(new double[] { 67.96, 68.93, 75, 54, 78 }).Name("United States").Style(ChartLineStyle.Smooth);
65+
})
66+
```
67+
68+
The supported styles are:
69+
70+
* Normal&mdash;This is the default style. It produces a straight line between data points.
71+
* Step&mdash;This style renders the connection between data points through vertical and horizontal lines. It is suitable for indicating that the value is constant between the changes.
72+
* Smooth&mdash;This style causes the Line Chart to display a fitted curve through data points. It is suitable when the data requires to be displayed with a curve, or when you wish to connect the points with smooth instead of straight lines.
73+
74+
**Figure 2: A step-line Line Chart**
75+
76+
![Step Line Chart](/html-helpers/charts/chart-types/chart-step-line.png)
77+
78+
**Figure 3: A smooth-line Line Chart**
79+
80+
![Smooth Line Chart](/html-helpers/charts/chart-types/chart-smooth-line.png)
81+
82+
### Types of Lines
83+
84+
The Chart draws Line series as a solid line by default. You can configure the line to be drawn using different dash styles using the `DashType` setting:
85+
86+
```
87+
.Series(series =>
88+
{
89+
series.Line(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World").DashType(ChartDashType.Dot);
90+
series.Line(new double[] { 67.96, 68.93, 75, 74, 78 }).Name("United States");
91+
})
92+
```
93+
94+
**Figure 4: A dotted Line Series**
95+
96+
![Dotted Line Series](/html-helpers/charts/chart-types/chart-dotted-line.png)
97+
98+
### Markers
99+
100+
The series markers are the visuals that represent the point value in the Line series. You can customize or hide them using the `Markers` configuration.
101+
102+
```
103+
series.Line(new double[] { 15.7, 16.7, 20, 23.5, 26.6 }).Name("World")
104+
.Markers(m=>m
105+
.Type(ChartMarkerShape.Square)
106+
.Rotation(45)
107+
.Background("yellow")
108+
);
109+
```
110+
111+
**Figure 5: A Line Chart with custom markers**
112+
113+
![Line Chart with Custom Markers](/html-helpers/charts/chart-types/chart-line-markers.png)
114+
115+
You can also draw completely custom markers for the Line series through the `Visual` setting, as shown in the [Custom Visuals](https://demos.telerik.com/aspnet-core/line-charts/visuals) demo.
116+
117+
## See Also
118+
119+
Other articles on Kendo UI Charts and chart types:
120+
121+
* [Overview of the Kendo UI Chart Html Helper for ASP.NET Core ]({% slug htmlhelpers_charts_aspnetcore %})
122+
* [Area Charts]({% slug areacharts_aspnetcore_htmlhelper %})
123+
* [Bubble Charts]({% slug bubblecharts_aspnetcore_htmlhelper %})
124+
* [BoxPlot Charts]({% slug boxplotcharts_aspnetcore_htmlhelper %})
125+
* [Bar Charts]({% slug barcharts_aspnetcore_htmlhelper %})
126+
* [Pie Charts]({% slug piecharts_aspnetcore_htmlhelper %})
127+
* [Stock Charts]({% slug overview_stockcharthelper_aspnetcore %})
128+
* [TreeMap]({% slug overview_treemaphelper_aspnetcore %})
129+
* [Chart JavaScript API Reference](https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart)

0 commit comments

Comments
 (0)