Selection in Vue 3D Chart component
13 Jun 202424 minutes to read
The 3D chart provides selection support for the series and its data points on mouse click.
When mouse is clicked on the data points, the corresponding series legend will also be selected.
We have different types of selection mode for selecting a data.
- None
- Point
- Series
- Cluster
Point
To select a point, set the selectionMode property to Point.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Point' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]);
</script>
<style>
#container {
height: 350px;
}</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Point' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Series
To select a series, set the selectionMode property to Series.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Series' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Series' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Cluster
To select the points that corresponds to the same index in all the series, set the selectionMode property to Cluster.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Cluster' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Cluster' :wallColor='wallColor'
:enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Selection type
To select multiple points or series, enable the isMultiSelect property.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Series' isMultiSelect='true'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Series' isMultiSelect='true'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Selection during initial loading
In a 3D chart, selecting a point or series during initial loading can only be done programmatically. The selectedDataIndexes property can be used for this.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Point' isMultiSelect='true'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:selectedDataIndexes='selectedDataIndexes'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
const selectedDataIndexes = [
{ series: 0, point: 1 }, { series: 2, point: 3 }
];
provide('chart3d', [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' selectionMode='Point' isMultiSelect='true'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:selectedDataIndexes='selectedDataIndexes'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100,
selectedDataIndexes: [
{ series: 0, point: 1 }, { series: 2, point: 3 }
],
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Selection3D, Legend3D, Highlight3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Selection through legend
To select a point or series through legend use the toggleVisibility property. Also, use enableHighlight property for highlighting the series through legend.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' :legendSettings='legendSettings'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script setup>
import { provide } from "vue";
import { Chart3DComponent as EjsChart3d, Chart3DSeriesCollectionDirective as EChart3dSeriesCollection, Chart3DSeriesDirective as EChart3dSeries, ColumnSeries3D, Category3D, Legend3D } from "@syncfusion/ej2-vue-charts";
const seriesData = [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
];
const primaryXAxis = {
valueType: 'Category'
};
const title = 'Olympic Medals';
const legendSettings = { visible: true, toggleVisibility: false, enableHighlight: true };
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Legend3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :title='title' :legendSettings='legendSettings'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold'
name='Gold'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver'
name='Silver'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze'
name='Bronze'></e-chart3d-series>
</e-chart3d-series-collection>
</ejs-chart3d>
</div>
</template>
<script>
import { Chart3DComponent, Chart3DSeriesCollectionDirective, Chart3DSeriesDirective, ColumnSeries3D, Category3D, Legend3D } from "@syncfusion/ej2-vue-charts";
export default {
name: "App",
components: {
'ejs-chart3d': Chart3DComponent,
'e-chart3d-series-collection': Chart3DSeriesCollectionDirective,
'e-chart3d-series': Chart3DSeriesDirective
},
data() {
return {
seriesData: [
{ country: "USA", gold: 50, silver: 70, bronze: 45 },
{ country: "China", gold: 40, silver: 60, bronze: 55 },
{ country: "Japan", gold: 70, silver: 60, bronze: 50 },
{ country: "Australia", gold: 60, silver: 56, bronze: 40 },
{ country: "France", gold: 50, silver: 45, bronze: 35 },
{ country: "Germany", gold: 40, silver: 30, bronze: 22 },
{ country: "Italy", gold: 40, silver: 35, bronze: 37 },
{ country: "Sweden", gold: 30, silver: 25, bronze: 27 }
],
primaryXAxis: {
valueType: 'Category'
},
title: 'Olympic Medals',
legendSettings: { visible: true, toggleVisibility: false, enableHighlight: true },
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>