Giter VIP home page Giter VIP logo

Comments (4)

hustcc avatar hustcc commented on July 20, 2024

对于折线图,label 的 position 参考位置是折线上的每个点,所以 position 无论设置什么,都是一个点。你需要设置的是 label 相对于这个点,怎么显示?是左对齐,还是右对齐,或者上下对齐方式,可以使用下面的方法:

chart.line().label({
  text: 'value',
  position:'left',
  textAlign: 'right',
  textBaseline: 'top',
});

from g2.

Calmio-Y avatar Calmio-Y commented on July 20, 2024

@hustcc
image
我这个配置 label 相对于这个点右对齐,图看着也不对啊

from g2.

hustcc avatar hustcc commented on July 20, 2024
  • textAign = right 意思是标签文本的右边对着那个数据点的 x
  • textBaseline = bottom 意思是标签文本的底部对着那个数据点 y

from g2.

Calmio-Y avatar Calmio-Y commented on July 20, 2024

@hustcc 明白了,谢谢

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.