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
2 changes: 1 addition & 1 deletion webapp/app/containers/Widget/render/chart/bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default function (chartProps: IChartProps, drillOptions) {
const metricAxisOption = getMetricAxisOption(
yAxis,
yAxisSplitLineConfig,
metrics.map((m) => decodeMetricName(m.name)).join(` / `),
metrics.map((m) => (m.field && m.field.alias) || decodeMetricName(m.name)).join(` / `),
'x',
percentage
)
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/containers/Widget/render/chart/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default function (chartProps: IChartProps, drillOptions?: any) {
yAxis: getMetricAxisOption(
yAxis,
yAxisSplitLineConfig,
metrics.map((m) => decodeMetricName(m.name)).join(` / `)
metrics.map((m) => (m.field && m.field.alias) || decodeMetricName(m.name)).join(` / `),
),
series,
tooltip: {
Expand Down
18 changes: 12 additions & 6 deletions webapp/app/containers/Widget/render/chart/parallel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,19 @@ export default function (chartProps: IChartProps) {
type: 'category',
data: dimensionsData.map((d) => d[idx]).filter((d, dIdx, arr) => arr.indexOf(d) === dIdx)
})),
...metrics.map((m, idx) => ({
dim: axisDimensions.length + idx,
name: showTitleAndUnit ? decodeMetricName(m.name) : '',
axisLabel: {
formatter: showLabel ? metricAxisLabelFormatter : ''
...metrics.map((m, idx) => {
let name = showTitleAndUnit ? decodeMetricName(m.name) : ''
if (!!m.field.alias) {
name = m.field.alias
}
}))
return {
dim: axisDimensions.length + idx,
name: name,
axisLabel: {
formatter: showLabel ? metricAxisLabelFormatter : ''
}
}
})
]

const legendOption = getLegendOption(legend, legendData)
Expand Down