nhn / tui.chart

🍞📊 Beautiful chart for data visualization.
http://ui.toast.com/tui-chart/
MIT License
5.35k stars 327 forks source link

When the chart is initially rendered, it is rendered strangely. #747

Closed sihoon1223 closed 2 years ago

sihoon1223 commented 2 years ago

Describe the bug I am using tui chart version 4.4.3 in javascript. After completing chart initialization and setting, the data is received through ajax and the setData function is called. At this time, the pie chart is rendered strangely. If you click a separate button to get data again and call the setData function, it works normally. Strangely, this phenomenon is repeated only when the first setData function is called. The sum of all data in the pie chart is 100% correct.... I don't know if this is a bug or if I coded it wrong. I need help.

To Reproduce Steps to reproduce the behavior: 1. initialization and setting

var pieChart_data ={ categories: [''number'], series: [name:"",data:100}]};
var pieChart_options ={ 
  chart: { width: 'auto',height: 'auto'},
  series:{ radiusRange:{ inner:'40%', outer:'100%'}, 
    angleRange:{start:-90, end:90},
    dataLabels:{ visible:true, anchor:'center', pieSeriesName:{visible:true,anchor:"outer"}},
    clockwise: true,
  },
  legend: {align: "bottom"},
};

tuiChart2 = toastui.Chart.pieChart({el:document.getElementById('tuiChart2'), data:pieChart_data, options: pieChart_options});
tuiChart3 = toastui.Chart.pieChart({el:document.getElementById('tuiChart3'), data:pieChart_data, options: pieChart_options});

2. Get data via ajax

$.?????.ajax.exec(searchUrl, data, function(res) {
  tuiChart2.setData(res.data["pieChart"]);
});

3. bug image

4. click another button, It works normally. image

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

jwlee1108 commented 2 years ago

@sihoon1223

Hello, Sorry for the late reply. I tried to reproduce it. but, It didn't work well.

Can you show your sample in detail? This is my link.

stale[bot] commented 2 years ago

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

stale[bot] commented 2 years ago

This issue will be closed due to inactivity. Thanks for your contribution!

sihoon1223 commented 2 years ago

check my link https://codesandbox.io/s/chart-es6-forked-8ueriq?file=/index.html