2020-06-18 23:35:52 +02:00
|
|
|
describe('Mixed charts', function() {
|
2021-02-10 14:21:39 +01:00
|
|
|
describe('auto', jasmine.fixture.specs('mixed'));
|
2022-11-12 21:41:21 +01:00
|
|
|
|
|
|
|
it('shoud be constructed with doughnuts chart', function() {
|
|
|
|
const chart = window.acquireChart({
|
|
|
|
data: {
|
|
|
|
datasets: [{
|
|
|
|
type: 'line',
|
|
|
|
data: [10, 20, 30, 40],
|
|
|
|
}, {
|
|
|
|
type: 'doughnut',
|
|
|
|
data: [10, 20, 30, 50],
|
|
|
|
}
|
|
|
|
],
|
|
|
|
labels: []
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const meta0 = chart.getDatasetMeta(0);
|
|
|
|
expect(meta0.type).toEqual('line');
|
|
|
|
const meta1 = chart.getDatasetMeta(1);
|
|
|
|
expect(meta1.type).toEqual('doughnut');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('shoud be constructed with pie chart', function() {
|
|
|
|
const chart = window.acquireChart({
|
|
|
|
data: {
|
|
|
|
datasets: [{
|
|
|
|
type: 'bar',
|
|
|
|
data: [10, 20, 30, 40],
|
|
|
|
}, {
|
|
|
|
type: 'pie',
|
|
|
|
data: [10, 20, 30, 50],
|
|
|
|
}
|
|
|
|
],
|
|
|
|
labels: []
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const meta0 = chart.getDatasetMeta(0);
|
|
|
|
expect(meta0.type).toEqual('bar');
|
|
|
|
const meta1 = chart.getDatasetMeta(1);
|
|
|
|
expect(meta1.type).toEqual('pie');
|
|
|
|
});
|
|
|
|
|
2020-06-18 23:35:52 +02:00
|
|
|
});
|