GLQL copy contents action does not work correctly on lineChart & columnChart

Problem to solve

When a GLQL embedded view has display: lineChart or display: columnChart then the Copy contents action produces a string output that is not in a easily human readable format. Other GLQL display types do not have the same problem.

Demo

Try it using the live views.

display: columnChart
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
dimensions: language
metrics: totalCount, acceptedCount, usersCount
sort: totalCount desc
display: lineChart
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
dimensions: language
metrics: totalCount, acceptedCount, usersCount
sort: totalCount desc

Current experience

**CountLanguage**10K20K30K40K30K20K10Krubyjsgopythontskotlinrustjavacsharpc

Total count

Accepted count

Users count

Note: Faked the actual counts to be SAFE.

Expected results

Copies the chart data in a human readable format so that it can be easily used in any context.

Proposed solution

Copied chart data should be in either CSV or HTML table format. Metric labels should be preserved.

Additional considerations

Somewhat related issues with other types that could be separate issues / MRs:

  • list & orderedList: Does not render metric labels nor includes them in the clipboard contents.
  • stat: Renders the label, but does not include it in the clipboard contents.
Click to see demo of other chart types
display: list
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
dimensions: language
metrics: totalCount, acceptedCount, usersCount
sort: totalCount desc
display: orderedList
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
dimensions: language
metrics: totalCount, acceptedCount, usersCount
sort: totalCount desc
display: table
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
dimensions: language
metrics: totalCount, acceptedCount, usersCount
sort: totalCount desc
display: stat
mode: analytics
title: "Code Suggestions Adoption by Language"
query: type = CodeSuggestion and timestamp >= -3m and group = "gitlab-org"
metrics: totalCount
sort: totalCount desc
Edited by Robert Hunt