Comments (10)
While you don't have any labels showing, I think the issue might be in the .xAxisLabels
. If you remove the modifier or change BarChartData -> chartStyle -> xAxisLabelsFrom
to .chartData()
then the issue should hopefully be resolve.
Thanks!
EDIT:
from swiftuicharts.
Wow many thanks! It worked: I changed xAxisLabelsFrom to .chartData().
from swiftuicharts.
With 96 Bars I now run into expected performance issues. Is there a way to call the .drawingGroup modifier to make use of Metal?
from swiftuicharts.
Glad its working.
Are these performace issues in the simulatior or on a real device; if on a device, which model?
from swiftuicharts.
I have them in the simulator and on the iPhone 12 mini. Not every time the view loads though.
from swiftuicharts.
Maybe it was worth adding the modifier if the data exceeds a certain number of elements?
from swiftuicharts.
At what point in the view hierarchy do you think it should be attached? Could you place it within your view?
from swiftuicharts.
I only have a Zstack with a RoundedRectangle and then the Chart on top -> Basic CardView.
I tried adding it on every point in my views, but it didn't change the behavior.
`
`var` body: some View {
ZStack{
RoundedRectangle(cornerRadius: /*@START_MENU_TOKEN@*/25.0/*@END_MENU_TOKEN@*/)
.fill(vm.backgroundColor)
if (chartData != nil) {
BarChart(chartData: vm.chartData)
.touchOverlay(chartData: chartData!)
.yAxisGrid(chartData: chartData!)
.xAxisLabels(chartData: chartData!)
.yAxisLabels(chartData: chartData!)
.headerBox(chartData: chartData!)
// .id(data.id)
.padding(20)
}
}
.frame(minWidth: 150, maxWidth: .infinity, minHeight: 150, idealHeight: 300, maxHeight: 300, alignment: .center)
.padding()
.onAppear(){
filter()
}
}`
Maybe one could add it to this ForEach? But I am really no experienced developer, this is just a guess.
from swiftuicharts.
Out of interest, what happens in the .onAppear
? I've seen other issues where the animation gets a bit glitchy if the data is changed in .onAppear
. See #57 (comment).
As far as I know, adding .drawingGroup()
to your ZStack should have pretty much the same effect as adding it in the library.
from swiftuicharts.
🙈 the onAppear was legacy stuff that I just forgot to remove. I did it now, but it's not changing anything.
I now only initialize the viewModel that calls a function in its init to create the datapoints. But this didn't lead to performance improvements.
Yeah I thought so, too but it didn't change anything at all. Maybe the problem is in the function.
Anyway thanks a lot for your support!
from swiftuicharts.
Related Issues (20)
- Usage of arrays of double
- No x-axis labels in macOS app
- Publishing changes from within view updates is not allowed HOT 3
- how to use custom y-axis labels HOT 1
- Any way to add panning
- Publishing changes from within view updates is not allowed, this will cause undefined behavior. HOT 5
- Labels Positioning Issue
- Library not behaving correctly for RTL, check the attached SS. HOT 1
- Negative Number Height of Bar Makes Transparent Color HOT 4
- Tap delegate is there? HOT 1
- Show the infobox when Tapping on the data points
- Axis values and floating Info box not localising values
- Animations in FilledLineChart are not aligned!!!!
- pod install HOT 1
- How to remove the additional centre y-axis line? HOT 5
- Get library compiling under visionOS HOT 1
- how to set a fixed count of five labels on the X-axis when we have more than 1000 data points
- Remove/Hide legend title and circle from floating info box
- can you add a function to save the chart to a PNG
- Grid style color change dynamically HOT 1
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 swiftuicharts.