Search code examples
javascriptflot

Flot (flot.js) only populated entries in legend


First, I want to apologise for any mistakes in asking the question properly according to the site rules, it's my first time doing it and I tried my best.

So I have the following issue:

Let's say I have that data (consider it - date / value):

enter image description here

I then init a chart with it, the only relevant option to that moment is:

 xaxis: { mode: "time" }

and I get the following result:

enter image description here

("Дек" == December)

Now my problem is that there are mid-day hours in the legend which I don't want. I want only days in it. I tried adding this to the xasis:

 tickSize: [1, "day"]

but it creates a legend entry for each day of the whole timespan (01.12, 02.12, 03.12 and so on to 06.12) and I want only the days for which I have some data present.


Solution

  • After a while spent in searching in documentation and google I found that there is actually another property for this:

      minTickSize: [1, "day"]
    

    That does the trick.