Legend in Vue 3D Chart component
13 Jun 202424 minutes to read
Legend provides information about the series rendered in the 3D chart.
Position and alignment
By using the position property, the legend can be positioned at left, right, top or bottom of the 3D chart. The legend is positioned at the bottom of the 3D chart, by default.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
position: 'Top'
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
position: 'Top'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>The custom position helps you to position the legend anywhere in the 3D chart using x and y coordinates.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
position: 'Custom',
location: { x: 200, y: 20 }
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
position: 'Custom',
location: { x: 200, y: 20 }
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend reverse
The order of the legend items can be reversed by using the reverse property. By default, legend for the first series in the collection will be placed first.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
reverse: true
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
reverse: true
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend alignment
The legend can be aligned at near, far or center to the 3D chart using the alignment property.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
position: 'Top',
alignment: 'Near'
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
position: 'Top',
alignment: 'Near'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend customization
To change the legend icon shape, legendShape property in the series can be used. By default, the legend icon shape is seriesType.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='SeriesType'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Rectangle'></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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='SeriesType'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Rectangle'></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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend size
By default, legend takes 20% - 25% of the 3D chart’s height horizontally, when it is placed on top or bottom position and 20% - 25% of the 3D chart’s width vertically, when it is placed on left or right position. You can change this default legend size by using the height and width properties of the legendSettings.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Circle'></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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
width: '500', height: '100',
border: { width: 1, color: 'pink' }
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Circle'></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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
width: '500', height: '100',
border: { width: 1, color: 'pink' }
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend item size
The size of the legend items can be customised by using the shapeHeight and shapeWidth properties.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Circle'></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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
shapeHeight: 10,
shapeWidth: 10
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='gold' name='Gold'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='silver' name='Silver'
legendShape='Circle'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='country' yName='bronze' name='Bronze'
legendShape='Circle'></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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
shapeHeight: 10,
shapeWidth: 10
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Paging for legend
Paging will be enabled by default, when the legend items exceeds the legend bounds. Each legend items can be viewed by navigating between the pages using navigation buttons.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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 = [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
];
const primaryXAxis = {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
};
const primaryYAxis = {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
};
const legendSettings = {
visible: true,
padding: 10,
shapePadding: 10,
border: {
width: 2, color: 'grey'
},
width: '200'
};
const title = 'FB Penetration of Internet Audience';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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: [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
],
primaryXAxis: {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
},
primaryYAxis: {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
},
legendSettings: {
visible: true,
padding: 10,
shapePadding: 10,
border: {
width: 2, color: 'grey'
},
width: '200'
},
title: 'FB Penetration of Internet Audience',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend text wrap
When the legend text exceeds the container, the text can be wrapped by using the textWrap property. End user can also wrap the legend text based on the maximumLabelWidth property.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
position: 'Right',
textWrap: 'Wrap',
maximumLabelWidth: 50
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
position: 'Right',
textWrap: 'Wrap',
maximumLabelWidth: 50
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Series selection through legend
By default, you can collapse the series visibility by clicking the legend. On the other hand, turn off the toggleVisibility property if you must use a legend click to choose a series.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings' selectionMode='Series'>
<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, Highlight3D, Selection3D } 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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
toggleVisibility: false
};
const title = 'Olympic Medals';
const wallColor = 'transparent';
const enableRotation = true;
const rotation = 7;
const tilt = 10;
const depth = 100;
provide('chart3d', [ColumnSeries3D, Category3D, Legend3D, Highlight3D, Selection3D]);
</script>
<style>
#container {
height: 350px;
}
</style><template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings' selectionMode='Series'>
<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, Highlight3D, Selection3D } 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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
toggleVisibility: false
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D, Highlight3D, Selection3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Collapsing legend item
By default, series name will be displayed as legend. To skip the legend for a particular series, you can give empty string to the series name.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
title: 'Countries'
};
const primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
toggleVisibility: true
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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: 'Countries'
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
toggleVisibility: true
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend title
You can set title for legend using title property in legendSettings. The size, color, opacity, fontStyle, fontWeight, fontFamily, textAlignment, and textOverflow of legend title can be customized by using the titleStyle property in legendSettings. The titlePosition is used to set the legend position in Top, Left and Right position. The maximumTitleWidth is used to set the width of the legend title. By default, it will be 100px.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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 primaryYAxis = {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
};
const legendSettings = {
visible: true,
title: 'Countries'
};
const title = 'Olympic Medals';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<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',
},
primaryYAxis: {
minimum: 0, maximum: 80,
interval: 20, title: 'Medals'
},
legendSettings: {
visible: true,
title: 'Countries'
},
title: 'Olympic Medals',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Arrow page navigation
The page number will always be visible while using legend paging. It is now possible to disable the page number and enable page navigation with the left and right arrows. The enablePages property needs to be set to false in order to render the arrow page navigation.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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 = [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
];
const primaryXAxis = {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
};
const primaryYAxis = {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
};
const legendSettings = {
width: '180',
height: '20',
enablePages: false
};
const title = 'FB Penetration of Internet Audience';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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: [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
],
primaryXAxis: {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
},
primaryYAxis: {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
},
legendSettings: {
width: '180',
height: '20',
enablePages: false
},
title: 'FB Penetration of Internet Audience',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Legend item padding
The itemPadding property can be used to adjust the space between the legend items.
<template>
<div id="app">
<ejs-chart3d id="container" :primaryXAxis='primaryXAxis' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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 = [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
];
const primaryXAxis = {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
};
const primaryYAxis = {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
};
const legendSettings = {
enablePages: false,
itemPadding: 30
};
const title = 'FB Penetration of Internet Audience';
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' :primaryYAxis='primaryYAxis' :title='title'
:wallColor='wallColor' :enableRotation='enableRotation' :rotation='rotation' :tilt='tilt' :depth='depth'
:legendSettings='legendSettings'>
<e-chart3d-series-collection>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y'
name='December 2007'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y1'
name='December 2008'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y2'
name='December 2009'></e-chart3d-series>
<e-chart3d-series :dataSource='seriesData' type='Column' xName='x' yName='y3'
name='December 2010'></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: [
{ x: 'WW', y: 12, y1: 22, y2: 38.3, y3: 50 },
{ x: 'EU', y: 9.9, y1: 26, y2: 45.2, y3: 63.6 },
{ x: 'APAC', y: 4.4, y1: 9.3, y2: 18.2, y3: 20.9 },
{ x: 'LATAM', y: 6.4, y1: 28, y2: 46.7, y3: 65.1 },
{ x: 'MEA', y: 30, y1: 45.7, y2: 61.5, y3: 73 },
{ x: 'NA', y: 25.3, y1: 35.9, y2: 64, y3: 81.4 }
],
primaryXAxis: {
title: 'Countries',
valueType: 'Category',
interval: 1,
labelIntersectAction: 'Rotate45'
},
primaryYAxis: {
title: 'Penetration (%)',
labelFormat: '{value}%',
minimum: 0, maximum: 90
},
legendSettings: {
enablePages: false,
itemPadding: 30
},
title: 'FB Penetration of Internet Audience',
wallColor: 'transparent',
enableRotation: true,
rotation: 7,
tilt: 10,
depth: 100
};
},
provide: {
chart3d: [ColumnSeries3D, Category3D, Legend3D]
}
};
</script>
<style>
#container {
height: 350px;
}
</style>Note: To use legend feature, we need to inject
Legend3Dinto theprovide.