ivylabs / suitecrm-analytics

4 stars 4 forks source link

Average Call Duration, Stacked Bar Chart rendering Segment Order/Colours Inconsistently #289

Closed johnM2401 closed 3 years ago

johnM2401 commented 3 years ago

Quick Note Quick Note after our call at Fri 18th Jun, 1pm As we are toggling the "Stacked" option for these charts, this issue may no longer be viable. (Will depend on how the Bars generate after stacking is disabled)



Describe the bug On the Average Call Duration report, the Stacked Bar Chart appears to render inconsistently, depending on the Date Parameters used.

It appears as though the 3 Segments can render in a different order, with what seems to be no consistency/pattern

I understand why this is occurring, as the order appears to be dependant on the returned Data. However, after discussing with Ross/Evan, we agreed it would be good if this was consistent, if possible, for user experience.

See screenshots for examples.


**Component What component does this bug relate to?

  1. Report - Average Call Duration


**Solution File AverageCallDuration.prpt


To Reproduce Steps to reproduce the behavior:

  1. Contain Data in the CRM for this report. (ie, Calls against Leads/Opportunity/Cases), with one of these having notably more time allocated
  2. Pull this into the DWH via the ./run script
  3. Navigate to the Average Call Duration report
  4. Set the Date Parameters to contain the Calls that you created
  5. View the Stacked Bar chart's segments, and the order they are in
  6. Change the Date Parameters, ensuring the date range still contains your items
  7. The order of the Stacked Bar chart segments appear to change, which might be confusing to users


Expected behavior The Same order/Colours are associated to the Segments/Modules, on the Stacked Bar


Screenshots ie, If I do March-March, with my Dataset: image

The Largest segment, (Leads), is in the centre.

However, if I change the Date Parameters to March-May, the Largest Segment, (Leads), is at the bottom (Both Segments are associated to Leads) image

And If I choose March-July, the Largest Segment, (Leads), is at the top: image

While not a major functionality issue, I feel the inconsistency may be misleading/confusing to some users.


Desktop (please complete the following information):

harrisward commented 3 years ago

@johnM2401 Added an order by clause to keep the database sorted correctly and set the bar / line chart to stacked = false based on Fridays discussion.

harrisward commented 3 years ago

Feature Branch: https://github.com/ivylabs/suitecrm-analytics/tree/feature-289 Pull Request: https://github.com/ivylabs/suitecrm-analytics/pull/290

johnM2401 commented 3 years ago

Hey @harrisward,

Like #286, Wasn't sure if you wanted me to take a look at this separate from the Master branch, but I have had a look. Looks much better, able to differentiate the chart bars much easier.

However, one minor point of Feedback I have is that the Order of the bars does not match the Order of the columns

image

ie, The Chart bars are ordered: Leads - Opportunities - Cases Whereas the Report tables are ordered: Leads - Cases - Opportunities

I think it would be worth making these two match, for easier readability for users.

What are your thoughts?

harrisward commented 3 years ago

@johnM2401 I've reorder the columns to Cases, Leads and Opportunities.

Merged the code to the master branch

johnM2401 commented 3 years ago

Hey @harrisward

Pulled latest master. The Bars do seem to be ordered differently, but don't seem to be Cases->Leads->Opportunities

They now appear to be Opportunities->Cases->Leads

image

harrisward commented 3 years ago

Can you make sure you have refreshed everything? When I build from master I get the following:

image

johnM2401 commented 3 years ago

Hey @harrisward

So, I do see that order when using Demo Data: image

However, the order appears to be different using Live Data: image

harrisward commented 3 years ago

Hi @johnM2401 I've tried everything I can to recreate the issue my side including manually forcing the chart data but I can't reproduce the issue you are seeing. Im sure you have already tried but my only suggestion is to rebuild the whole server to make sure no caching exists anywhere. The latest output I get is in the screenshot below:

image

Because of this im going to put this ticket into backlog and take it out of the 1.4 release

johnM2401 commented 3 years ago

Hey @harrisward

hmmmm I typically rebuild the full server whenever I pull down from master, so it should be fairly cache-free

However, it seems like the chart may be cached to some extent in your screenshot? (Unless i've misread it?)

When I have the parameters: Call Period From: 2021-07 Call Period To: 2021-07

This is all I see: image

I don't believe I have any Call Data from 2019, as these are the options I have for parameters: image Where it looks like your chart is displaying a bunch of data from 2019


But, to confirm, this is what I see after a full re-build:

image

harrisward commented 3 years ago

@johnM2401 Thats okay its not cached. The data in the chart is not related to any real or demo data. Its is a dummy dataset to test the output of the chart if certain data is sent to it. I recreated the same structure as your dataset and got the results you see before.

As this is aesthetic im not too worried for fixing it in this release