-<h5>Vertical</h3>
-<Chart type="bar" :data="basicData" />
-
-<h3>Horizontal</h3>
-<Chart type="horizontalBar" :data="basicData" />
-
-<h3>Multi Axis</h3>
-<Chart type="bar" :data="multiAxisData" :options="multiAxisOptions"/>
-
-<h3>Stacked</h3>
-<Chart type="bar" :data="stackedData" :options="stackedOptions"/>
-
-
-
-
-export default {
- data() {
- return {
- basicData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- label: 'My First dataset',
- backgroundColor: '#42A5F5',
- data: [65, 59, 80, 81, 56, 55, 40]
- },
- {
- label: 'My Second dataset',
- backgroundColor: '#FFA726',
- data: [28, 48, 40, 19, 86, 27, 90]
- }
- ]
- },
- multiAxisData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- label: 'Dataset 1',
- backgroundColor: [
- '#EC407A',
- '#AB47BC',
- '#42A5F5',
- '#7E57C2',
- '#66BB6A',
- '#FFCA28',
- '#26A69A'
- ],
- yAxisID: 'y-axis-1',
- data: [65, 59, 80, 81, 56, 55, 10]
- },
- {
- label: 'Dataset 2',
- backgroundColor: '#78909C',
- yAxisID: 'y-axis-2',
- data: [28, 48, 40, 19, 86, 27, 90]
- }
- ]
- },
- multiAxisOptions: {
- responsive: true,
- tooltips: {
- mode: 'index',
- intersect: true
- },
- scales: {
- yAxes: [
- {
- type: 'linear',
- display: true,
- position: 'left',
- id: 'y-axis-1',
- ticks: {
- min: 0,
- max: 100
- }
- },
- {
- type: 'linear',
- display: true,
- position: 'right',
- id: 'y-axis-2',
- gridLines: {
- drawOnChartArea: false
- },
- ticks: {
- min: 0,
- max: 100
- }
- }
- ]
- }
- },
- stackedData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- type: 'bar',
- label: 'Dataset 1',
- backgroundColor: '#42A5F5',
- data: [
- 50,
- 25,
- 12,
- 48,
- 90,
- 76,
- 42
- ]
- },
- {
- type: 'bar',
- label: 'Dataset 2',
- backgroundColor: '#66BB6A',
- data: [
- 21,
- 84,
- 24,
- 75,
- 37,
- 65,
- 34
- ]
- },
- {
- type: 'bar',
- label: 'Dataset 3',
- backgroundColor: '#FFA726',
- data: [
- 41,
- 52,
- 24,
- 74,
- 23,
- 21,
- 32
- ]
- }
- ]
- },
- stackedOptions: {
- tooltips: {
- mode: 'index',
- intersect: false
- },
- responsive: true,
- scales: {
- xAxes: [{
- stacked: true,
- }],
- yAxes: [{
- stacked: true
- }]
- }
- }
- }
- }
-}
-
-
-
-<Chart type="bar" :data="chartData" :options="chartOptions"/>
-
-
-
-
-export default {
- data() {
- return {
- chartData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [{
- type: 'line',
- label: 'Dataset 1',
- borderColor: '#42A5F5',
- borderWidth: 2,
- fill: false,
- data: [
- 50,
- 25,
- 12,
- 48,
- 56,
- 76,
- 42
- ]
- },
- {
- type: 'bar',
- label: 'Dataset 2',
- backgroundColor: '#66BB6A',
- data: [
- 21,
- 84,
- 24,
- 75,
- 37,
- 65,
- 34
- ],
- borderColor: 'white',
- borderWidth: 2
- },
- {
- type: 'bar',
- label: 'Dataset 3',
- backgroundColor: '#FFA726',
- data: [
- 41,
- 52,
- 24,
- 74,
- 23,
- 21,
- 32
- ]
- }]
- },
- chartOptions: {
- responsive: true,
- title: {
- display: true,
- text: 'Combo Bar Line Chart'
- },
- tooltips: {
- mode: 'index',
- intersect: true
- }
- }
- }
- }
-}
-
-
-
-<Chart type="doughnut" :data="chartData" />
-
-
-
-
-export default {
- data() {
- return {
- chartData: {
- labels: ['A','B','C'],
- datasets: [
- {
- data: [300, 50, 100],
- backgroundColor: [
- "#42A5F5",
- "#66BB6A",
- "#FFA726"
- ],
- hoverBackgroundColor: [
- "#64B5F6",
- "#81C784",
- "#FFB74D"
- ]
- }
- ]
- }
- }
- }
-}
-
-
-
-<h3>Basic</h3>
-<Chart type="line" :data="basicData" />
-
-<h3>Multi Axis</h3>
-<Chart type="line" :data="multiAxisData" :options="multiAxisOptions" />
-
-<h3>Line Styles</h3>
-<Chart type="line" :data="lineStylesData" />
-
-
-
-
-export default {
- data() {
- return {
- basicData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- label: 'First Dataset',
- data: [65, 59, 80, 81, 56, 55, 40],
- fill: false,
- borderColor: '#42A5F5'
- },
- {
- label: 'Second Dataset',
- data: [28, 48, 40, 19, 86, 27, 90],
- fill: false,
- borderColor: '#FFA726'
- }
- ]
- },
- multiAxisData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- label: 'Dataset 1',
- fill: false,
- borderColor: '#42A5F5',
- yAxisID: 'y-axis-1',
- data: [65, 59, 80, 81, 56, 55, 10]
- },
- {
- label: 'Dataset 2',
- fill: false,
- backgroundColor: '#00bb7e',
- borderColor: '#00bb7e',
- yAxisID: 'y-axis-2',
- data: [28, 48, 40, 19, 86, 27, 90]
- }
- ]
- },
- multiAxisOptions: {
- responsive: true,
- hoverMode: 'index',
- stacked: false,
- scales: {
- yAxes: [
- {
- type: 'linear',
- display: true,
- position: 'left',
- id: 'y-axis-1',
- },
- {
- type: 'linear',
- display: true,
- position: 'right',
- id: 'y-axis-2',
- gridLines: {
- drawOnChartArea: false
- }
- }
- ]
- }
- },
- lineStylesData: {
- labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
- datasets: [
- {
- label: 'First Dataset',
- data: [65, 59, 80, 81, 56, 55, 40],
- fill: false,
- borderColor: '#42A5F5'
- },
- {
- label: 'Second Dataset',
- data: [28, 48, 40, 19, 86, 27, 90],
- fill: false,
- borderDash: [5, 5],
- borderColor: '#66BB6A'
- },
- {
- label: 'Third Dataset',
- data: [12, 51, 62, 33, 21, 62, 45],
- fill: true,
- borderColor: '#FFA726',
- backgroundColor: 'rgba(255,167,38,0.2)'
- }
- ]
- }
- }
- }
-}
-
-
-
-<Chart type="pie" :data="chartData" />
-
-
-
-
-export default {
- data() {
- return {
- chartData: {
- labels: ['A','B','C'],
- datasets: [
- {
- data: [300, 50, 100],
- backgroundColor: [
- "#42A5F5",
- "#66BB6A",
- "#FFA726"
- ],
- hoverBackgroundColor: [
- "#64B5F6",
- "#81C784",
- "#FFB74D"
- ]
- }
- ]
- }
- }
- }
-}
-
-
-
-<Chart type="polarArea" :data="chartData" />
-
-
-
-
-export default {
- data() {
- return {
- chartData: {
- datasets: [{
- data: [
- 11,
- 16,
- 7,
- 3,
- 14
- ],
- backgroundColor: [
- "#42A5F5",
- "#66BB6A",
- "#FFA726",
- "#26C6DA",
- "#7E57C2"
- ],
- label: 'My dataset'
- }],
- labels: [
- "Red",
- "Green",
- "Yellow",
- "Grey",
- "Blue"
- ]
- }
- }
- }
-}
-
-
-
-<Chart type="radar" :data="chartData" />
-
-
-
-
-export default {
- data() {
- return {
- chartData: {
- labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
- datasets: [
- {
- label: 'My First dataset',
- backgroundColor: 'rgba(179,181,198,0.2)',
- borderColor: 'rgba(179,181,198,1)',
- pointBackgroundColor: 'rgba(179,181,198,1)',
- pointBorderColor: '#fff',
- pointHoverBackgroundColor: '#fff',
- pointHoverBorderColor: 'rgba(179,181,198,1)',
- data: [65, 59, 90, 81, 56, 55, 40]
- },
- {
- label: 'My Second dataset',
- backgroundColor: 'rgba(255,99,132,0.2)',
- borderColor: 'rgba(255,99,132,1)',
- pointBackgroundColor: 'rgba(255,99,132,1)',
- pointBorderColor: '#fff',
- pointHoverBackgroundColor: '#fff',
- pointHoverBorderColor: 'rgba(255,99,132,1)',
- data: [28, 48, 40, 19, 96, 27, 100]
- }
- ]
- }
- }
- }
-}
-
-
-