Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] title's align: 'center' can not work for subtext, and the layout is not right #3614

Open
kkxxkk2019 opened this issue Dec 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kkxxkk2019
Copy link
Collaborator

Version

lastest

Link to Minimal Reproduction

none

Steps to Reproduce

bugserer case: https://bugserver.cn.goofy.app/case?product=chartspace4&fileid=676c0edef772c300b7d1bb5c

{
              type: 'bar',
              color: [
                '#e1f3f9',
                '#a1d8e9',
                '#41b3ce',
                '#3e839b',
                '#399487',
                '#a8d9c4',
                '#e5f5f0',
                '#ffd694',
                '#ffb82b',
                '#e8a01b'
              ],
              label: {
                visible: true,
                position: 'top',
                style: {
                  lineHeight: '100%',
                  lineWidth: 0,
                  fill: '#fff',
                  fontSize: 12
                }
              },
              xField: '_editor_dimension_field',
              yField: '_editor_value_field',
              seriesField: '_editor_dimension_field',
              title: {
                id: 'chart_title',
                visible: false,
                // minWidth: '100%',
                verticalAlign: 'middle',
                align: 'center',
                textStyle: {
                  fontSize: 36,
                  fontWeight: 'bolder',
                  fill: '#FFFFFF'
                },
                subtext: 'OCTOBER 2019',
                subtextStyle: {
                  visible: true,
                  fontSize: 14,
                  textBaseline: 'middle',
                  fill: '#FFFFFF',
                  align: 'center'
                },
                text: 'Top 10 Podcast Publishers in US'
              },
              axes: [
                {
                  orient: 'left',
                  id: 'axis-left',
                  type: 'linear',
                  label: {
                    autoLimit: false,
                    style: {
                      fill: '#FFFFFF',
                      fontSize: 16
                    },
                    formatConfig: {
                      separator: true
                    },
                    _originStyle: {
                      fill: '#FFFFFF',
                      fontSize: 16
                    }
                  },
                  domainLine: {
                    visible: true,
                    style: {
                      stroke: '#5f486f'
                    }
                  },
                  tick: {
                    visible: true,
                    style: {
                      stroke: '#685874'
                    }
                  },
                  grid: {
                    visible: false,
                    style: {
                      stroke: '#bbbfc4',
                      pickStrokeBuffer: 2
                    }
                  },
                  autoIndent: false,
                  maxWidth: null,
                  maxHeight: null,
                  min: '5000000',
                  title: {
                    style: {
                      background: null,
                      fill: '#FFFFFF'
                    },
                    text: ['Audience'],
                    visible: true
                  }
                },
                {
                  orient: 'bottom',
                  id: 'axis-bottom',
                  type: 'band',
                  label: {
                    autoLimit: false,
                    style: {
                      fill: '#1F2329',
                      fontSize: 16
                    },
                    formatConfig: {},
                    visible: false,
                    _originStyle: {
                      fill: '#1F2329',
                      fontSize: 16
                    }
                  },
                  domainLine: {
                    visible: true,
                    style: {
                      stroke: '#5f486f'
                    },
                    onZero: true
                  },
                  tick: {
                    visible: false,
                    style: {
                      stroke: '#000000'
                    }
                  },
                  grid: {
                    visible: false,
                    style: {
                      stroke: '#bbbfc4',
                      pickStrokeBuffer: 2
                    }
                  },
                  autoIndent: false,
                  maxWidth: null,
                  maxHeight: null,
                  trimPadding: false,
                  paddingInner: [0.2, 0],
                  paddingOuter: [0.2, 0],
                  title: {
                    style: {
                      fill: '#ffffff',
                      fontSize: 12,
                      fontStyle: '',
                      fontWeight: 'normal',
                      lineWidth: 1,
                      underline: 0
                    },
                    text: ['Podcast Publisher'],
                    visible: true
                  }
                }
              ],
              data: [
                {
                  id: '0',
                  sourceKey: 'value',
                  values: [
                    {
                      _editor_dimension_field: 'NPR',
                      _editor_value_field: 25923000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'iHeartRadio',
                      _editor_value_field: 23672000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'PRX',
                      _editor_value_field: 11878000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'New York Times',
                      _editor_value_field: 11878000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'Wondery',
                      _editor_value_field: 10849000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'Barstool Sports',
                      _editor_value_field: 9211000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'ESPN',
                      _editor_value_field: 8054000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'WNTC Studios',
                      _editor_value_field: 6764000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'NBC News',
                      _editor_value_field: 6438000,
                      _editor_type_field: 'value'
                    },
                    {
                      _editor_dimension_field: 'This American Life/Serial',
                      _editor_value_field: 5678000,
                      _editor_type_field: 'value'
                    }
                  ],
                  specField: {
                    _editor_dimension_field: {
                      type: 'dimension',
                      order: 0
                    },
                    _editor_type_field: {
                      type: 'series',
                      order: 0
                    },
                    _editor_value_field: {
                      type: 'value',
                      order: 0
                    }
                  }
                }
              ]
            }

Current Behavior

  1. 富文本没有居中
  2. 设置了 verticalAlign: 'middle' 正文和副文重叠
image

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@kkxxkk2019 kkxxkk2019 added the bug Something isn't working label Dec 25, 2024
@xile611 xile611 self-assigned this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants