Solid points, not hollow ones

1,409 views
Skip to first unread message

Adam Price

unread,
Oct 2, 2012, 10:27:12 PM10/2/12
to flot-...@googlegroups.com
Hi,

I'm currently displaying several series in a single plot using points.  The points, by default, are hollow.  In other words, they are little circles instead of solid points on the graph.  I want to get the points solid, but am not sure how to achieve this.  In jquery.flot.js, the line: fillColor: "#ffffff", tells me that the fill color is white, which makes sense as to why the points seem 'hollow.'  Its not so simple though to just specify a color, because I am using multiple series in the same plot and each series needs to be filled with its own respective color.   

tl;dr: How do I make my plot points solid while maintaining the right colors for each series?


Thanks very much in advance to anyone who can shed some light on this!

Shailesh Mangal

unread,
Oct 2, 2012, 11:52:23 PM10/2/12
to flot-...@googlegroups.com
You can fill your points, add following to your chart options (change radius as it suits)

points: {show:true, fill:true, radius:2}

------------------------------------------------------------------------------------------------------

Shailesh Mangal

 
Zephyr Enterprise: Real-Time Test Management
Zephyr for JIRA: All your testing, inside JIRA. Finally!

Adam Price

unread,
Oct 3, 2012, 12:04:15 AM10/3/12
to flot-...@googlegroups.com
I've tried this.  It only fills it with white, every series is filled with white.

Shailesh Mangal

unread,
Oct 3, 2012, 12:43:52 AM10/3/12
to flot-...@googlegroups.com
Even if you have color array in the option (one for each series)

colors:["#A5EB84", "#A5EB84"]

--  Shailesh

Adam Price

unread,
Oct 3, 2012, 3:05:38 AM10/3/12
to flot-...@googlegroups.com
Yeah.  I made some other changes to be sure things were taking effect properly.  I can adjust the radius or colors for instance. Here is my code and a picture of the result.

colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
...
 points: {
  show: true,
           fill: true
  },
...
also, from jquery.flot.js:
points: {
                        show: true,
                        radius: 3,
                        lineWidth: 2, // in pixels
                        fill: true,
                        fillColor: "#ffffff",
                        symbol: "circle" // or callback
                    },



See how all of them are filled with white? (#ffffff).

The API says this about fill coloring for points:
fill {Boolean|Number}
If set to true (the default) then points in this series are filled in with the fillColor if set or the colour of the current series if not.
fillColor {[Color][api-documentation-colours]}
The colour used to fill in series points. Unlike lines.fillColor, this cannot be used to specify a gradient. The default value is white. If not specified, the series colour is used to fill in the point.

So I assumed that if I didn't define a fill color and set fill to false, then the series color would be used.  What happens in that case is there is just no fill color, as if fill=transparent.  So you see whatever color the background color for the plot is.  I tried every variation of parameters I could think of that might be effective, but what I get is either white fill, or no fill at all.  never solid.  

Also, I'm using version 0.7.

Anyhow, thanks for your help so far.  I hope this post provides some useful information about the issue I'm experiencing.  

DNS

unread,
Oct 3, 2012, 10:18:05 AM10/3/12
to flot-...@googlegroups.com
I haven't checked this myself, but it sounds like a bug.  I'd check to see whether you still get the same behavior in 0.8a, since there have been a bunch of fixes since 0.7.  If it's still broken, please open a new issue on Github and I'll take a look at it.

dip.f...@gmail.com

unread,
Oct 13, 2015, 10:45:34 AM10/13/15
to Flot graphs
Though its very late still i thought i should reply, having faced the same issue.

Debugging the code, i could get solid points from series color by using the following combination of parameters for "points" option:

points: {
    show: true,
    fill: true,
    fillColor: false
}

Hope this helps somebody.
Reply all
Reply to author
Forward
0 new messages