antvis/G2

legend marker 默认 shape 不符合 #4847

pearmini posted onGitHub

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

<img src="https://user-images.githubusercontent.com/49330279/228446110-0f213523-89ca-4507-9594-9beb987a4588.png" width=640 />

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 },
      },
    ],
  };
}

posted by pearmini about 2 years ago

image

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

posted by hustcc almost 2 years ago

image

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

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

posted by pearmini almost 2 years ago

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

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

posted by hustcc almost 2 years ago

related:https://github.com/antvis/G2/issues/4996 ,当前这个关闭了。

posted by hustcc almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests