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

view.labelTransform 不生效 #4633

Closed
pearmini opened this issue Feb 9, 2023 · 0 comments · Fixed by #4644
Closed

view.labelTransform 不生效 #4633

pearmini opened this issue Feb 9, 2023 · 0 comments · Fixed by #4644
Labels
Milestone

Comments

@pearmini
Copy link
Member

pearmini commented Feb 9, 2023

  • 版本:5.0.0-beta.9
import { G2Spec } from '../../../src';
import { weather } from '../../data/weather';

export function weatherLineMultiAxes(): G2Spec {
  return {
    type: 'view',
    data: weather,
    labelTransform: [{ type: 'overlapDodgeY' }],
    children: [
      {
        type: 'line',
        encode: {
          x: 'Month',
          y: 'Temperature',
          color: '#EE6666',
          shape: 'smooth',
        },
        scale: {
          y: { independent: true, domainMax: 30 },
        },
        labels: [{ text: 'Temperature' }],
        axis: {
          y: {
            titleFill: '#EE6666',
            title: 'Temperature (°C)',
            grid: null,
          },
        },
      },
      {
        type: 'line',
        encode: {
          x: 'Month',
          y: 'Precipitation',
          color: '#91CC75',
        },
        scale: {
          y: { independent: true },
        },
        style: {
          lineWidth: 2,
          lineDash: [2, 2],
        },
        labels: [{ text: 'Precipitation' }],
        axis: {
          y: {
            position: 'right',
            titleFill: '#91CC75',
            title: 'Precipitation (ml)',
            grid: null,
          },
        },
      },
    ],
  };
}
@pearmini pearmini added this to the 5.0.0-beta.10 milestone Feb 9, 2023
@pearmini pearmini linked a pull request Feb 13, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant