I thought '7 days ago' was earliest and you wanted that on left side.
Code: Select all
startOnTick: false,
tickInterval: 24, // mark off days (24 hours)
tickWidth: 3,
labels: {
formatter: function() { // function to convert 'string' hours into days for x-axis labels
var hoursAgo=parseInt(this.value,10);
var daysAgo=hoursAgo/24;
//var dayNameArray=[],dayLabel;
//dayNameArray= metDayName("<#dayname>");
//dayLabel=dayNameArray[daysAgo]+' (Noon)';
var textAgo=(daysAgo==1)?daysAgo+' day ago':daysAgo+' days ago';// singular or plural
return textAgo;
//return dayLabel;
}
},
reversed: true
},
legend: {
determines what appears as labels on x axis. '
this.value' is the x-axis count from the left.
The '
reversed' property is true if the first value in your arrays is to be plotted on the right hand side, false if the y values are to be plotted left to right in the same order as they appear in the arrays declared for the
series.
I did originally start the design for you with days of week shown, but that was really complicated to do with my original most recent on left and I gave up. I have days of week shown on my test version at noon each day , but it is a messy solution as the commented out bits in my code above suggest, so I have not shared it and perhaps someone else has a neater solution.
tempe wrote:Okey so I moved reversed: true down a bit (below one brackets) and now its flipped to RHS. However now the scale is flipped wrong too xD. Well, Ill experiment with it :)
With my posting of my first version I mentioned positioning of brackets was very tricky. Whilst I cannot be absolutely certain all my brackets are correct, (EDITED rest of this posting in light of reply to above part of this posting) I was surprised to see that I had got that wrong, but thanks for letting me know I had made a mistake again.
Would those who download my version 3.1 be aware they need to apply the correction that you have applied by moving reversed: true to new position as shown in code example above (ignore extras that I have commented out about day names) and make change mentioned in next reply.
I have a busy few days now so I will not be doing any experimenting nor correcting of my zipped version 3.1.
You've now shown a tooltip successfully, you can match values shown in that tooltip against what you see if you use
View menu,
Data Logs option and load the
Aug14log.txt file.