安装dataV

1、安装

npm install @jiaminghi/charts

npm install @jiaminghi/data-view

2、在main.js 里添加

import dataV from '@jiaminghi/data-view'
Vue.use(dataV)

3、在页面引入

import Charts from '@jiaminghi/charts'

4、简单使用

<template>
	<div class="box">
    <dv-loading>Loading...</dv-loading>
	</div>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		mounted() {

		},
		methods: {

		},
	}
</script>
<style>

</style>

5、简单使用

<template>
	<div class="box">
    <dv-border-box-1>dv-border-box-1</dv-border-box-1>
	</div>
</template>
<script>
	export default {
		data() {
			return {

			}
		},
		mounted() {
		},
		methods: {
		},
	}
</script>
<style>
.box{
  width: 100%;
  height: 100%;
  background-color: #282c34;
}
</style>

6、简单使用

<template>
	<div class="box">
		<div id="container"></div>
	</div>
</template>

<script>
	import Charts from '@jiaminghi/charts'
	export default {
		data() {
			return {
				option: {
					legend: {
						data: [{
								name: '收费系统',
								color: '#00baff'
							},
							{
								name: '监控系统',
								color: '#ff5ca9'
							},
							{
								name: '通信系统',
								color: '#3de7c9'
							},
							{
								name: '供配电系统',
								color: '#f5d94e'
							}
						],
						textStyle: {
							fill: '#fff'
						}
					},
					xAxis: {
						data: [
							'10/01', '10/02', '10/03', '10/04', '10/05', '10/06', '10/07'
						],
						axisLine: {
							style: {
								stroke: '#999'
							}
						},
						axisLabel: {
							style: {
								fill: '#999'
							}
						},
						axisTick: {
							show: false
						}
					},
					yAxis: {
						data: 'value',
						splitLine: {
							show: false
						},
						axisLine: {
							style: {
								stroke: '#999'
							}
						},
						axisLabel: {
							style: {
								fill: '#999'
							}
						},
						axisTick: {
							show: false
						},
						min: 0,
						max: 8
					},
					series: [{
							name: '收费系统',
							data: [
								2.5, 3.5, 6.5, 6.5, 7.5, 6.5, 2.5
							],
							type: 'bar',
							barStyle: {
								fill: 'rgba(0, 186, 255, 0.4)'
							}
						},
						{
							name: '监控系统',
							data: [
								2.5, 3.5, 6.5, 6.5, 7.5, 6.5, 2.5
							],
							type: 'line',
							lineStyle: {
								stroke: '#ff5ca9'
							},
							linePoint: {
								radius: 4,
								style: {
									fill: '#ff5ca9',
									stroke: 'transparent'
								}
							}
						},
						{
							name: '通信系统',
							data: [
								1.3, 2.3, 5.3, 5.3, 6.3, 5.3, 1.3
							],
							type: 'line',
							smooth: true,
							lineArea: {
								show: true,
								gradient: ['rgba(55, 162, 218, 0.6)', 'rgba(55, 162, 218, 0)']
							},
							lineStyle: {
								lineDash: [5, 5]
							},
							linePoint: {
								radius: 4,
								style: {
									fill: '#00db95'
								}
							}
						}
					]
				}
			}
		},
		mounted() {
			this.charet();
		},
		methods: {
			charet() {
				const container = document.getElementById('container')
				const myChart = new Charts(container)
				myChart.setOption(this.option)
			}
		},
	}
</script>

<style>

	#container {
		width: 500px;
		height: 500px;
		background:#f1f1f1;
	}
</style>

 

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
在Vue3中,安装dataV可以按照以下步骤进行操作: 1. 首先,确保你已经安装了Vue CLI。如果没有安装,可以使用以下命令进行安装: ``` npm install -g @vue/cli ``` 2. 创建一个新的Vue项目。可以使用以下命令创建一个新的项目: ``` vue create my-project ``` 根据提示选择默认配置或者手动选择需要的配置。 3. 进入到项目目录中: ``` cd my-project ``` 4. 安装dataV。可以使用以下命令进行安装: ``` npm install @jiaminghi/data-view ``` 5. 在你的Vue组件中引入dataV并使用。可以在你的组件中按照以下方式引入和使用dataV: ```javascript <template> <div> <data-view :data="data" /> </div> </template> <script> import DataView from '@jiaminghi/data-view' export default { components: { DataView }, data() { return { data: \[ // 数据配置 \] } } } </script> ``` 这样就完成了dataV在Vue3中的安装和使用。请注意,以上代码仅为示例,具体的dataV使用方式和配置可以根据你的需求进行调整。 #### 引用[.reference_title] - *1* *2* [Vue_Vue2的data()中数据,在vue3项目中怎么获取?](https://blog.csdn.net/gzmhxsn/article/details/127869846)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [vue3的setup函数中定义data数据,使用data数据](https://blog.csdn.net/weixin_46764819/article/details/128275312)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大得369

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值