Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/components/vanilla/charts/BarChart/BarChart.emb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export const meta = {
},
category: 'Configure chart'
},
{
name: 'metricNames',
type: 'string',
array: true,
label: 'Override Metric Names',
category: 'Configure chart'
},
{
name: 'sortBy',
type: 'dimensionOrMeasure',
Expand Down
4 changes: 2 additions & 2 deletions src/components/vanilla/charts/BarChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default (props: Props) => {
};

function chartData(props: Props): ChartData<'bar'> {
const { results, xAxis, metrics } = props;
const { results, xAxis, metrics, metricNames } = props;

const labels = [
...new Set(
Expand All @@ -81,7 +81,7 @@ function chartData(props: Props): ChartData<'bar'> {
maxBarThickness: 25,
minBarLength: 0,
borderRadius: 6,
label: metric.title,
label: (metricNames && metricNames[i]) || metric.title,
data: results?.data?.map((d) => parseFloat(d[metric.name])) || [],
backgroundColor: COLORS[i % COLORS.length]
})) || []
Expand Down