Fixed today vertical line by setting time to 0:00.

This commit is contained in:
Alexis Lahouze 2013-01-13 09:50:15 +01:00
parent e712c9fb6a
commit 7e8fd0a410

View File

@ -1,3 +1,4 @@
// Entry object
function entry(data){ function entry(data){
this.id=ko.observable(ko.utils.unwrapObservable(data.id)); this.id=ko.observable(ko.utils.unwrapObservable(data.id));
this.value_date=ko.observable(ko.utils.unwrapObservable(data.value_date)); this.value_date=ko.observable(ko.utils.unwrapObservable(data.value_date));
@ -383,6 +384,10 @@ drawChart = function(entries, element) {
chartValues[0] = entries; chartValues[0] = entries;
var today = new Date();
today.setHours(0);
today.setMinutes(0);
// plot chart // plot chart
window.chart = $.jqplot(element.id, chartValues, { window.chart = $.jqplot(element.id, chartValues, {
title: "Évolution du solde", title: "Évolution du solde",
@ -419,7 +424,7 @@ drawChart = function(entries, element) {
}}, }},
{ dashedVerticalLine: { { dashedVerticalLine: {
name: "today", name: "today",
x: new Date(), x: today,
lineWidth: 1, lineWidth: 1,
color: "gray", color: "gray",
shadow: false shadow: false