Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

linechart setData & addData has abnormal operation. #792

Description

{
	const el = document.getElementById('chart');
	const data = {
		categories: ['0 ps'],
		series: [
			{
				name: 'Core',
				data: [0],
			}
		],
	};
	const options = {
		chart: { title: 'Core utilization in process', width: 1200, height: 400 },
		xAxis: {
			title: 'Time',
		},
		yAxis: {
			title: 'Percent (%)',
			scale: {min: 0, max: 100, stepSize:10},
			suffix: '%'
		},
		tooltip: {
			formatter: (value) => `${value}%`,
		},
		legend: {
			align: 'bottom',
		},
		series: {
			selectable: true,
		},
	};

	chart_core_utilization = toastui.Chart.lineChart({ el, data, options });
	chart_core_utilization.addData([10], '1 ns');
	chart_core_utilization.addData([15], '2 ns');
	chart_core_utilization.addData([25], '3 ns');
	chart_core_utilization.addData([45], '4 ns');
	chart_core_utilization.addData([70], '5 ns');
}

When I run the codes above, It does not shown the 'Core' line.
But when hovering the mouse over a point, a tooltip box is visible..
image

Strangely, when I click the checkbox twice, it shows up again like below.
image

And then, before using the addData function, if data is set again with the setData function, it will not operate normally as shown in the figure below.

        ......
	chart_core_utilization = toastui.Chart.lineChart({ el, data, options });
        chart_core_utilization.setData(data);    // <<==================== abnormal
	chart_core_utilization.addData([10], '1 ns');
	chart_core_utilization.addData([15], '2 ns');
	chart_core_utilization.addData([25], '3 ns');
	chart_core_utilization.addData([45], '4 ns');
	chart_core_utilization.addData([70], '5 ns');

image
no data, no x axis labels.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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