Skip to content

How behaves for dynamic loading?

Jae Sung Park edited this page Jul 9, 2019 · 3 revisions

Explanation on how behaves for dynamic loading according given option & data.

1) When x value is given for data loading

Indexed & Timeseries axis type

// initial
columns: [
	["x", 0, 10, 15, 20, 25],
	["a", 12, 15, 6, 23, 13]
]

Case 1

Will replace the previous axis x value.

// the previous `x` will be replaced
chart.load({
	columns: [
		["x",0, 5, 7, 12, 20],
		["a", 12, 9, 31, 26, 17]
	]
});

load-01

Case 2

Will add new axis ticks, coordinated with the existing x ticks values.

// the previous `x` will not be replaced
chart.load({
	columns: [
		["x",0, 5, 7, 12, 20],
		["b", 12, 9, 31, 26, 17]
	]
});

load-02

Case 3

If contains initial dataset(in this case 'a'), it will act as case 1.

chart.load({
	columns: [
		["x",0, 5, 7, 12, 20],
		["a", 7, 7, 7, 7, 7],
		["b", 12, 9, 31, 26, 17]
	]
});

load-03

Category axis type

For category axis type, in all circumstances when x value is given on data load, it will replace the previous x tick values.

// initial
data: {
	x: "x",
	columns: [
		["x", "a1", "a2", "a3", "a4", "a5"],
		["a", 12, 15, 6, 23, 13]
	]
},
axis: {
	x: {
		type: "category"
	}
}

Case 1

Will replace the previous axis x value.

// the previous `x` will be replaced
chart.load({
	columns: [
		["x", "a3", "a4", "a5", "a6", "a7"],
		["a", 12, 9, 31, 26, 17]
	]
});

load-04

Case 2

Will replace the previous axis x value.

// the previous `x` will be replaced
chart.load({
	columns: [
		["x", "a3", "a4", "a5", "a6", "a7"],
		["b", 12, 9, 31, 26, 17]
	]
});

load-05

Case 3

Will replace the previous axis x value.

// the previous `x` will be replaced
chart.load({
	columns: [
		["x", "a3", "a4", "a5", "a6", "a7"],
		["a", 7, 7, 7, 7, 7],
		["b", 12, 9, 31, 26, 17]
	]
});

load-06

2) When x value is not given for data loading

Indexed, Timeseries & Category axis type

Basically, the tick will degrade when given data length is smaller than the original length. Otherwise, it will maintain same length even loading data length is greater than the original.

// initial
columns: [
	["x", 0, 10, 15],
	["a", 12, 15, 6]
]

Case 1

When load data length < original data length.

// previous 'x' will be scaled according the given data length
chart.load({
	columns: [
		["a", 12, 9]
	]
});

load-07

// will add dataset 'b' to be displayed, w/o changes
chart.load({
	columns: [
		["b", 12, 9]
	]
});

load-08

Case 2

When load data length > original data length.

// the last 2 data will be cut off to be fit with the 'x' length
chart.load({
	columns: [
		["a", 12, 9, 31, 22, 20]
	]
});

load-07-2

// the last 2 data will be cut off to be fit with the 'x' length
chart.load({
	columns: [
		["b", 12, 9, 10, 20, 30]
	]
});

load-08-2