I'm making a short film and using Flot to emulate financial graphs and I need help

26 views
Skip to first unread message

colin olkowski

unread,
May 11, 2020, 3:29:19 PM5/11/20
to Flot graphs
Hi All,

So, I'm using Flot's real time updates example and I cannot, for the life of me, figure out how to change the color of the x and y axis numbers.

Anyone have an idea of how to do this?

Thanks in advance.

Jonathan Meyer

unread,
May 11, 2020, 4:51:49 PM5/11/20
to Flot graphs
If you add the following CSS snippet to a CSS file you were importing, you should see the x-axis color change:

.flot-x-axis {
fill: rgba(255, 0, 0, 1);
}

You can also target specific axes by their labels (using the same class-based target). Note that this will just change the color of the major division labels (not the ticks or baseline). To change the ticks, you must setup the axes in flot to use a particular color like so:

$.plot("#placeholder", [...], {
xaxes: [ { color: "red" } ],
});

This is undoubtedly unintuitive, and it would be good to try and correct this holistically. I imagine the way ended up where it is had to do with the slow migration of rendering visuals using SVG that could leverage CSS more easily, and it stopped when the labels moved over to this system.

colin olkowski

unread,
May 11, 2020, 4:58:35 PM5/11/20
to Flot graphs
Thanks for responding!

Unfortunately your first example doesn't work.

.flot-x-axis {
fill: rgba(255, 0, 0, 1);
}

But I think there's a setting that I need to use, something that turns off canvas for labels...

I'm totally lost - Flot is great but somewhere along the line they really screwed up both the docs and clear examples of how everything works.

colin olkowski

unread,
May 11, 2020, 5:00:22 PM5/11/20
to Flot graphs
Wait! It worked! I screwed up and used x instead of Y.

THANK YOU SO MUCH!

Sorry to yell, but this is such a simple thing yet the docs really don't explain it very clearly (or pebkac).


On Monday, May 11, 2020 at 2:51:49 PM UTC-6, Jonathan Meyer wrote:

colin olkowski

unread,
May 11, 2020, 5:05:53 PM5/11/20
to Flot graphs
Wait! It worked! I screwed up and used x instead of Y.

THANK YOU SO MUCH!

Sorry to yell, but this is such a simple thing yet the docs really don't explain it very clearly (or pebkac).


Jonathan Meyer

unread,
May 11, 2020, 5:35:50 PM5/11/20
to jxcr0w via Flot graphs
👍

--

---
You received this message because you are subscribed to the Google Groups "Flot graphs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flot-graphs...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/flot-graphs/01a7ea77-8408-405d-8b1f-57f8c1c06dc7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages