juijs / jui-chart

SVG-based JUI chart that can be used in the browser and Node.js. Support many types of charts. (Dashboard, Map, Topology, Full 3D, Realtime)
https://codepen.io/collection/nLydod/
57 stars 25 forks source link

line 차트를 쓰고 있는데. dispaly:'max' 옵션을 사용하는데. #126

Closed ytechinfo closed 7 years ago

ytechinfo commented 7 years ago

line 차트를 쓰고 있는데. dispaly:'max' 옵션을 사용하는데.

max 값이 양끝쪽이나 위쪽에 붙으면 값이 잘려서 보이고 있습니다 다 보이게 할려면 어떻해 해야될까요 ?

아래는 테스트 코드 입니다.

var chart = jui.include("chart.builder");
var data = [
    { apple : 26.1, microsoft : 24.86, oracle : 22.08 },
    { apple : 43.83, microsoft : 27.14, oracle : 30.15 },
    { apple : 55.03, microsoft : 24, oracle : 36.88 },
    { apple : 72.95, microsoft : 25.39, oracle : 32.78 }
];

chart("#result", {
    axis : {
        x : {
            type : "fullblock",
            domain : [ "2010", "2011", "2012", "2013" ],
            line : true
        },
        y : {
            type : "range",
            domain : function(d) {
                return Math.max(d.apple, d.microsoft, d.oracle);
            },
            step : 10
        },
        data : data
    },
    brush :  [{
         type : "line",
      display:'max',
      animate :true
    },{
      type:'scatter'
    }],
    widget : [
        { type : "title", text : "Line Sample" },
        { type : "legend" }
    ]
});
easylogic commented 7 years ago

clip 옵션을 한번 넣어보세요.

{
      type : "line",
      display:'max', 
      clip : false ,         // 화면을 넘어가는 것도 보여줍니다. 
      animate :true
    }
ytechinfo commented 7 years ago

감사 합니다 해결 했습니다. ㅎ