-
-
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
Start value from X-Axis #2646
Comments
check your |
hi @liuxuan30 ,
I'm just removing decimal value. |
I even tried to manually do as below, barChartView.leftAxis.valueFormatter = IndexAxisValueFormatter(values:["0","1","2","3","4","5"]) but result is same only. |
It's the value you passed into |
Let me clear my requirement once again. The "X-axis" will consists values of past 7 seven days, starting from today. And based on Days i have to shows number of request. I have to convert all values to "Double" for left Axis. But while showing i need to remove those extra decimal. So i'm using "forTailingZero" function. But whenever i pass that array for Left Axis values. It always start with one step up as shown in figure. Kindly, let me know if you still have any doubt. Thanks |
If you are asking about Y(left) axis, why your title is |
Several points:
This can be done by changing
I don't think you can pass that array for Left Axis values.. Y axis values are calculated by the library. You can set Long answer: if you data range is [0, n], the library by default will create the y axis range like [a,b] where a < 0 and b > n, to make the chart looks nicer and all your content is within the canvas. |
This can be done by changing valueFormatter properties, removing by yourself is too old school. modern value formatter is already very powerful. Left axis values are all Double already ==> Thanks, i will apply that. I don't think you can pass that array for Left Axis values.. Y axis values are calculated by the library. You can set axisMinimum = 0 for left axis in your case. Long answer: if you data range is [0, n], the library by default will create the y axis range like [a,b] where a < 0 and b > n, to make the chart looks nicer and all your content is within the canvas. ==> Yeah once i set my axisMin and axisMax values then the Y axis start at proper position. For this i saw one behaviour like if my values are between (0,5). Then Y-Axis shows values in decimal. So, for this i kept condition and works fine now.. Thanks for your help :) 👍 |
Hello,
I want to start my value from axis. But it always start with one step up.
Can you tell me, what am i doing wrong?
Thanks,
Gaurav
The text was updated successfully, but these errors were encountered: