mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[big_number] fix subheader is missing (#1146)
This commit is contained in:
parent
d15a212e64
commit
32980a653c
@ -77,6 +77,17 @@ function bigNumberVis(slice) {
|
|||||||
.style('font-size', d3.min([height, width]) / 3.5)
|
.style('font-size', d3.min([height, width]) / 3.5)
|
||||||
.attr('fill', 'white');
|
.attr('fill', 'white');
|
||||||
|
|
||||||
|
// Printing big number subheader text
|
||||||
|
if (json.subheader !== null) {
|
||||||
|
g.append('text')
|
||||||
|
.attr('x', width / 2)
|
||||||
|
.attr('y', (height / 16) * 12)
|
||||||
|
.text(json.subheader)
|
||||||
|
.attr('id', 'subheader_text')
|
||||||
|
.style('font-size', d3.min([height, width]) / 8)
|
||||||
|
.style('text-anchor', 'middle');
|
||||||
|
}
|
||||||
|
|
||||||
if (fd.viz_type === 'big_number') {
|
if (fd.viz_type === 'big_number') {
|
||||||
// Drawing trend line
|
// Drawing trend line
|
||||||
|
|
||||||
@ -100,19 +111,6 @@ function bigNumberVis(slice) {
|
|||||||
|
|
||||||
const c = scaleColor(vCompare);
|
const c = scaleColor(vCompare);
|
||||||
|
|
||||||
// Printing big number subheader text
|
|
||||||
if (json.subheader !== null) {
|
|
||||||
g.append('text')
|
|
||||||
.attr('x', width / 2)
|
|
||||||
.attr('y', y + d3.min([height, width]) / 4.5)
|
|
||||||
.text(json.subheader)
|
|
||||||
.attr('id', 'subheader_text')
|
|
||||||
.style('font-size', d3.min([height, width]) / 16)
|
|
||||||
.style('text-anchor', 'middle')
|
|
||||||
.attr('fill', c)
|
|
||||||
.attr('stroke', c);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Printing compare %
|
// Printing compare %
|
||||||
if (vCompare !== null) {
|
if (vCompare !== null) {
|
||||||
g.append('text')
|
g.append('text')
|
||||||
|
Loading…
Reference in New Issue
Block a user