Skip to content

Code Insights: Adjust label chart layouts for particular insight charts

Created by: vovakulikov

Follow up for https://github.com/sourcegraph/sourcegraph/pull/39805

Background

In https://github.com/sourcegraph/sourcegraph/pull/39805 we added a few new options to how we can position axis labels on the chart. See https://github.com/sourcegraph/sourcegraph/pull/39805#issuecomment-1204030258

In this issue we should decide how exactly we want to apply these options for compute powered and aggregations on the search page insights charts.

From @felixfbecker in https://github.com/sourcegraph/sourcegraph/pull/39805

To me it makes more sense to omit bars and labels at the tail end (low numbers = less important), than to hide the labels for every second bar, because they are usually sorted in descending importance. So seeing the label for bar 2 and 4 is very important, but would be hidden in approach (3).

I also think we should consider not showing the legend by default. I don't see much value from it for the space it takes up, considering it duplicates text from the labels and only shows a few points above the fold. The legend usually describes the different series names, but here weirdly it describes each data point (it's a list of each X value), which is unusual. For 4.0, we want to disable multiple series for group insight types, so the legend isn't necessary even if it was showing series.

Hiding the legend may solve the problem already if we keep the number of bars the same.

/cc @joelkw @felixfbecker @vovakulikov @unclejustin