Giter Club home page Giter Club logo

Comments (10)

willdale avatar willdale commented on June 3, 2024

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:

manyBars

from swiftuicharts.

tfeige91 avatar tfeige91 commented on June 3, 2024

Wow many thanks! It worked: I changed xAxisLabelsFrom to .chartData().

from swiftuicharts.

tfeige91 avatar tfeige91 commented on June 3, 2024

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.

willdale avatar willdale commented on June 3, 2024

Glad its working.

Are these performace issues in the simulatior or on a real device; if on a device, which model?

from swiftuicharts.

tfeige91 avatar tfeige91 commented on June 3, 2024

I have them in the simulator and on the iPhone 12 mini. Not every time the view loads though.

from swiftuicharts.

tfeige91 avatar tfeige91 commented on June 3, 2024

Maybe it was worth adding the modifier if the data exceeds a certain number of elements?

from swiftuicharts.

willdale avatar willdale commented on June 3, 2024

At what point in the view hierarchy do you think it should be attached? Could you place it within your view?

from swiftuicharts.

tfeige91 avatar tfeige91 commented on June 3, 2024

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.
image

from swiftuicharts.

willdale avatar willdale commented on June 3, 2024

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.

tfeige91 avatar tfeige91 commented on June 3, 2024

🙈 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.