Giter VIP home page Giter VIP logo

Comments (17)

kevinkhill avatar kevinkhill commented on May 11, 2024

If you could provide a gist for me, I'd be happy to take a look. I might have overlooked applying formats within the redraw method in lava.js

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

Okay check it out. I am focusing on the javascript function "drawSales()" which calls the "getAllStoresWeekSales()" function in the controller. The initial "getAllStoreSalesGraph()" function in the controller results in perfect formatting on the first draw.

https://gist.github.com/farr433/23a8b77febcf539976c9

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

hmmmmm, so I am seeing that the format blocks are added only on the first draw. When the you call the toJson() method on the datatable, the formats are not even included! You have found a bug I never thought to try and test. I will start looking into how to pass the formats along with the data and options so the lava.loadData() method can add them to the redraw.

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

You are awesome man, thanks for all of your hard work. I couldn't imagine testing a public package with all of weird combinations users would try!

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

So I got the formats to work on the ajax reload.... But broke the initial render in doing so. XD

I'm not guaranteeing a resolution tonight, or soon, as I am currently slammed at my real job, but I will keep working when I can.

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

Yeah no worries... I've got plenty of other things to work on in the meantime and wouldnt consider a "$" and "," formatting a high priority haha. Thanks again.

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

Actually, I think I got it. I'm going to push up a branch in a little bit with my fixes so you can test it in your app.

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

Yeah i have trouble walking away from  a bug or unworking code too lol. Just let me know. I'll be up.

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

Alrighty, if you want to switch your composer dep to dev-master and give it an update, it should be working. If it does, then I'll bump the version and tag it for all to enjoy :)

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

I also noticed a couple of things that I'd like to point out:

When a chart is created, via Lava::ColumnChart or others, it is stored internally in the volcano class (get it?) so you don't have to return it. When using the blade extensions, it pulls the charts from the volcano, or when using the Lava::render() method. It doesn't hurt anything, but saves some typing.

/* No need to assign this var */ $column = Lava::ColumnChart();
/* No need to return */ return $column

Also, in your json returning ajax methods, you don't need to recreate the chart. You can just create the datatable, create the columns and rows, and return it with toJson().

(as I wrote that last senence, I just got the idea to add a method to clear the table. Then maybe you only have to define its structure once, and assign rows as need via different ajax methods.)

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

Ah yes, it applied the formatting very nicely now. I had to make one small modification to get it to work. I had to add a closing </script> tag after "@columnchart('weekSales', 'chart_div'). Yeah sometimes when my code isn't working as expected I get flustered and start spitting code out and then go back and clean things up once it all makes sense. Thanks for everything!

image

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024
  • closing script tag. The comments keep deleting it.

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

did this commit not fix it? I realized I accidentally deleted the closing script tag.

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

I'll re-update real quick and check. I might of grabbed it a little early.

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

This is what I have currently though

image

from lavacharts.

farr433 avatar farr433 commented on May 11, 2024

Ah, yup I'm good now. I grabbed in between you closing the post and the post about updating composer. Awesome man, I can't thank you enough!

from lavacharts.

kevinkhill avatar kevinkhill commented on May 11, 2024

hahaha, no worries, I was quite puzzled. Happy to help! :)

from lavacharts.

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.