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] seriesIndex not work in discrete legend #732

Closed
xiaoluoHe opened this issue Sep 1, 2023 · 0 comments · Fixed by #733
Closed

[Bug] seriesIndex not work in discrete legend #732

xiaoluoHe opened this issue Sep 1, 2023 · 0 comments · Fixed by #733
Assignees
Labels
bug Something isn't working online biz
Milestone

Comments

@xiaoluoHe
Copy link
Contributor

Version

1.3.0

Link to Minimal Reproduction

none

Steps to Reproduce

const spec = {
  type: 'common',
  padding: {
    top: 10
  },
  layout: {
    type: 'grid',
    col: 1,
    row: 6,
    elements: [
      {
        modelId: 'legend',
        col: 0,
        row: 4
      },
      {
        modelId: 'legend0',
        col: 0,
        row: 5
      },
      {
        modelId: 'DAU',
        col: 0,
        row: 0
      },
      {
        modelId: '新增',
        col: 0,
        row: 1
      },
      {
        modelId: 'MAU',
        col: 0,
        row: 2
      },
      {
        modelId: 'DAU/MAU',
        col: 0,
        row: 3
      }
    ]
  },
  region: [
    {
      id: 'DAU'
    },
    {
      id: '新增'
    },
    {
      id: 'MAU'
    },
    {
      id: 'DAU/MAU'
    }
  ],
  legends: [
    {
      visible: true,
      orient: 'bottom',
      id: 'legend',
      seriesId: ['DAUseries0', '新增series0', 'MAUseries0'],
      item: {
        visible: true,
        background: {
          style: {
            fill: 'transparent'
          }
        }
      }
    },
    {
      visible: true,
      orient: 'bottom',
      id: 'legend0',
      seriesId: ['DAU/MAUseries0'],  // only related to the last pie chart
      item: {
        visible: true,
        background: {
          style: {
            fill: 'transparent'
          }
        }
      }
    }
  ],
  series: [
    {
      id: 'DAUseries0',
      regionId: 'DAU',
      type: 'pie',
      valueField: 'value',
      categoryField: 'type',
      data: {
        id: 'DAU',
        values: [
          {
            type: '首页',
            value: 120
          },
          {
            type: '大屏',
            value: 100
          },
          {
            type: '看板',
            value: 200
          }
        ]
      },
      seriesField: 'type',
      label: {
        style: {
          visible: false
        }
      }
    },
    {
      id: '新增series0',
      regionId: '新增',
      type: 'pie',
      valueField: 'value',
      categoryField: 'type',
      data: {
        id: '新增',
        values: [
          {
            type: '首页',
            value: 80
          },
          {
            type: '大屏',
            value: 200
          },
          {
            type: '看板',
            value: 400
          }
        ]
      },
      seriesField: 'type',
      label: {
        style: {
          visible: false
        }
      }
    },
    {
      id: 'MAUseries0',
      regionId: 'MAU',
      type: 'pie',
      valueField: 'value',
      categoryField: 'type',
      data: {
        id: 'MAU',
        values: [
          {
            type: '首页',
            value: 123
          },
          {
            type: '大屏',
            value: 245
          },
          {
            type: '看板',
            value: 367
          }
        ]
      },
      seriesField: 'type',
      label: {
        style: {
          visible: false
        }
      }
    },
    {
      id: 'DAU/MAUseries0',
      regionId: 'DAU/MAU',
      type: 'pie',
      valueField: 'value',
      categoryField: 'type',
      data: {
        id: 'DAU/MAU',
        values: [
          {
            type: '首页1',
            value: 10
          },
          {
            type: '大屏1',
            value: 18
          },
          {
            type: '看板1',
            value: 8
          }
        ]
      },
      seriesField: 'type',
      label: {
        style: {
          visible: false
        }
      }
    }
  ]
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderAsync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

image

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@xiaoluoHe xiaoluoHe added the bug Something isn't working label Sep 1, 2023
@xiaoluoHe xiaoluoHe self-assigned this Sep 1, 2023
@xiaoluoHe xiaoluoHe added this to the v1.3.1 milestone Sep 1, 2023
@xiaoluoHe xiaoluoHe added the online biz label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working online biz
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant