Меню Рубрики

System windows forms datavisualization charting chart

Legend Класс

Определение

Представляет условные обозначения для изображения диаграммы. Represents the legend for the chart image.

Комментарии

LegendКласс инкапсулирует все функциональные возможности Chart условных обозначений элемента управления и предоставляется с помощью Legends свойства Collection корневого Chart объекта. The Legend class encapsulates all the functionality of the Chart control’s legend, and is exposed using the Legends collection property of the root Chart object.

Для изображения диаграммы может существовать любое количество условных обозначений. There can be any number of legends for a chart image.

Условные обозначения могут: Legends can:

Быть закрепленным и согласованным. Be docked and aligned.

Отображаться внутри или за пределами построенных областей диаграммы. Be displayed inside or outside the plotted chart areas.

Автоматически по размеру содержимого. Automatically fit their contents.

Используйте предопределенный стиль, например строку, столбец или таблицу. Use a predefined style, such as row, column or table.

Используйте штриховки, градиентные цвета и фоновые изображения. Use hatching, gradient colors and background images.

Изменять размер и положение в любом месте изображения диаграммы. Be sized and positioned anywhere within the chart image.

Элементы условных обозначений представлены LegendItem объектом и являются либо элементами по умолчанию, либо пользовательскими. Legend items are represented by the LegendItem object, and are either default or custom items. Пользовательские элементы не связаны с данными и могут быть добавлены, удалены и изменены с помощью CustomItems Свойства. Custom items are not associated with data, and can be added, deleted and modified using the CustomItems property.

Элементы по умолчанию по умолчанию автоматически добавляются к условным обозначениям и представляют собой названия точек данных для кольцевых и круговых диаграмм. Default items are by default automatically added to the legend, and are the names of the plotted data points for doughnut and pie charts.

Для всех других типов диаграмм элементы по умолчанию представляют собой имена рядов данных, построенных на диаграмме. For all other chart types, the default items are the names of the plotted data series. Каждый ряд имеет Legend свойство, определяющее имя условных обозначений, которые будут использоваться. Each series has a Legend property that defines the name of the legend that will be used. Элемент условных обозначений не будет создан для ряда, если IsVisibleInLegend свойство имеет значение false . A legend item will not be created for a series if the IsVisibleInLegend property is set to false . Текст для этих элементов по умолчанию можно изменить с помощью LegendText Свойства. The text for these default items can be changed using the LegendText property. Это свойство позволит указать предопределенные ключевые слова, которые будут заменены соответствующими значениями во время выполнения. This property will allow you to specify predefined keywords that will be replaced by their appropriate values at run-time.

Если у вас есть круговая диаграмма и задано Label свойство, в качестве текста условных обозначений также будет задано значение, заданное для меток. If you have a pie chart and you set the Label property, it will also set the legend text to the value you set for the labels. Если вы хотите задать для текста другое значение, можно задать LegendText свойство. If you want to set the text to a different value, you can set the LegendText property. В большинстве случаев необходимо задать LegendText для свойства значение «#AXISLABEL» или «#VALX». In most cases, you would want to set the LegendText property to «#AXISLABEL» or «#VALX».

Символы ряда условных обозначений — это прямоугольники, точки или линии. Legend series symbols are rectangles, dots or lines. Тип символа автоматически задается диаграммой и зависит от типа диаграммы с диаграммой. The symbol type is set automatically by the chart and depends on the plotted chart type.

Текст условных обозначений по умолчанию автоматически изменяется. Legend text by default is automatically sized. Можно отключить автоматическое изменение размера текста условных обозначений, отключив IsTextAutoFit свойство. You can disable automatic sizing of legend text by disabling the IsTextAutoFit property. Если для этого свойства задано значение false , размер текста условных обозначений определяется свойством Size условных обозначений Font . When this property is set to false , the size of the legend text is determined by the Size property of the legend Font. Если IsTextAutoFit свойство включено, AutoFitMinFontSize свойство определяет минимальный размер шрифта, который может иметь элемент условных обозначений при изменении размера. If the IsTextAutoFit property is enabled, the AutoFitMinFontSize property determines the minimum font size that a legend item can have when resizing.

TextWrapThresholdСвойство определяет ограничение на число символов, которые могут быть показаны в одной строке перед переносом текста в другую строку. The TextWrapThreshold property defines a limit on the number of characters that can be shown on one line before text is wrapped to another line. Если вы не хотите переносить текст в условных обозначениях, присвойте TextWrapThreshold свойству значение 0. If you do not wish to wrap text in the legend, set the value of the TextWrapThreshold property to zero. По умолчанию, если весь текст условных обозначений не умещается в условных обозначениях, текст будет обрезан. By default, when the entire legend text does not fit in the legend, the text will be truncated. Можно задать в условных обозначениях, чтобы текст переносился TextWrapThreshold вместо усечения. You can set the TextWrapThreshold on the legend to get the text to wrap instead of being truncated.

Если содержимое условных обозначений не умещается в заданном пространстве, то записи условных обозначений усекаются. If the contents of the legend cannot fit into the given space, legend entries are truncated. Чтобы указать, что количество записей в условных обозначениях превышает пробел для, отображается многоточие. An ellipsis is shown to indicate that there are more entries than the legend has space for. Чтобы предотвратить усечение элементов условных обозначений, задайте расположение и размер условных обозначений с помощью Position Свойства. To prevent the legend items from being truncated, set the position and size of the legend using the Position property. При задании расположения или размера условных обозначений диаграмма больше не может автоматически размещать элементы в диаграмме. When setting the legend position or size, the chart can no longer automatically position the elements in the chart. В некоторых случаях необходимо вручную разместить другие элементы диаграммы, чтобы добиться желаемого внешнего вида. In some cases, you many need to manually position other chart elements to achieve the desired appearance.

Другой вариант — определить собственные столбцы ячейки вместо использования параметров условных обозначений по умолчанию. Another option would be to define your own cell columns instead of using the default legend settings.

LegendОбъект содержит коллекцию целлколумн; каждый объект целлколумн представляет столбец в условных обозначениях. The Legend object has a CellColumn Collection; each CellColumn object represents a column in the Legend. Столбец ячейки имеет MaximumWidth Свойства и MinimumWidth , которые можно использовать для корректировки размера столбцов. A cell column has MaximumWidth and MinimumWidth properties that can be used to adjust the size of the columns.

Если условные обозначения содержат много записей, InterlacedRows можно использовать для повышения удобочитаемости. When the legend contains many entries, InterlacedRows can be used to improve readability. Если для этого свойства задано значение true, будет отображаться цвет фона, который можно задать с помощью InterlacedRowsColor Свойства. When this property is set to True, it will display a back color that you can set using the InterlacedRowsColor property.

По умолчанию условные обозначения размещаются в правом верхнем углу диаграммы. By default, the legend is positioned in the top-right corner of the chart. Это расположение можно изменить с помощью Docking Alignment свойств и условных обозначений. This position can be modified by using the Docking and Alignment properties of the legend. Условные обозначения также можно связать с областью диаграммы с помощью DockedToChartArea Свойства. The legend can also be associated with a chart area by use of the DockedToChartArea property. Это свойство задает имя области диаграммы, для которой должны быть закреплены условные обозначения. This property specifies the name of the chart area for which the legend should be docked. Кроме того, IsDockedInsideChartArea свойство можно использовать для вывода условных обозначений внутри области диаграммы. In addition, the IsDockedInsideChartArea property can be used to display the legend inside a chart area.

Если IsDockedInsideChartArea для задано значение false, MaximumAutoSize свойство определяет максимальный размер условных обозначений в процентах от доступной диаграммы при автоматическом позиционировании условных обозначений. When IsDockedInsideChartArea is set to False, the MaximumAutoSize property defines the maximum size, in percent, of the legend within the available chart when the legend is automatically positioned. Это свойство должно быть задано, если требуется изменить ширину или высоту условных обозначений после установки свойств закрепления. This property should be set if you wish to adjust the width or height of the legend after the docking properties have been set.

Условные обозначения можно изменить с помощью CustomizeLegend события. The legend can be modified using the CustomizeLegend event.

Конструкторы

Инициализирует новый экземпляр класса Legend. Initializes a new instance of the Legend class.

Инициализирует новый экземпляр класса Legend, используя указанное имя легенды. Initializes a new instance of the Legend class with the specified legend name.

Свойства

Возвращает или задает способ выравнивания в условных обозначениях. Gets or sets the alignment of the legend.

Получает или задает минимальный размер шрифта, используемый при применении алгоритма автоматического размещения текста легенды. Gets or sets the minimum font size that can be used by the autofitting algorithm for the legend text.

Получает или задает цвет фона легенды. Gets or sets the background color of a legend.

Получает или задает ориентацию для градиента фона легенды. Gets or sets the orientation for the background gradient of a legend. Также определяет, используется ли градиент. Also determines whether a gradient is used.

Получает или задает стиль штриховки легенды. Gets or sets the hatching style of a legend.

Получает или задает фоновое изображение легенды. Gets or sets the background image of a legend.

Получает или задает тип выравнивания фонового изображения, используемого для режима рисования Unscaled. Gets or sets the background image alignment used for the Unscaled drawing mode.

Получает или задает цвет, который будет заменен прозрачным цветом при рисовании фонового изображения. Gets or sets a color that will be replaced with a transparent color when the background image is drawn.

Получает или задает режим рисования для фонового изображения легенды. Gets or sets the legend background image drawing mode.

Получает или задает вторичный цвет фона легенды. Gets or sets the secondary color of a legend background.

Получает или задает цвет границы легенды. Gets or sets the border color of a legend.

Получает или задает стиль границы легенды. Gets or sets the border style of a legend.

Получает или задает ширину границы легенды. Gets or sets the border width of a legend.

Получает объект LegendCellColumnCollection, содержащий коллекцию столбцов ячеек для легенды. Gets the LegendCellColumnCollection object that contains the collection of cell columns for a legend.

Возвращает объект LegendItemsCollection, используемый для пользовательских элементов условных обозначений. Gets a LegendItemsCollection object used for custom legend items.

Получает или задает имя области ChartArea, в которой будет закреплена легенда. Gets or sets the name of the ChartArea where the legend will be docked.

Получает или задает значение, определяющее, будет ли закреплена легенда. Gets or sets a value that determines whether the legend is docked.

Получает или задает значение, указывающее, включена ли легенда. Gets or sets a value that indicates whether the legend is enabled.

Получает или задает объект Font, который используется для задания свойств шрифта легенды. Gets or sets a Font object, which is used to set font properties of the legend.

Получает или задает цвет текста легенды. Gets or sets the color of the legend text.

Получает или задает тип визуального разделителя для заголовка легенды. Gets or sets the visual separator type for the legend header.

Получает или задает цвет разделителя для заголовка легенды. Gets or sets the color of the separator for the legend header.

Получает или задает имя области диаграммы, в которой будет нарисована легенда. Gets or sets the name of the chart area in which the legend is drawn.

Получает или задает флаг, который указывает, следует ли рисовать строки легенды с чередованием цвета фона. Gets or sets a flag that indicates whether legend rows will be drawn with interlaced background color.

Получает или задает цвет фона чередующихся строк легенды. Gets or sets the background color of the legend’s interlaced rows.

Получает или задает флаг, который указывает, где необходимо закрепить легенду — внутри или снаружи области диаграммы. Gets or sets a flag that indicates whether the legend is docked inside or outside the chart area.

Получает или задает флаг, указывающий, нужно ли размещать все элементы легенды на равном расстоянии друг от друга. Gets or sets a flag that indicates whether all legend items are equally spaced.

Получает или задает флаг, указывающий, будет ли размер текста легенды подбираться автоматически. Gets or sets a flag that indicates whether the legend text is automatically sized.

Получает или задает тип визуального разделителя для столбцов таблицы легенды. Gets or sets the visual separator type for the legend table columns.

Получает или задает цвет разделителя столбцов таблицы легенды. Gets or sets the color of the legend table column separator.

Получает или задает интервалы между столбцами таблицы легенды. Gets or sets the legend table column spacing.

Получает или задает значение, определяющий порядок отображения элементов легенды. Gets or sets a value that specifies the order in which legend items are displayed. Действие этого свойства распространяется только на элементы легенды, автоматически добавляемые в ряд диаграммы; оно не распространяется на пользовательские элементы легенды. This property only affects legend items automatically added for the chart series; it has no effect on custom legend items.

Получает или задает стиль легенды. Gets or sets the style of the legend.

Получает или задает максимальный размер легенды в процентах от области диаграммы. Gets or sets the maximum size of the legend, measured as a percentage of the chart area. Это значение используется алгоритмом автоматического создания макета. This value is used by the automatic layout algorithm.

Получает или задает имя легенды. Gets or sets the name of the legend.

Получает или задает объект ElementPosition, который может использоваться для задания или получения положения легенды. Gets or sets an ElementPosition object, which can be used to get or set the position of the legend.

Получает или задает цвет тени легенды. Gets or sets the shadow color of the legend.

Получает или задает смещение тени легенды в пикселях. Gets or sets the shadow offset, in pixels, of the legend.

Получает или задает стиль таблицы легенды. Gets or sets the legend table style.

Получает или задает объект, связанный с данным элементом диаграммы. Gets or sets an object associated with this chart element.

Получает или задает количество последовательных знаков, которые можно отобразить в легенде до переноса на следующую строку. Gets or sets the number of characters that can be sequentially displayed in the legend before the text is wrapped.

Получает или задает текст заголовка легенды. Gets or sets the text of the legend title.

Получает или задает тип выравнивания заголовка легенды. Gets or sets the alignment of the legend title.

Получает или задает цвет фона для заголовка легенды. Gets or sets the background color of the legend title.

Получает или задает шрифт заголовка легенды. Gets or sets the font for the legend title.

Получает или задает цвет текста заголовка легенды. Gets or sets the text color of the legend title.

Получает или задает тип визуального разделителя для заголовка легенды. Gets or sets the visual separator type for the legend title.

Возвращает или задает цвет разделителя заголовка условных обозначений. Gets or sets the color of the legend title separator.

Методы

Освобождает ресурсы, используемые объектом ChartElement. Releases the resources used by the ChartElement.

Освобождает неуправляемые ресурсы, используемые объектом Legend, а при необходимости освобождает также управляемые ресурсы. Releases the unmanaged resources used by the Legend and optionally releases the managed resources.

Определяет, равен ли указанный экземпляр Object текущему экземпляру ChartElement. Determines whether the specified Object is equal to the current ChartElement.

Возвращает хэш-функцию для определенного типа. Returns a hash function for a particular type.

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

Возвращает строку, которая представляет текущий объект Object. Returns a string that represents the current Object.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • System volume information как очистить в windows server 2008 r2
  • System volume information windows xp отказано в доступе
  • System volume information windows 7 что это за папка
  • System thread exception not handled windows 10 что делать
  • System thread exception not handled windows 10 решение