[OutSystems Charts] Line Graph: Don't display last record and incorrect tooltips

Forge Component
(10)
Published on 4 May (3 weeks ago) by OutSystems R&D
10 votes
Published on 4 May (3 weeks ago) by OutSystems R&D

Line Graph: Don't display last record and incorrect tooltips

I have selected data between 1-Apr-20 to 1-May-20 but on the graph

  1. display data only from 1-Apr-20 to 30-Apr-20, no 1-May-20, can see from query testing
  2. on Tooltip display incorrect date, rather tan display 30-Apr-20 but 30-May-20 instead.

Solution

Hi Sakchai,


this looks like a bug to me.  For both mobile and reactive I can recreate your problem : the first and last tooltip are both a month too large, values get tooltips with the previous date (value in db for 17th of april are shown in graph with tooltip of 16th of april) and the datapoint is drawn slightly to the left of the label.  (which you pointed out in your other post)

The reason of all of this is, I think, a bug in the bit of logic that interpretes the labels you send into the widget.  If OS Chart widget code thinks this is a date, it will try to do all kinds of nice things with it ( such as turning the label from '2020-04-17' to '17.Apr', and aligning the ticks on the x axis with the data points.


If you feel so inclined, you could enter a bug report with OS.  An easy workaround is constructing the tooltip yourself.

I have a value of 2 on the 15th of April in my database, this is the standard chart, it shows the value of 2 only very slightly to the left of the 15 Apr tick, I can live with that, but it shows a wrong date in the tooltip.



If you add tooltip text yourself :


you will get the correct date :


Good Luck,

Dorine

Solution

Dorine Boudry wrote:

Hi Sakchai,


this looks like a bug to me.  For both mobile and reactive I can recreate your problem : the first and last tooltip are both a month too large, values get tooltips with the previous date (value in db for 17th of april are shown in graph with tooltip of 16th of april) and the datapoint is drawn slightly to the left of the label.  (which you pointed out in your other post)

The reason of all of this is, I think, a bug in the bit of logic that interpretes the labels you send into the widget.  If OS Chart widget code thinks this is a date, it will try to do all kinds of nice things with it ( such as turning the label from '2020-04-17' to '17.Apr', and aligning the ticks on the x axis with the data points.


If you feel so inclined, you could enter a bug report with OS.  An easy workaround is constructing the tooltip yourself.

I have a value of 2 on the 15th of April in my database, this is the standard chart, it shows the value of 2 only very slightly to the left of the 15 Apr tick, I can live with that, but it shows a wrong date in the tooltip.



If you add tooltip text yourself :


you will get the correct date :


Good Luck,

Dorine

Hi Dorine,

You are right. It was caused by Tooltip, I re-check tooltip and my data and found that tooltip showed incorrect date. When I forced to display tooltip as your suggestion and now it's work.

Thank you very much : )

Sakchai