Legend delegate.
More...
#import <CPTLegend.h>
◆ legend:fillForEntryAtIndex:forPlot:
(Optional) This method gives the delegate a chance to provide a background fill for each legend entry.
- Parameters
-
legend | The legend. |
idx | The zero-based index of the legend entry for the given plot. |
plot | The plot. |
- Returns
- The fill for the legend entry background or nil to use the default entryFill .
◆ legend:fillForSwatchAtIndex:forPlot:
(Optional) This method gives the delegate a chance to provide a custom swatch fill for each legend entry.
- Parameters
-
legend | The legend. |
idx | The zero-based index of the legend entry for the given plot. |
plot | The plot. |
- Returns
- The fill for the legend swatch or nil to use the default swatchFill .
◆ legend:legendEntryForPlot:touchDownAtIndex:
(Optional) Informs the delegate that the swatch or label of a legend entry was pressed.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
◆ legend:legendEntryForPlot:touchDownAtIndex:withEvent:
(Optional) Informs the delegate that the swatch or label of a legend entry was pressed.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
event | The event that triggered the selection. |
◆ legend:legendEntryForPlot:touchUpAtIndex:
(Optional) Informs the delegate that the swatch or label of a legend entry was released.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
◆ legend:legendEntryForPlot:touchUpAtIndex:withEvent:
(Optional) Informs the delegate that the swatch or label of a legend entry was released.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
event | The event that triggered the selection. |
◆ legend:legendEntryForPlot:wasSelectedAtIndex:
(Optional) Informs the delegate that the swatch or label of a legend entry was both pressed and released.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
◆ legend:legendEntryForPlot:wasSelectedAtIndex:withEvent:
(Optional) Informs the delegate that the swatch or label of a legend entry was both pressed and released.
- Parameters
-
legend | The legend. |
plot | The plot associated with the selected legend entry. |
idx | The index of the clicked legend entry. |
event | The event that triggered the selection. |
◆ legend:lineStyleForEntryAtIndex:forPlot:
(Optional) This method gives the delegate a chance to provide a border line style for each legend entry.
- Parameters
-
legend | The legend. |
idx | The zero-based index of the legend entry for the given plot. |
plot | The plot. |
- Returns
- The line style for the legend entry border or nil to use the default entryBorderLineStyle .
◆ legend:lineStyleForSwatchAtIndex:forPlot:
(Optional) This method gives the delegate a chance to provide a custom swatch border line style for each legend entry.
- Parameters
-
legend | The legend. |
idx | The zero-based index of the legend entry for the given plot. |
plot | The plot. |
- Returns
- The line style for the legend swatch border or nil to use the default swatchBorderLineStyle .
◆ legend:shouldDrawSwatchAtIndex:forPlot:inRect:inContext:
(Optional) This method gives the delegate a chance to draw custom swatches for each legend entry.
The "swatch" is the graphical part of the legend entry, usually accompanied by a text title that will be drawn by the legend. Returning NO will cause the legend to not draw the default legend graphics. It is then the delegate’s responsibility to do this.
- Parameters
-
legend | The legend. |
idx | The zero-based index of the legend entry for the given plot. |
plot | The plot. |
rect | The bounding rectangle to use when drawing the swatch. |
context | The graphics context to draw into. |
- Returns
- YES if the legend should draw the default swatch or NO if the delegate handled the drawing.
The documentation for this protocol was generated from the following file: