<!-- 营收分析 -->
<template>
	<view class="revenue">
		<template v-if="type === 'line'">
			<view class="revenue-line">
				<LineChart :chartData="chartData" :title="title"/>
			</view>
		</template>
		<template v-else>
			<view class="revenue-line">
				<ColumnChart :chartData="chartData" :title="title"/>
			</view>
		</template>
	</view>
</template>

<script>
	import LineChart from '@/components/lineChart.vue'
	import ColumnChart from '@/components/columnChart.vue'
	export default {
		components: {
			LineChart,
			ColumnChart
		},
		props: {
			type: {
				type: String,
				default: 'line'
			},
			title: {
				type: String,
				default: ''
			},
			chartData: {
				type: Object,
				default: () => {
					return {}
				}
			}
		}
	}
</script>