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

fix(line-xy): support bandOffset #5351

Merged
merged 1 commit into from
Jul 27, 2023
Merged

fix(line-xy): support bandOffset #5351

merged 1 commit into from
Jul 27, 2023

Conversation

pearmini
Copy link
Member

@pearmini pearmini commented Jul 27, 2023

LineX/LineY

支持设置 bandOffset,别的 Mark 都加了对应的能力,lineX 和 lineY 需要补充。(close: #5348)

开始使用

export function settleWeatherCellLineXY(): G2Spec {
  return {
    type: 'view',
    height: 325,
    children: [
      {
        type: 'cell',
        data: {
          type: 'fetch',
          value: 'data/seattle-weather.csv',
        },
        encode: {
          x: (d) => new Date(d.date).getUTCDate(),
          y: (d) => new Date(d.date).getUTCMonth(),
          color: 'temp_max',
        },
        transform: [{ type: 'group', color: 'max' }],
        style: { inset: 0.5 },
      },
      {
        type: 'lineY',
        data: [4],
        style: { stroke: 'red', strokeWidth: 4, bandOffset: 0.5 }, //  设置 bandOffset
      },
      {
        type: 'lineX',
        data: [4],
        style: { stroke: 'red', strokeWidth: 4, bandOffset: 0.5 }, // 设置 bandOffset
      },
    ],
  };
}

@pearmini pearmini requested review from hustcc and xiaoiver July 27, 2023 09:50
@pearmini pearmini merged commit 0851471 into v5 Jul 27, 2023
2 of 3 checks passed
@pearmini pearmini deleted the fix/line-xy-offset branch July 27, 2023 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[V5] lineX 偏移量无法设置
2 participants