Is there a way to make tick mark (major tick mark) to be UIImage (custom graphics) instead of text? I have values in one of the axis I need to present as icons. I do not see any delegate for this but maybe someone knows the trick?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- Plotting multiple columns with ggplot2 [duplicate]
- CV2 Image Error: error: (-215:Assertion failed) !s
- Replace image attributes for lazyload plugin on im
相关文章
- 关于asp.net core 中使用Ueditor获取数据的问题
- .net core3.1路由配置伪链接该怎么配置
- How to plot smoother curves in R
- Use savefig in Python with string and iterative in
- Where does this quality loss on Images come from?
- Specifying image dimensions in HTML vs CSS for pag
- How to insert pictures into each individual bar in
- How to add clipboard support to Matplotlib figures
Axis labels can have any
CPTLayer
(which is a direct subclass of Core Animation'sCALayer
) as its content. Set your image as the layer background and build a custom label using this layer. Several of the Core Plot example apps demonstrate custom labels, although they all use text labels.You have two options for adding your custom labels to the graph:
Use the
CPTAxisLabelingPolicyNone
labeling policy. Create aNSSet
containing your labels and set it to theaxisLabels
property on the axis. If you use this, remember that you must provide the major and/or minor tick locations in addition to the custom labels.Use any other labeling policy to generate the tick locations and implement the
-axis:shouldUpdateAxisLabelsAtLocations:
axis delegate method. In your delegate, create new labels at the provided locations and returnNO
to suppress the automatic labels.Eric
Accepting Eric's question and thanking him I provide working code for his suggested solution. Maybe it helps someone:
CPImageLayer.h
CPImageLayer.m
Enjoy