根据日期显示jquery图数据

I am using jQuery flot for plotting graphs in my PHP page. My page retrieves data from PostgreSQL database and plot the values on the graph having date on x axis and cost on y axis.

Problem Statement: I have data according to julian date in my db but it may not be starting from 1st day of the month. Now my plot shows data for 30 days of the month and I want to plot the values retrieved from db on correct coordinate and not from starting of the x axis coordinate 0. The days previous to the one retieved from db should show 0 or no values.

Requirement: Any logic for displaying this data dynamically on correct coordinate as the plot function exposed by jQuery flot requires manual mapping of coordinates and values.

I'm not sure if I understand your question, does this help?

j$.plot(j$("#placeholder"),[d1],{
        xaxis: 
        { mode: "time", 
            min: <?php echo $start_data;?>,
            max: 30
            }
 }