Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Timestamp on X axis chart
Katieee
<p>If I have a timestamp in my db - how can I display that on my bar chart to have the month and year with it on the x axis?</p>
<p> </p>
<p>the timestamp has a format of dd/mm/yy hh/mm</p>
Find more posts tagged with
Comments
JFreeman
<p>One way you could do this is through the use of a computed column. You can use some JavaScript to parse the date/time retrieved from your database into your desired format and then use that computed column as your x-axis.</p>
<p> </p>
<p>For example:</p>
<pre class="_prettyXprint _lang-js">
var date = row["Date"];
date = date.substring((date.indexOf("/") + 1), date.indexOf(" "));
date;
</pre>
<p>You should be able to convert this into a single line of code but I left it broken out for readabilities sake.</p>
<p> </p>
<p>I have also attached a sample report that demonstrates using this code.</p>