-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
26 lines (24 loc) · 944 Bytes
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using DevExpress.XtraCharts;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace CustomLegendItemSample {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
#region #CustomLegendItems
// Create a new custom item.
CustomLegendItem item = new CustomLegendItem();
chart.Legend.CustomItems.Add(item);
// Specify its text and marker.
item.Text = "Custom Legend Item";
Bitmap bitmap = new Bitmap("Image\\DXLogo_16x16.png");
item.MarkerImage.Image = bitmap;
// Set a value indicating that both autogenerated and custom items are displayed.
chart.Legend.ItemVisibilityMode = LegendItemVisibilityMode.AutoGeneratedAndCustom;
#endregion #CustomLegendItems
}
}
}