You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/javascript/dataviz/ui/chart.md
+84-6Lines changed: 84 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -5428,6 +5428,33 @@ The chart legend configuration options.
5428
5428
});
5429
5429
</script>
5430
5430
5431
+
### legend.align `String` *(default: "center")*
5432
+
5433
+
The legend horizontal alignment when the [legend.position](#configuration-legend.position) is "top" or "bottom" and the vertical alignment when the [legend.position](#configuration-legend.position) is "left" or "right".
5434
+
5435
+
The supported values are:
5436
+
5437
+
* "start" - the legend is aligned to the start.
5438
+
5439
+
* "center" - the legend is aligned to the center.
5440
+
5441
+
* "end" - the legend is aligned to the end.
5442
+
5443
+
#### Example - set the chart legend alignment to start
The background color of the legend. Accepts a valid CSS color string, including hex and rgb.
@@ -5571,9 +5598,9 @@ The width of the border in pixels. By default the border width is set to zero wh
5571
5598
5572
5599
### legend.height `Number`
5573
5600
5574
-
The legend height when the [legend.position](#configuration-legend.position) is set to "custom" and the [legend.orientation](#configuration-legend.orientation) is set to "vertical".
5601
+
The legend height when the [legend.orientation](#configuration-legend.orientation) is set to "vertical".
5575
5602
5576
-
#### Example - set the chart legend height
5603
+
#### Example - set the chart legend height for custom positioned legend
5577
5604
5578
5605
<div id="chart"></div>
5579
5606
<script>
@@ -5591,6 +5618,23 @@ The legend height when the [legend.position](#configuration-legend.position) is
5591
5618
});
5592
5619
</script>
5593
5620
5621
+
#### Example - set the chart legend height for legend with predefined position
5622
+
5623
+
<div id="chart"></div>
5624
+
<script>
5625
+
$("#chart").kendoChart({
5626
+
legend: {
5627
+
position: "left",
5628
+
height: 50
5629
+
},
5630
+
series: [
5631
+
{ name: "Series 1", data: [1, 2, 3] },
5632
+
{ name: "Series 2", data: [3, 4, 5] },
5633
+
{ name: "Series 3", data: [6, 7, 8] }
5634
+
]
5635
+
});
5636
+
</script>
5637
+
5594
5638
### legend.inactiveItems `Object`
5595
5639
5596
5640
The chart inactive legend items configuration.
@@ -6339,15 +6383,15 @@ A negative value will move the legend upwards from its current position.
The orientation of the legend items when the position [legend.position](#configuration-legend.position) is set to "custom".
6386
+
The orientation of the legend items.
6343
6387
6344
6388
The supported values are:
6345
6389
6346
6390
* "vertical" - the legend items are added vertically.
6347
6391
6348
6392
* "horizontal" - the legend items are added horizontally.
6349
6393
6350
-
#### Example - set horizontal orientation to the chart legend
6394
+
#### Example - set horizontal orientation for custom positioned legend
6351
6395
6352
6396
<div id="chart"></div>
6353
6397
<script>
@@ -6364,6 +6408,23 @@ The supported values are:
6364
6408
});
6365
6409
</script>
6366
6410
6411
+
#### Example - set horizontal orientation for legend with predefined position
6412
+
6413
+
<div id="chart"></div>
6414
+
<script>
6415
+
$("#chart").kendoChart({
6416
+
legend: {
6417
+
position: "left",
6418
+
orientation: "horizontal"
6419
+
},
6420
+
series: [
6421
+
{ name: "Series 1", data: [1, 2, 3] },
6422
+
{ name: "Series 2", data: [3, 4, 5] },
6423
+
{ name: "Series 3", data: [6, 7, 8] }
6424
+
]
6425
+
});
6426
+
</script>
6427
+
6367
6428
### legend.padding `Number|Object` *(default: 5)*
6368
6429
6369
6430
The padding of the chart legend. A numeric value will set all paddings.
@@ -6510,9 +6571,9 @@ If set to `true` the chart will display the legend. By default the chart legend
6510
6571
6511
6572
### legend.width `Number`
6512
6573
6513
-
The legend width when the [legend.position](#configuration-legend.position) is set to "custom" and the [legend.orientation](#configuration-legend.orientation) is set to "horizontal".
6574
+
The legend width when the [legend.orientation](#configuration-legend.orientation) is set to "horizontal".
6514
6575
6515
-
#### Example - set the chart legend width
6576
+
#### Example - set the chart legend width for custom positioned legend
6516
6577
6517
6578
<div id="chart"></div>
6518
6579
<script>
@@ -6530,6 +6591,23 @@ The legend width when the [legend.position](#configuration-legend.position) is s
6530
6591
});
6531
6592
</script>
6532
6593
6594
+
#### Example - set the chart legend width for legend with predefined position
0 commit comments