Giter VIP home page Giter VIP logo

Comments (5)

hustcc avatar hustcc commented on July 1, 2024
  • paddingOuter 是整个柱形图区域的左右 padding。
  • paddingInner 是每根柱子在划分区域的占比,比如 0.5 就是一半柱子,一半空白。
chart.interval()
  .data(data)
  .encode('x', 'year')
  .encode('y', 'sales')
  .scale('x', { paddingOuter: 0.1, paddingInner: 0.3 });

from g2.

YY88Xu avatar YY88Xu commented on July 1, 2024

@hustcc 试了没有用啊,怎么设置柱子是 40px 柱子之间是60 啊
image

from g2.

hustcc avatar hustcc commented on July 1, 2024

@hustcc 试了没有用啊,怎么设置柱子是 40px 柱子之间是60 啊

image

只能 0-1 百分比设置,按照像素的话,需要通过画布大小,数据数量,计算出这个百分比。

from g2.

YY88Xu avatar YY88Xu commented on July 1, 2024

@hustcc 产品是这么设计的,柱子宽40px,两个柱子之间距离是 60px,能显示下就显示,显示不下x轴就出现 scrollbar,这能做到吗?

from g2.

YY88Xu avatar YY88Xu commented on July 1, 2024

@hustcc 设置了 scrollbar,柱子是 40px,设置 .scale('x', { paddingInner: 0.4}) 不起作用

from g2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.