We need to do quite a lot of charting in our app and after evaluating
several libraries we've settled on Flot (for now at least :-)
So I was happy to discover there was already some Flot integrations in
Lift. After having looked a bit at this, it seems there are some things
missing that we would need:
1) Better support for barcharts (ie specifying data series as (label, value))
2) Support for pie charts (patches exists for the JS part)
But before diving into this I thought to ask if anybody is already
working on the flot widget (or has other ideas for the Flot stuff)
/Jeppe
> I've not spoken with Francois for some time, but I'll ask him next
> time he's online if he's able to make changes to the flot stuff. He's
> based in Chilli so should be online later on.
Thanks. I'm more than willing to spend some time on this (and share the
results :-) since we need it, but having the original author on board
would be most helpful.
/Jeppe
> Hi Jeppe
>
> Great to see you are interested in the flot widget.
>
> My current to-do list for the flot widget, is:
>
> - create more Lift JsExp and JsCmd to modify a already displayed flot
> graph. They should be used in AJAX and Comet applications
>
> - update to a more recent version of the javascrrit widget
I need this as well, especially since there are some patches that
provides pie charts
>
> - create the test demo app,
>
> - make the creation of FlotOptions, FlotLinesOptions, etc, less
> verbose. I hope that Scala 2.8 Named and Default Arguments will help.
Yeah, this would be nice :-) We probably need some working code within
the next few weeks so probably can't wait for 2.8 though.
> - create a high level mechanism to display Lift's Record
>
> I appreciate any help.
What's the best way to coordinate this? Just fork the code on github or?
/Jeppe
> Hi flot users,
>
> I am trying to copy the basic Flot example into my own code. I have no
> compile errors but the graph isn't rendered because /classpath/flot/
> jquery.flot.js isn't found. Since I get no errors with the flot
> methods in my snippet, I assume lift-widgets is loading correctly. Am
> I missing something?
Did you put a call to net.liftweb.widgets.flot.Flot.init in Boot?
This is needed to make the javascript resources available...
/Jeppe
> Thanks, Jeppe, that's what I was missing.
>
> To continue to hijack this thread with my own questions, I'm having a
> problem creating the data List[(Double, Double)] that FlotSerie wants.
> I have:
> override val data = MyModel.findAll(By(MyMode.id, myId), OrderBy
> (MyModel.datetime, Ascending)).map(m => (m.datetime.getTime.toDouble,
> m.temperature.toDouble))
If m.temperature is a MappedDouble you probably need m.temperature.is
The toDouble method converts an Any to a double, not the value of the
current mapped object.....
/Jeppe
Cheers, Tim
> Hello everyone involved,
> I am having a very annoying problem with the Flot widget: The
> automatically generated legend's auto-sizing feature is broken (it
> grows horizontally to the max allowed space while still adhering to
> the margin values specified, and it's not possible to create an
> external, custom legend) as demonstrated by this screenshot:
> http://bit.ly/uKE9o
>
> This bug is present in 1.1-M1 as well as 1.1-SNAPSHOT, isn't caused by
> me (since it is present int he demo app) and seems to originate from
> something on the client-side (obviously).
>
> Does anyone have a solution to this problem, or if not, can I make a
> fork of the widgets module, try to fix the problem, and commit it
> back? This little inconvenience removes much of the visual quality of
> plots, so a solution to it would be very much appreciated.
I haven't looked in detail but: Is this a problem with the widget or the
Flot library? As far as I know, the widget is just a thin wrapper on top
of the Flot JS library. If it's a problem with the JS, you should
probably try to fix this upstream: http://code.google.com/p/flot/
/Jeppe
Make sure you're trying to plot the same data with the same plot options.....
> I am at a loss to find the bug causing all this. The whole Flot widget
> seems to be very messy (it consists of 30% commented-away code, for
> instance) and I would be happy to help improve it once and for all,
> since I'm in need of the Flot library for a project.
I'm basically in the same boat and will probably clone the
lift-widgets module on github and work from there (I'm not a Lift
committer). I hope Francois will then commit the changes to Lift at
some point :-) I think we should coordinate the effort to avoid
wasting resources. Let me know what you think....
/Jeppe
If you want changes made to the flot widgets, please let us know what
exactly needs changing and we'll get it done. By all means, please don't
feel you are out in the cold!
Cheers, Tim
Hi Tim,
Personally, I don't feel left out in the cold :-) On the contrary,
people in this community seem very willing to listen to (and
implement) requests for new functionality.
On the other hand, I realize that my issues are not necessarily top
priority for others. So I'm willing to spend some time to fix my
issues (since I need them fixed now) and share the changes back where
possible.......
/Jeppe