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

legend marker 默认 shape 不符合 #4847

Closed
pearmini opened this issue Mar 29, 2023 · 5 comments
Closed

legend marker 默认 shape 不符合 #4847

pearmini opened this issue Mar 29, 2023 · 5 comments
Assignees
Labels

Comments

@pearmini
Copy link
Member

测试案例在这:__tests__/plots/static/score-by-item-area-radar.ts

import { G2Spec } from '../../../src';
import { scoreByItem } from '../../data/score-by-item';

export function scoreByItemAreaRadar(): G2Spec {
  return {
    type: 'view',
    data: scoreByItem,
    coordinate: { type: 'polar' },
    axis: {
      x: { grid: true },
      y: { zIndex: 1, title: false, direction: 'center' },
    },
    scale: {
      x: { padding: 0.5, align: 0 },
      y: { tickCount: 5 },
    },
    legend: { color: { layout: { justifyContent: 'flex-start' } } },
    children: [
      {
        type: 'area',
        encode: { x: 'item', y: 'score', color: 'type' },
        style: { fillOpacity: 0.5 },
      },
      {
        type: 'line',
        encode: { x: 'item', y: 'score', color: 'type' },
        style: { lineWidth: 2 },
      },
    ],
  };
}
@pearmini
Copy link
Member Author

4.0 中 area 的 default maker 是 square:https://g2-v4.antv.vision/zh/examples/area/stacked#stacked

@hustcc
Copy link
Member

hustcc commented May 10, 2023

image

这个问题已经修复了,但是 tooltip 中有类似的问题。

@pearmini
Copy link
Member Author

image

这个问题已经修复了,但是 tooltip 中有类似的问题。

这个也许得调整 shape 接口:可以绑定 marker, 并且用 SVG path string 描述,这样 html 和 canvas 都可以使用。

@hustcc
Copy link
Member

hustcc commented May 10, 2023

这个也许得调整 shape 接口:可以绑定 marker, 并且用 SVG path string 描述,这样 html 和 canvas 都可以使用。

至少得内置几种 marker,自定义都是很复杂的,无论是用 svg path string 还是 dom。

@hustcc
Copy link
Member

hustcc commented May 10, 2023

related:#4996 ,当前这个关闭了。

@hustcc hustcc closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants