Search code examples
core-plotmovelegenddraginteraction

Core Plot: Move the legend on the plotting area


I achieved to plot my 5 lines, but wherever I place the legend, it doesn't allow me to see clearly the interception of some lines. There is a way to allow the user to move/drag the legend along the plotting area?


Solution

  • No. You could position the legend outside the plot area so it doesn't overlap the plot or subclass CPTLegend and override the user interaction methods (-pointingDeviceDownEvent:atPoint:, etc.) to implement the dragging behavior.