Jquery Flot Chart timeseries option in reverse chronological

Does anybody know how to use the Flot timeseries in a reverse chronological way, to show the latest dates first? I've been ting to search for an option but couldn't find one in the API. Here is my code

var plot = $.plot("#placeholder1", [data], {
        series: {
                lines: { 
                    show: true, 
                    fill: 0.1
                },
                points: { show: true, 
                    fill: 0.05 }
        },
        xaxis: 
        {    
            mode: "time",
            minTickSize: [1, "day"],
            ticks:7 
        },
        grid: {             
            backgroundColor: { colors: [ "#fff", "#fff" ] },
            borderColor: "#ccc",
            borderWidth: {
                top: 1,
                right: 1,
                bottom: 1,
                left: 1
            },
            hoverable: true,
            clickable: true,
            markings: weekendAreas
        },
        legend: {
            labelBoxBorderColor: "#fff",
            position: "ne",
            margin: [0, 0]              
        }
    });

Answers


You can do this with an xaxis transform function:

    xaxis: {    
        mode: "time",
        minTickSize: [1, "day"],
        ticks: 7,
        transform: function (v) { return -v; }, // run it backwards
        inverseTransform: function (v) { return -v; }
    },

Here's a fiddle.


Need Your Help

Why Isn't There A Git Clone Specific Commit Option?

git git-clone

In light of a recent question on SO and a similar scenario at work, I am wondering why isn't there an option in git clone such that the HEAD pointer of the newly created branch will point to a spec...

How to access native word application progress bar using VSTO wordAddIn 2010 using C#

c#-4.0 ms-word vsto progress-bar add-in

Currently I'm a developing a word addIn using C#. I want to access native word application progress bar using my word addin code. Is there any way to get reference native progress bar object?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.