Skip to content

Commit 388db4b

Browse files
committed
Sync with Kendo UI Professional
1 parent 83940ec commit 388db4b

File tree

4 files changed

+533
-0
lines changed

4 files changed

+533
-0
lines changed
Loading
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Sankey Charts
3+
page_title: Sankey Charts
4+
description: "Learn the basics when working with the sankey charts in the {{ site.product }} suite which allows the users to create diagrams that visualize changing flows and their distribution between domains."
5+
slug: htmlhelpers_sankeycharts_aspnetcore
6+
position: 4
7+
---
8+
9+
{% if site.core %}
10+
{% assign Position = "/api/Kendo.Mvc.UI.Fluent/ChartCategoryAxisLabelsSettingsBuilder#positionkendomvcuichartaxislabelsposition" %}
11+
{% else %}
12+
{% assign Position = "/api/Kendo.Mvc.UI.Fluent/ChartAxisLabelsBuilder#positionkendomvcuichartaxislabelsposition" %}
13+
{% endif %}
14+
15+
## Sankey Charts
16+
17+
The {{ site.product }} Sankey Chart allows you to create diagrams that visualize changing flows and their distribution between domains. Sankey diagrams suit a variety of use cases like the representation of website traffic, budget breakdowns, energy flow, and others.
18+
19+
![Sankey Chart Overview](images/chart-sankey.png)
20+
21+
## Configuration
22+
23+
Sankey Chart visualize its data using Nodes (items) and Links (connections). You can add them using their respective collections. In addition to that, you can configure the links, legend, and tooltips displayed on the Sankey Diagram by using the following properties:
24+
25+
- [`Links`](/api/javascript/dataviz/ui/sankey/configuration/links)—Provides options to set the [`ColorType`](/api/javascript/dataviz/ui/sankey/configuration/links.colortypes) of the link to either `Static`, `Source`, or `Target`. It also allows you to control the opacity and highlighting of the link.
26+
- [`Legend`](/api/javascript/dataviz/ui/sankey/configuration/legend)—Provides options to customize the appearance of the chart legend.
27+
- [`Tooltip`](/api/javascript/dataviz/ui/sankey/configuration/labels)—Provides options to modify the the functionality of the chart element titles.
28+
29+
Here is a sample demonstration:
30+
31+
```HtmlHelper
32+
@(Html.Kendo().Sankey()
33+
.Name("sankey")
34+
.Theme("sass")
35+
.Legend(l => l.Position(LegendPosition.Bottom))
36+
.Links(l => l.ColorType(LinkColorType.Source))
37+
.Data(d => d.Nodes(n =>
38+
{
39+
n.Add().Id(1).Label(l => l.Text("Source"));
40+
n.Add().Id(2).Label(l => l.Text("Target"));
41+
})
42+
.Links(l =>
43+
{
44+
l.Add().SourceId(1).Value(12).TargetId(2);
45+
}))
46+
.Tooltip(t => t
47+
.Delay(100)
48+
.FollowPointer(true)
49+
)
50+
```
51+
{% if site.core %}
52+
```TagHelper
53+
<kendo-sankey name="sankey" theme="sass">
54+
<legend position="LegendPosition.Bottom"/>
55+
<links color-type="LinkColorType.Source"/>
56+
<data>
57+
<nodes>
58+
<node id="1">
59+
<label text="Source"></label>
60+
</node>
61+
<node id="2">
62+
<label text="Target"></label>
63+
</node>
64+
</nodes>
65+
<links>
66+
<link source-id="1" target-id="2" value="12">
67+
</link>
68+
</links>
69+
</data>
70+
<tooltip delay="100" follow-pointer="true"/>
71+
</kendo-sankey>
72+
```
73+
{% endif %}
74+
75+
## Configuring the Link Colors
76+
77+
The Sankey diagram provides different [`ColorTypes`](/api/javascript/dataviz/ui/sankey/configuration/links.colortypes) of the links. The supported LinkColorType values are:
78+
79+
* `Static`&mdash;The color is static and is determined by the link's color option.
80+
* `Source`&mdash;The link color is the same as the source node color.
81+
* `Target`&mdash;The link color is the same as the target node color.
82+
83+
## Functionality and Features
84+
85+
The {{ site.product }} Sankey Chart includes the following customizable elements:
86+
87+
- Nodes&mdash;The node is a rectangular element that connects to other nodes.
88+
- Links&mdash;The lines that connect the nodes to each other. The greater the value of the link, the greater the width of the link will be.
89+
- Labels&mdash;The labels are the names of the nodes and are displayed on them or next to them.
90+
- Legend&mdash;The legend lists the labels of each link.
91+
- Title&mdash;The title displayed above the component.
92+
- Tooltip&mdash;The tooltip is displayed when hovering above the links and nodes.
93+
94+
## Next Steps
95+
96+
* [Basic Usage of the Sankey Chart (Demo)](https://demos.telerik.com/{{ site.platform }}/sankey-charts/index)
97+
98+
## See Also
99+
100+
* [Using the API of the Chart HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/chart-api/index)
101+
* [Basic Usage of the Sankey Chart HtmlHelper for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/sankey-charts/index)
102+
* [Server-Side API](/api/chart)
Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
---
2+
title: Customizing Grid Text Across the Whole Component
3+
description: Learn how customize Grid text in all tree editing modes - incell, inline, and popup.
4+
type: how-to
5+
page_title: Customizing Grid Text Across the Whole Component - Kendo UI Grid for jQuery
6+
slug: grid-customize-text
7+
tags: grid, customize, text, kendo
8+
res_type: kb
9+
---
10+
## Environment
11+
| Product | Version |
12+
|-----------|----------------|
13+
| Grid for Progress® Kendo UI® | 2024.1.319 |
14+
15+
## Description
16+
17+
The Grid allows you to customize its command, toolbar and editing buttons text. It also allows customization of the delete confirmation popup text and the filter menu text.
18+
19+
## Solution
20+
21+
The following example demonstrates how to customize the Grid text.
22+
23+
```dojo
24+
<h1>Incell editing mode</h1>
25+
<div id="grid"></div>
26+
<h1>Inline editing mode</h1>
27+
<div id="grid-inline-edit"></div>
28+
<h1>Popup editing mode</h1>
29+
<div id="grid-popup-edit"></div>
30+
31+
<script>
32+
$(document).ready(function() {
33+
$("#grid").kendoGrid({
34+
dataSource: {
35+
data: createRandomData(80),
36+
schema: {
37+
model: {
38+
fields: {
39+
Id: { type: "number" },
40+
FirstName: { type: "string" },
41+
LastName: { type: "string" },
42+
City: { type: "string" },
43+
Title: { type: "string" },
44+
IsCustomer: { type: "boolean" },
45+
BirthDate: { type: "date" },
46+
Age: { type: "number" }
47+
}
48+
}
49+
},
50+
pageSize: 10
51+
},
52+
height: 400,
53+
scrollable: true,
54+
sortable: true,
55+
pageable: true,
56+
groupable: {
57+
messages: {
58+
empty: "Custom message text"
59+
}
60+
},
61+
editable: {
62+
mode: "incell",
63+
update: true,
64+
destroy: true,
65+
confirmation: "Are you sure you want to remove this item?" //text for the confirmation message
66+
},
67+
columns: [
68+
{
69+
field: "Id",
70+
title: "ID",
71+
width: "60px"
72+
},
73+
{
74+
field: "FirstName",
75+
title: "First Name"
76+
},
77+
{
78+
field: "LastName",
79+
title: "Last Name"
80+
},
81+
{
82+
field: "City"
83+
},
84+
{
85+
field: "Title"
86+
},
87+
{
88+
field: "IsCustomer",
89+
title: "Customer",
90+
width: "100px"
91+
},
92+
{
93+
field: "BirthDate",
94+
title: "Birth Date",
95+
template: '#= kendo.toString(BirthDate,"MM/dd/yyyy") #'
96+
},
97+
{
98+
field: "Age",
99+
width: "60px"
100+
},
101+
// adding command in the columns, name - the command name, text - text to be set on the button
102+
{
103+
command: { name: "destroy", text: "Custom Delete" },
104+
title: "&nbsp;",
105+
width: "160px"
106+
}
107+
],
108+
toolbar: [
109+
//name - name of the available commands, text - text to be set on the button
110+
{ name: "create", text: "Custom Create" },
111+
{ name: "save", text: "Custom Save" },
112+
{ name: "cancel", text: "Custom Cancel" }
113+
],
114+
// filter menu settings
115+
filterable: {
116+
name: "FilterMenu",
117+
extra: true, // turns on/off the second filter option
118+
messages: {
119+
info: "Custom header text:", // sets the text on top of the filter menu
120+
filter: "CustomFilter", // sets the text for the "Filter" button
121+
clear: "CustomClear", // sets the text for the "Clear" button
122+
123+
// when filtering boolean numbers
124+
isTrue: "custom is true", // sets the text for "isTrue" radio button
125+
isFalse: "custom is false", // sets the text for "isFalse" radio button
126+
127+
//changes the text of the "And" and "Or" of the filter menu
128+
and: "CustomAnd",
129+
or: "CustomOr"
130+
},
131+
operators: {
132+
//filter menu for "string" type columns
133+
string: {
134+
eq: "Custom Equal to",
135+
neq: "Custom Not equal to",
136+
startswith: "Custom Starts with",
137+
contains: "Custom Contains",
138+
endswith: "Custom Ends with"
139+
},
140+
//filter menu for "number" type columns
141+
number: {
142+
eq: "Custom Equal to",
143+
neq: "Custom Not equal to",
144+
gte: "Custom Is greater than or equal to",
145+
gt: "Custom Is greater than",
146+
lte: "Custom Is less than or equal to",
147+
lt: "Custom Is less than"
148+
},
149+
//filter menu for "date" type columns
150+
date: {
151+
eq: "Custom Equal to",
152+
neq: "Custom Not equal to",
153+
gte: "Custom Is after or equal to",
154+
gt: "Custom Is after",
155+
lte: "Custom Is before or equal to",
156+
lt: "Custom Is before"
157+
}
158+
}
159+
}
160+
});
161+
162+
$("#grid-inline-edit").kendoGrid({
163+
dataSource: {
164+
data: createRandomData(30),
165+
schema: {
166+
model: {
167+
fields: {
168+
Id: { type: "number" },
169+
FirstName: { type: "string" },
170+
LastName: { type: "string" },
171+
City: { type: "string" },
172+
BirthDate: { type: "date" }
173+
}
174+
}
175+
},
176+
pageSize: 10
177+
},
178+
pageable: true,
179+
height: 400,
180+
toolbar: ["create"],
181+
columns: [
182+
{ field: "Id", width: "60px" },
183+
{ field: "FirstName", title: "First Name" },
184+
{ field: "LastName", title: "Last Name" },
185+
{ field: "City" },
186+
{ field: "BirthDate", template: '#= kendo.toString(BirthDate,"MM/dd/yyyy") #' },
187+
{ command: [
188+
{
189+
name: "edit",
190+
text: { // sets the text of the "Edit", "Update" and "Cancel" buttons
191+
edit: "CustomEdit",
192+
update: "CustomUpdate",
193+
cancel: "CustomCancel"
194+
}
195+
},
196+
{ name: "destroy", text: "Destroy" } // sets the text of the "Delete" button
197+
],
198+
// sets the title and the width of the commands column
199+
title: "&nbsp;",
200+
width: "300px"
201+
}
202+
],
203+
editable: "inline"
204+
});
205+
206+
$("#grid-popup-edit").kendoGrid({
207+
dataSource: {
208+
data: createRandomData(30),
209+
schema: {
210+
model: {
211+
fields: {
212+
Id: { type: "number" },
213+
FirstName: { type: "string" },
214+
LastName: { type: "string" },
215+
City: { type: "string" },
216+
BirthDate: { type: "date" }
217+
}
218+
}
219+
},
220+
pageSize: 10
221+
},
222+
pageable: true,
223+
height: 400,
224+
toolbar: ["create"],
225+
columns: [
226+
{ field: "Id", width: "60px" },
227+
{ field: "FirstName", title: "First Name" },
228+
{ field: "LastName", title: "Last Name" },
229+
{ field: "City" },
230+
{ field: "BirthDate", template: '#= kendo.toString(BirthDate,"MM/dd/yyyy") #' },
231+
{ command: [
232+
{
233+
name: "edit",
234+
text: { // sets the text of the "Edit", "Update" and "Cancel" buttons
235+
edit: "CustomEdit",
236+
update: "CustomUpdate",
237+
cancel: "CustomCancel"
238+
}
239+
},
240+
{ name: "destroy", text: "Destroy" } // sets the text of the "Delete" button
241+
],
242+
// sets the title and the width of the commands column
243+
title: "&nbsp;",
244+
width: "300px"
245+
}
246+
],
247+
editable: "popup"
248+
});
249+
});
250+
251+
var firstNames = ["Nancy", "Andrew", "Janet", "Margaret", "Steven", "Michael", "Robert", "Laura", "Anne", "Nige"],
252+
lastNames = ["Davolio", "Fuller", "Leverling", "Peacock", "Buchanan", "Suyama", "King", "Callahan", "Dodsworth", "White"],
253+
cities = ["Seattle", "Tacoma", "Kirkland", "Redmond", "London", "Philadelphia", "New York", "Seattle", "London", "Boston"],
254+
titles = ["Accountant", "Vice President, Sales", "Sales Representative", "Technical Support", "Sales Manager", "Web Designer",
255+
"Software Developer", "Inside Sales Coordinator", "Chief Techical Officer", "Chief Execute Officer"],
256+
birthDates = [new Date("1948/12/08"), new Date("1952/02/19"), new Date("1963/08/30"), new Date("1937/09/19"), new Date("1955/03/04"), new Date("1963/07/02"), new Date("1960/05/29"), new Date("1958/01/09"), new Date("1966/01/27"), new Date("1966/03/27")];
257+
258+
function createRandomData(count) {
259+
var data = [],
260+
now = new Date();
261+
for (var i = 0; i < count; i++) {
262+
var firstName = firstNames[Math.floor(Math.random() * firstNames.length)],
263+
lastName = lastNames[Math.floor(Math.random() * lastNames.length)],
264+
city = cities[Math.floor(Math.random() * cities.length)],
265+
title = titles[Math.floor(Math.random() * titles.length)],
266+
birthDate = birthDates[Math.floor(Math.random() * birthDates.length)],
267+
age = now.getFullYear() - birthDate.getFullYear(),
268+
isCustomer = ((i%3) == 0) ? true : false;
269+
270+
data.push({
271+
Id: i + 1,
272+
FirstName: firstName,
273+
LastName: lastName,
274+
City: city,
275+
Title: title,
276+
BirthDate: birthDate,
277+
Age: age,
278+
IsCustomer: isCustomer
279+
});
280+
}
281+
return data;
282+
}
283+
</script>
284+
```
285+
286+
## See Also
287+
288+
* [Grid API Reference](/api/javascript/ui/grid)
289+
* [Grid Batch Editing (Demo)](https://demos.telerik.com/kendo-ui/grid/editing)
290+
* [Grid Inline Editing (Demo)](https://demos.telerik.com/kendo-ui/grid/editing-inline)
291+
* [Grid Popup Editing (Demo)](https://demos.telerik.com/kendo-ui/grid/editing-popup)

0 commit comments

Comments
 (0)