Skip to content
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

How to show label on x-axis at regular interval and tail end on the graph line #2160

Closed
shivang2902 opened this issue Feb 14, 2017 · 9 comments

Comments

@shivang2902
Copy link

shivang2902 commented Feb 14, 2017

screen shot 2017-02-14 at 11 19 57 am
I am building the above graph by using the awesome Charts, but i am failing in few points -

  1. Show label on x-axis at regular interval
  2. Show tail end on the graph line

@danielgindi can you please help me on this, thanks

@liuxuan30
Copy link
Member

tail end needs you to override some methods to just draw the last circle.
for the labels - it's already showing labels at a regular interval. Not sure your meaning.

@shivang2902
Copy link
Author

@liuxuan30 this is the image of the graph i need to draw not what i have build, i am not able to show xAxis labels at regular interval. Please mention the methods i need to override to show tail end also the mechanism. I know i am asking a lot but believe me i have researched all over google for this solution, you are my last resort!!

Thanks in advance

@liuxuan30
Copy link
Member

to draw circles, there is method drawCircles() when highlight. You can refer that, and draw the tail circle in drawExtras() maybe. Just find a place you feel fine.

For the labels, please explain why you can't draw it in fixed interval. ChartsDemo already did that.

@shivang2902
Copy link
Author

screen shot 2017-02-28 at 7 10 11 pm

@danielgindi @liuxuan30 Can you please help me to remove the bottom line with continuous 0 in it. I am not sure what it is and what i have done to produce it but believe me i have removed and added each line of code 1 by 1 to debug it.

Thanks

@liuxuan30
Copy link
Member

liuxuan30 commented Mar 1, 2017

It looks like there are weird entries in your data. Can you check what's in your data?
If just the white line, try axisLine, gridLine, zeroLine etc to see whether you turned it on

@shivang2902
Copy link
Author

shivang2902 commented Mar 1, 2017

As i was debugging this error i came to know that whenever graph data contains all 0 values then this appears, it means the line is drawn on x-Axis and 0 appears just above the drawn line now can you please tell how to eliminate them

Thanks in advance :)

@shivang2902
Copy link
Author

//MARK: - Data Set Initial Setup
extension LineChartDataSet {

/* -------------- Line chart data set initial setup ----------------*/
func initialSetUp() {
    
    self.drawCirclesEnabled = false
    self.drawCircleHoleEnabled = false
    self.setColor(UIColor.orange)
    self.mode = .cubicBezier
    self.drawCirclesEnabled = false
    self.lineWidth = dataSetLineWidth
    self.circleRadius = dataSetCircleRadius
    self.drawHorizontalHighlightIndicatorEnabled = false
    self.cubicIntensity = dataSetCubicIntensity
    self.drawValuesEnabled = false     //  --------------->>>> THIS HELPED TO REMOVE THE ZERO'S
}

}

@shivang2902
Copy link
Author

shivang2902 commented Mar 7, 2017

@danielgindi @liuxuan30 is it possible to draw the tail small circle at the end of the line, i have tried but me was not successful, please guide, thanks

@liuxuan30
Copy link
Member

just override drawDataSets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants