Coder Social home page Coder Social logo

Comments (2)

junghwan-park avatar junghwan-park commented on April 28, 2024

안녕하세요

문의 주신 내용을 확인해 보니 tooltip template 적용시 내부에 한글이 포함되면 해당 한글 단어가 줄바뀜 되는 현상이 발생하는 것을 확인했습니다.

이 현상은 한글을 포함한 엘리먼트의 부모 엘리먼트 너비가 고정너비로 지정되지 않은 상태에서만 발생하는 것으로 보이는데요,
다음과 같이 wrapper 엘리먼트로 한번 감싸주고 그 wrapper에 'auto'가 아닌 고정 width를 주면 텍스트의 길이가 width보다 작은 한 한글로 된 단위도 값에 붙여서 표기가 됨을 확인 할 수 있습니다.

예제는 다음과 같습니다.

template: function(category, item) {
    var html =  '<div style="width:100px"><time class="date">' + category + '</time>'
        + '<strong class="count">' + item.value + '회' + '</strong></div>'

    return html;
}

윗 내용에 추가해서 말씀드리면 별개의 wrapper 엘리먼트로 감싸지 않고 strong 엘리먼트에 display: inline-block을 주는 방법도 있네요~

from tui.chart.

godori avatar godori commented on April 28, 2024

우선 답변 감사합니다!

횟수에 따라 툴팁 크기가 달라져야 해서
가능한 고정 크기를 주지 않으려 하였는데요,
글자 수에 따라 width를 바꿈으로써 해결했습니다.

한글은 왜 안되는 걸까요... 🤔

from tui.chart.

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.