Comments (25)
Found solution for spacing on xAxis
chartView.xAxis.spaceMin = 0.5
chartView.xAxis.spaceMax = 0.5
from charts.
Not the solution, but will help anyone who searches for how to remove the paddings:
chartView.xAxis.avoidFirstLastClippingEnabled = true
chartView.minOffset = 0
from charts.
@BurhanMughal Please, you are creating too much noise in the system. If there were new, you would have known. You are welcome to try to implement whatever feature is missing, or wait until someone else or I make it.
from charts.
Hi Guys,
Can someone point the exact configuration for LineChartView so it displays paddings from left and right ? @DevangiDesai I tried code below too, but with no luck. Is there any chance that some other configuration is overlapping this settings ?
chartView.xAxis.spaceMin = 0.5
chartView.xAxis.spaceMax = 0.5
from charts.
Sorry Daniel if you feel bad. But i was just looking to get informed that the issue is still in process because you closed this issue.
from charts.
tried @PhilJay suggestion but it's problematic when you have few entries...
from charts.
@PhilJay what do you think? do we have an easy way of "skipping" x-indexes?
from charts.
Well an easy workaround could be to use "" as the first x value and then insert the first entry at x index 1
from charts.
@msanders did that solve your problem?
from charts.
@danielgindi No, that insets it much more than I wanted. Is it not possible to add an inset property just for layout?
from charts.
Not right now - we'll have to look into it
from charts.
Any News about above mentioned issue ?
from charts.
@danielgindi Any thoughts as to how we could go about implementing this? Would it just be an update to ChartXAxisRenderer
?
from charts.
from charts.
Well it wouldn't be just about the XAxisRenderer as the other renders (the
chart renderers) would need the spacing also.
So I guess it would be in the ViewPort, but I did not have the time to look
into it yet, as we have other things on our plate :)
בתאריך יום רביעי, 13 במאי 2015, Daniel Cohen Gindi [email protected]
כתב:
I closed it earlier when there was no response to the suggestions
from charts.
Tried to analyze the ChartViewPortHandler.swift file in order to set the inset. So far without any success. It's hard to understand the code.
I tried to modify the _contentRect
, but this changes the size of the whole diagram. As a next step I will try to test different effects by changing the affine transformation.
Does someone can give me a short hint?
from charts.
speaking of view port handler, you need to think about the transformers. ios-charts need the transformer to calculate the postions. will adding slight offset in transformer help?
from charts.
did anyone try to change chartXMin so it will have slight offset at the beggining? I remember I tried once, and deltaX potentially impacts the offset on right side
from charts.
Implemented in Charts 3.0 (v3 branch) (Use axisMinValue
/axisMaxValue
)
from charts.
does it hold a property for that?
from charts.
spaceMin / spaceMax didn't work for me but adjusting axisMinValue / axisMaxValue slightly did.
from charts.
@DevangiDesai solution does work if you want to add padding on xAxis at right and left.
self.chartView.xAxis.spaceMin = 10; self.chartView.xAxis.spaceMax = 2;
Here's a preview for future viewers:
from charts.
Hi, this is an old issue, but I have a problem when I try to do this:
lineChartView.xAxis.valueFormatter = IndexAxisValueFormatter(values: model.months) lineChartView.xAxis.setLabelCount(model.months.count, force: true) lineChartView.xAxis.spaceMin = 0.2; lineChartView.xAxis.spaceMax = 0.2
the space is working, but I'm not being able to draw the twelve months, any idea?
from charts.
Today i faced the same problem as you guys. The methods to use are:
chartView.xAxis.spaceMin = 0.5
chartView.xAxis.spaceMax = 0.5
If you want it to work you have to set these properties before you set the data of the chart (at least i got it this way to work)
So for my project i did it this way:
let data = LineChartData(dataSet: dataSet)
chartView.xAxis.spaceMin = 0.2
chartView.xAxis.spaceMax = 0.2
chartView.data = data
I hope this helps someone in the future. Great library btw, i love it!
from charts.
Not the solution, but will help anyone who searches for how to remove the paddings:
chartView.xAxis.avoidFirstLastClippingEnabled = true chartView.minOffset = 0
Thank you @seriyvolk83, this solved the problem I was having!
from charts.
Related Issues (20)
- dyld[1596]: Library not loaded: /System/Library/Frameworks/Charts.framework/Charts HOT 1
- DGCharts Y-axis labels are not aligned to left
- LineChartRenderer.drawHighlighted crash HOT 2
- CandleStickChart auto scaling min/max is not working correctly
- HighLight bar disable unselected
- Candle Chart, Stick not visible as expected
- [Unknown process name] CGAffineTransformInvert: singular matrix
- No chart data available
- Not able to archive because 'No such file or directory 'PackageFrameworks/DGChartsDynamic.framework/DGChartsDynamic'' HOT 4
- Future of DGCharts? HOT 5
- Depreciated functions used in ChartColorTemplates HOT 1
- more colors with barchart HOT 1
- How to make stacked line chart?
- Creating Stacked Bar Chart How To Round Corner Radius Of Bar and How To Set DataPoints Background Color
- BarChart: highlight x-axis value when tapped HOT 1
- Incorrect scale of candlestick chart
- Y-axis max label is less than the highest Y-Value
- Library not loaded on physical device HOT 1
- crash animationUpdate() HOT 2
- Concurrency warning when conforming `ChartViewDelegate` with MainActor attribute.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from charts.