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

Interval min height #2

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Interval min height #2

merged 3 commits into from
Nov 3, 2023

Conversation

Runtus
Copy link

@Runtus Runtus commented Nov 3, 2023

Checklist

fixed antvis#5715

  • minHeight, maxHeight options
  • add test cases
  • add docs and demo
Description of change
  1. 由于macos m1系统问题,我这本地的测试依赖canvas没有适配的版本,稍后我补上测试。
  2. 由于之前的需求没有maxHeight,我把maxHeight给去除了。
import { Chart } from '@antv/g2';

 const chart = new Chart({ container: 'container' });
 chart.data([
    { genre: 'Sports', sold: 0 },
    { genre: 'Strategy', sold: 115 },
    { genre: 'Action', sold: 120 },
    { genre: 'Shooter', sold: 350 },
    { genre: 'Other', sold: 150 },
  ]);

  chart
    .interval()
    .encode('x', 'genre')
    .encode('y', 'sold')
    .encode('color', 'genre')
    .axis({ x: { animate: false }, y: { animate: false } })
    .style('draggable', true)
    .style('droppable', true)
    .style('minHeight', 50)
image-20231103165504129
  • 水平展示
 const chart = new Chart({ container: 'container' });
 chart.data([
    { genre: 'Sports', sold: 0 },
    { genre: 'Strategy', sold: 115 },
    { genre: 'Action', sold: 120 },
    { genre: 'Shooter', sold: 350 },
    { genre: 'Other', sold: 150 },
  ]);

chart.coordinate({ transform: [{ type: 'transpose' }] })

  chart
    .interval()
    .encode('x', 'genre')
    .encode('y', 'sold')
    .encode('color', 'genre')
    .axis({ x: { animate: false }, y: { animate: false } })
    .style('draggable', true)
    .style('droppable', true)
    .style('minHeight', 50)
image-20231103165655423

@Runtus
Copy link
Author

Runtus commented Nov 3, 2023

本地已经通过test生成了snapshot

@iamzone iamzone merged commit 922f647 into iamzone:interval-min-height Nov 3, 2023
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.

2 participants