Search code examples
core-plot

I want to draw a rectangle in my core-plot,and it can be scale in/out as the plot space scale in/out.How can I do?


In my iPhone app, a user should draw a custom rectangle anywhere in my core-plot space, and he can scale in/out as the plot space scales in/out. How can I do it?


Solution

  • You can create a CPTBorderedLayer to display a rectangle with a border and/or fill and attach it to the graph as a plot space annotation. The annotation will move with the plot as it scrolls around. You can use a plot space delegate to monitor changes to the plot space and adjust the size of the annotation as necessary.