-
-
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
Making a line chart set with images on the chart #506
Comments
Then write your own code and logic to add the image. The logic to calculate the position is already there. You simply write your own rendering method to draw the images instead of line dots |
Listen i really don't understand what you mean, could you please provide me with a little example... |
I have no time to provide code example. You should have the knowledge and skill to code right? Where to draw the dot: search It has calculated the position with What you need to do is simply have your image ready and put the image at position |
the drawCircles is in the renderer, i can't get it to subclass properly. i understand i can only switch the renderer of the chart and than it will draw the images but i can get it subclass from outside the library. |
you have to sub class the chart view and replace the renderer with yours. You are making customizations so expect a desent change and sub-class stuff will happen in your project, basically you will need to sub class everything you need to change. To me I think only sub class chart view and its renderer should be enough, and if you want more different images, sub class the dataSet and fill any image you want is also possible Take a look at how bar chart and line chart is sub classed from BarLineChartViewBase |
Hey guys I am curious about this as well! All i wanna do is to fill a select few holes. Im very new to customizing libraries, and im wondering, is this possible to to do without manipulating the Charts files? Im using Cocoapods and im wondering if i can do this with subclassing or if i gotta manually drag the Charts files over and then manipulate them :) I tried modifying like this: //class MyLineChartRenderer: but both are telling me '_xBounds' is inaccessible due to 'internal' protection level. If I can get access to the variables i can probably manage the rest by myself. But I have found very little info about modifying frameworks online :) EDIT: For anyone wondering, I ended up manually adding the framework to my project so that i could access the values i needed. I duplicated LineChartRenderer, calling the new one CustomLineChartRenderer, and made my customization through a global variable, and made sure to make LineChartView call CustomLineChartRenderer, and not the regular LineChartRenderer. Worked great! If anyone has a better way of doing this with cocoapods I would love to know :) |
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.
i don't need the marker to show image when it is selected i need a complete set of data values to show images instead of default circle/dot. in short i need to create a series of images instead of the default dots/circles for a set of data.
i really appreciate any help.
screenshot:
The text was updated successfully, but these errors were encountered: