-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using image as marker in the chart #483
Comments
sure, there is already an UIImage property there: public class ChartMarker: ChartComponentBase
{
/// The marker image to render
public var image: UIImage?
All you have to do is to figure out what's the position for it: /// Draws the ChartMarker on the given position on the given context
public func draw(context context: CGContext, point: CGPoint)
{
let offset = self.offset
let size = self.size
let rect = CGRect(x: point.x + offset.x, y: point.y + offset.y, width: size.width, height: size.height)
UIGraphicsPushContext(context)
image!.drawInRect(rect)
UIGraphicsPopContext()
} |
Can you provide an example I can't find any in the documentation and I couldn't understand your explanation. Thanks, |
I am saying ChartMarker already has image property. I have post the code and point out the function in my answer that you need look at. |
i want to make a graph like this where 1 set will be a regular line and the other will be another indicator with pills for example if my x axis is the time i will have a series of times i need to take a pill. |
answered in #506 |
I don't know if anyone still looking for a solution. Here is an example:
I am using scatter plot, just create your data entries with an image name, and Charts will plot it for you automatically, depending on icon size of your file. 🥳 |
Hi i am trying to find a way to make a data set that each of the markers will be an image instead of the default points or circles, is there a way to do it?
The text was updated successfully, but these errors were encountered: