Skip to content

nestedPieChart's setData() function is abnormal #791

@testdrive-profiling-master

Description

Discussed in #790

Originally posted by testdrive-profiling-master March 29, 2023

	const el = document.getElementById('chart_memory');
	let data = {
	categories: ['Total', 'Read & Write'],
	series: [
	  {
		name: 'main',
		data: [
		  {
			name: 'IMEM',
			data: 0.0001,
		  },
		  {
			name: 'WMEM',
			data: 0.0001,
		  },
		  {
			name: 'CLMEM',
			data: 0.0001,
		  },
		  {
			name: 'DLMEM',
			data: 0.0001,
		  },
		],
	  },
	  {
		name: 'partial',
		data: [
		  {
			name: 'IMEM read',
			parentName: 'IMEM',
			data: 0.0001,
		  },
		  {
			name: 'IMEM write',
			parentName: 'IMEM',
			data: 0.0001,
		  },
		  {
			name: 'WMEM read',
			parentName: 'WMEM',
			data: 0.0001,
		  },
		  {
			name: 'WMEM write',
			parentName: 'WMEM',
			data: 0.0001,
		  },
		  {
			name: 'CLMEM read',
			parentName: 'CLMEM',
			data: 0.0001,
		  },
		  {
			name: 'CLMEM write',
			parentName: 'CLMEM',
			data: 0.0001,
		  },
		  {
			name: 'DLMEM read',
			parentName: 'DLMEM',
			data: 0.0001,
		  },
		  {
			name: 'DLMEM write',
			parentName: 'DLMEM',
			data: 0.0001,
		  },
		],
	  },
	],
	};
	const options = {
		chart: { title: 'Usage of internal memory', width: 550, height: 400},
		series: {
			main: {
				dataLabels: {visible: true},
				radiusRange: {
					inner: '20%',
					outer: '50%',
				},
			},
			partial: {
				dataLabels: {visible: true,
					pieSeriesName: {
						visible: true,
						anchor: 'outer'
					}
				},
				radiusRange: {
				  inner: '55%',
				  outer: '85%',
				},
			},
		},
		tooltip: {formatter: (value) => `${value}MB`},
		theme: {
			series: {
				main: {
					dataLabels: {
						fontSize: 10,
					},
				},
				partial: {
					dataLabels: {
						fontSize: 10,
					},
				},
			},
		}
	};

	chart_memory = toastui.Chart.nestedPieChart({ el, data, options });   // normal.
	chart_memory.setData(data);   // abnormal at the label in pie chart??

chart = toastui.Chart.nestedPieChart(~) is ok for run,
image

but when I use setData function with same data, label in pie chart is not visible.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions