Make first metric be the last one rendered on compose generic charts
This commit is contained in:
parent
463934e9a5
commit
45b0c00580
@ -169,6 +169,9 @@ export default class Chart extends BaseChart {
|
|||||||
const tooltipFormatter = t?.formatting ? t.formatting : `{a}<br />{b} : {c}${relative ? ' ({d}%)' : ''}`
|
const tooltipFormatter = t?.formatting ? t.formatting : `{a}<br />{b} : {c}${relative ? ' ({d}%)' : ''}`
|
||||||
const labelFormatter = `{c}${relative ? ' ({d}%)' : ''}`
|
const labelFormatter = `{c}${relative ? ' ({d}%)' : ''}`
|
||||||
|
|
||||||
|
// We should render the first metric in the dataset as the last
|
||||||
|
const z = (datasets.length - 1) - index
|
||||||
|
|
||||||
if (['pie', 'doughnut'].includes(type)) {
|
if (['pie', 'doughnut'].includes(type)) {
|
||||||
const startRadius = type === 'doughnut' ? 40 : 0
|
const startRadius = type === 'doughnut' ? 40 : 0
|
||||||
|
|
||||||
@ -191,7 +194,7 @@ export default class Chart extends BaseChart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
z: index,
|
z,
|
||||||
name: label,
|
name: label,
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: [`${startRadius}%`, '80%'],
|
radius: [`${startRadius}%`, '80%'],
|
||||||
@ -250,7 +253,7 @@ export default class Chart extends BaseChart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
z: index,
|
z,
|
||||||
name: label,
|
name: label,
|
||||||
type: type,
|
type: type,
|
||||||
smooth: true,
|
smooth: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user