-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
49 lines (38 loc) · 1.38 KB
/
README
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Core Plot Gallery is now part of Core Plot.
You can find the most recent version in the
examples directory of the Core Plot source
distribution:
https://github.com/core-plot/core-plot
A gallery of Core Plot examples for Mac OS X and iOS.
There are currently a few generic examples in the
plots group of the Xcode projects, but the hope is
to provide small simple examples that illustrate
a simple task in core-plot (creating a floating
axis, for example).
To add a new plot:
1. Create a new class that derives from PlotItem
2. Add a
+ (void)load
class method to register the class via the
[super registerPlotItem:self];
message.
This makes it show up in the tableview/imageview.
3. If you are only generating a single plot, override
the renderInLayer:withTheme method to create your
graphs. Make sure you add your CPGraph object to
the graphs array.
4. Add any delegate methods you need for handling
labels or user interaction.
If your view consists of multiple plots, you also
need to override the
renderInView:withTheme
method to set up your CPLayers. You should also
override the
setFrameSize:
on the Mac and
didRotateFromInterfaceOrientation:
on iOS to handle resizing and device rotation. See
the CompositePlot.[hm] files for an example of
creating multiple plots.
If you are just generating a single plot, the
resizing and rotation handling are done for you.