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] pie chart extension mark not effect #1610

Closed
skie1997 opened this issue Nov 24, 2023 · 0 comments · Fixed by #1616
Closed

[Bug] pie chart extension mark not effect #1610

skie1997 opened this issue Nov 24, 2023 · 0 comments · Fixed by #1616
Assignees
Labels
bug Something isn't working

Comments

@skie1997
Copy link
Contributor

Version

1.6.3

Link to Minimal Reproduction

vscreen

Steps to Reproduce

let maxRadius = 0
let minRadius = 0

const spec = {
  type: 'pie',
  data: [
    {
      id: 'id0',
      values: [
        { type: 'oxygen', value: '46.60' },
        { type: 'silicon', value: '27.72' },
        { type: 'aluminum', value: '8.13' },
        { type: 'iron', value: '5' },
        { type: 'calcium', value: '3.63' },
        { type: 'sodium', value: '2.83' },
        { type: 'potassium', value: '2.59' },
        { type: 'others', value: '3.5' }
      ]
    }
  ],
  innerRadius: 0.5,
  outerRadius: 0.8,
  valueField: 'value',
  categoryField: 'type',
  title: {
    visible: true,
    text: 'Statistics of Surface Element Content'
  },
  legends: {
    visible: true,
    orient: 'left'
  },
  label: {
    visible: true
  },
  tooltip: {
    mark: {
      content: [
        {
          key: datum => datum['type'],
          value: datum => datum['value'] + '%'
        }
      ]
    }
  },
  extensionMark: [
         {
        name: 'arc_inner_shadow',
        type: 'arc',
        dataId: 'id0',
        style: {
          interactive: false,
          innerRadius: 20,
          outerRadius: 30,
          fillOpacity: 0.3,
          fill: 'red',
          visible: true
        },
      },
      // {
      //   name: 'arc_inner_shadow',
      //   type: 'arc',
      //   dataId: 'id0',
      //   style: {
      //     interactive: false,
      //     innerRadius: (datum, ctx, elements, dataView) => {
      //       console.log('datum', datum, ctx, ctx.getLayoutRadius())
      //       if (datum.outerRadius > maxRadius) maxRadius = datum.outerRadius
      //       return datum.innerRadius - 10
      //     },
      //     outerRadius: datum => {
      //       minRadius = datum.innerRadius
      //       return datum.innerRadius
      //     },
      //     fillOpacity: 0.3,
      //   },
      // },
      // {
      //   name: 'arc_inner',
      //   type: 'symbol',
      //   from: {
      //     mark: 'pie',
      //   },
      //   spec: {
      //     interactive: false,
      //     normal: {
      //       size: datum => minRadius - 20,
      //       fillOpacity: 0,
      //       strokeWidth: 0.5,
      //       strokeOpacity: 0.3,
      //       strokeGradient: {
      //         type: 'conical',
      //         startAngle: 0,
      //         endAngle: 359,
      //         stops: [
      //           {
      //             offset: 0,
      //             color: '#FFF',
      //             opacity: 0,
      //           },
      //           {
      //             offset: 1,
      //             color: '#FFF',
      //             opacity: 1,
      //           },
      //         ],
      //       },
      //     },
      //   },
      // },
      // {
      //   name: 'arc_outer',
      //   type: 'symbol',
      //   from: {
      //     mark: 'pie',
      //   },
      //   spec: {
      //     interactive: false,
      //     normal: {
      //       size: datum => maxRadius + 20,
      //       fillOpacity: 0,
      //       strokeWidth: 0.5,
      //       strokeOpacity: 0.3,
      //       rotate: 20,
      //       strokeGradient: {
      //         type: 'conical',
      //         startAngle: 0,
      //         endAngle: 359,
      //         stops: [
      //           {
      //             offset: 0,
      //             color: '#FFF',
      //             opacity: 1,
      //           },
      //           {
      //             offset: 1,
      //             color: '#FFF',
      //             opacity: 1,
      //           },
      //         ],
      //       },
      //     },
      //   },
      // },
    ]
};

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

@skie1997 skie1997 added the bug Something isn't working label Nov 24, 2023
@skie1997 skie1997 self-assigned this Nov 24, 2023
skie1997 added a commit that referenced this issue Nov 27, 2023
@skie1997 skie1997 mentioned this issue Nov 27, 2023
20 tasks
kkxxkk2019 pushed a commit that referenced this issue Nov 28, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant