0 votes

 I'm trying to use the line chart component with the date component, but it doesn't seem to want to chart the date. The code looks like this:

>> PQ = q1 + q2 + q3 + q4 + q5 + q6 + q7 + q8 + q9 
>> dateAnswered = calendar::date 
>> PQlist.add([dateAnswered,PQ]) 

Your procrastination quotient for today is {PQ}. 

*chart: Your Procrastination Quotient Over Time 
    *type: line 
    *data: PQlist

But the chart doesn't seem to know what to do with the date along the x-axis. How do I get it to recognize the date as text?

by (5.8k points)

1 Answer

0 votes
Best answer

It is a bit tricky to make charts work with dates as data.

To show the date on the chart we need to interpret it as a number, to show it in the label date needs to be interpreted as text.

An example in two versions: smart (keeps the distance between dates) and simple (treats all intervals as if they are the same).

Please check out the sample program: https://www.guidedtrack.com/programs/13640

(Hacky) date-to-number converter: https://www.guidedtrack.com/programs/13641

by (5.8k points)
selected by
Welcome to Guidedtrack Q&A, where you can ask questions and receive answers from other members of the community.
134 questions
144 answers
55 comments
40 users