Vue+Highcharts完全使用
创建Comp组件
<template>
<div class="x-bar">
<div :id="id" :option="option"></div>
</div>
</template> <script>
import HighCharts from 'highcharts'
import highchartsMore from 'highcharts/highcharts-more';
highchartsMore(HighCharts);
export default {
name: "Comp",
props: {
id: {
type: String
},
option: {
type: Object
}
},
mounted() {
HighCharts.chart(this.id, this.option)
}
}
</script>
创建使用组件
<template>
<div class="charts">
<x-chart :id="id" :option="option"></x-chart>
</div>
</template>
<script>
import XChart from './comp.vue'
import HighCharts from 'highcharts'
export default {
name: "WdataCharts",
data() {
return {
id: 'datacharts',
option: {
chart: {
polar: true,
type: 'line'
},
credits: {
enabled: true,
text: '',
href: ''
},
exporting: {
enabled: true,
buttons: {
exportButton: {
enabled: true
}
}
},
title: {
text: 'w'
},
subtitle: {
text: '数据来源: w'
}
,
xAxis: {
categories: ['1', '2', '3', '4',
'5', '6'],
tickmarkPlacement: 'on',
lineWidth: 0
}, yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
labels: {
formatter: function () {
return this.value + "%";
}
} },
tooltip: { shared: true,
pointFormat: '<span style="color:{series.color}">{series.name}: <b>{point.y:,.0f}%</b><br/>'
},
legend: {
align: 'right',
verticalAlign: 'top',
y: 100,
layout: 'vertical'
},
plotOptions: {},
series: [{
name: '2017',
data: [0, 0, 0, 0, 0, 0],
pointPlacement: 'on'
}, {
name: '2016',
data: [0, 0, 0, 0, 0, 0],
pointPlacement: 'on'
}]
},mounted() { HighCharts.chart(this.id, this.option) }
Vue+Highcharts完全使用的更多相关文章
- vue调用 Highcharts 实现多个数据可视化展示
一创建一个 options.js 代码为: export const option1 = { bar: { title: { text: '珠海猪场' // 指定图表标题 }, credits: { ...
- gantt甘特图可拖拽、编辑(vue、react都可用 highcharts)
前言 Excel功能强大,应用广泛.随着web应用的兴起和完善,用户的要求也越来越高.很多Excel的功能都搬到了sass里面.恨不得给他们做个Excel出来...程序员太难了... 去年我遇到了 ...
- 在vue中使用highcharts的仪表图等扩展
仪表图(”solidgauge“)在highcharts中属于扩展,单独引入highcharts使用仪表图会报错,需要在你的组件中做一谢其他的引入: // 最主要是这里模块的引入 很坑 import ...
- Vue开源项目库汇总
最近做了一个Vue开源项目库汇总,里面集合了OpenDigg 上的优质的Vue开源项目库,方便移动开发人员便捷的找到自己需要的项目工具等,感兴趣的可以到GitHub上给个star. UI组件 elem ...
- Vue常用经典开源项目汇总参考-海量
Vue常用经典开源项目汇总参考-海量 Vue是什么? Vue.js(读音 /vjuː/, 类似于 view) 是一套构建用户界面的 渐进式框架.与其他重量级框架不同的是,Vue 采用自底向上增量开发的 ...
- Vue 爬坑之路(八)—— 使用 Echarts 创建图表
在后台管理系统中,图表是一个很普遍的元素.目前常用的图标插件有 charts, Echarts, highcharts.这次将介绍 Echarts 在 Vue 项目中的应用. 一.安装插件 使用 c ...
- Vue常用开源项目汇总
前言:Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库只关注视图层,不仅易于上手,还 ...
- Vue应用框架整合与实战--Vue技术生态圈篇
实用框架以及工具 UI组件 开发框架 实用库 服务端 辅助工具 应用实例 Demo示例 UI组件 Element-UI ★13489 - 饿了么出品的Vue2的web UI工具套件 Vux ★8133 ...
- vue各种插件汇总
https://blog.csdn.net/wh8_2011/article/details/80497620(copy) Vue是什么? Vue.js(读音 /vjuː/, 类似于 view) 是一 ...
随机推荐
- Hibernate 基础入门
概述: JDBC:将java和数据库连接的驱动程序加载到项目中,在代码里面,注册驱动,创建链接,创建satement对象,发送并执行sql之类,关闭连接. hibernate :数据持久化一个框架,对 ...
- ssh 绕过The authenticity of host '*.*.*.*' can't be established 直接输入密码
只需要使用命令 ssh webgate@10.129.6.237 -o "StrictHostKeyChecking no" 即可以绕过 insp_ap@inspect02:/ho ...
- 安装php7.2并且整合nginx且分开部署
1.安装php 7.2 2.php配置 3.nginx配置 4.测试 5.报错与解决 6.利用upstream实现负载均衡 1.安装php 7.2 启动容器: liwangdeMacBook-Air: ...
- html-minifier中文文档
HTMLMinifier是一个高度可配置的.经过良好测试的.基于javascript的HTML缩小器.参见相应的博客文章,了解它的工作原理.每个选项的描述.测试结果和结论.在线测试套件.还可以看到相应 ...
- Springboot高版本中@ConfigurationProperties注解取消location属性
在spring boot 1.5 版本之前 在@ConfigurationProperties注释中有两个属性:locations:指定配置文件的所在位置prefix:指定配置文件中键名称的前缀 sp ...
- BASH 环境
本节内容 1. 什么是shell 2. 命令的优先级 3. 元字符 4. 登录shell与非登录shell 一 什么是shell shell一般代表两个层面的意思,一个是命令解释器,如bas ...
- unidbgrid 设置 单元格颜色
unidbgrid 设置 单元格颜色 2018年10月24日 11:32:41 ozhy111 阅读数:68 procedure TF_Resource2.UniDBGrid1DrawColumn ...
- Swagger相关配置记录
1.SwaggerConfig文件配置 public class SwaggerConfig { protected static string GetXmlCommentsPath() { retu ...
- Android开发 - 掌握ConstraintLayout(五)偏差(Bias)
比如实现这样一个场景: "在屏幕宽度的1/4的地方放置一个View" 使用传统布局时,实现按照屏幕的宽度(高度),或者相对两个View之间距离的一个比例来进行布局,就显得非常麻烦, ...
- js截取字符串方法整理slice(), substr(), substring(), split()
substr(start,length) stringObject.substr(start,length) //start,截取起始下标,-1 指字符串最后一个字符,-2 指倒数第二个字符开始 ...