当前位置:网站首页>Line chart using apexcharts component (area curve of smooth)
Line chart using apexcharts component (area curve of smooth)
2022-04-22 17:14:00 【When there's not enough time】
-
Import components
import VueApexCharts from 'vue-apexcharts' -
The page uses components
<template> <vue-apex-charts class="vx-col w-1/3" height=250 type="area" :options="crudProfile.option" :series="crudProfile.series"/> </template> components: { VueApexCharts } -
data format
crudProfile: { series: [], option: { } } -
Initialization data
mounted () { this.drawCrudGraph(data) /* data: It's a line chart handed down series data data The data format of is : [ { name: 'series1', data: [31, 40, 28, 51, 42, 109, 100] }, { name: 'series2', data: [11, 32, 45, 32, 34, 52, 41] }, ] */ } -
Assign values to the page line chart and set its option. You can refer to the official website :https://apexcharts.com/docs/installation/#
methods: { drawCrudGraph (crudData) { this.getCrudOption() this.crudProfile.series = crudData }, getCrudOption () { this.crudProfile.option = { title: { // Displays the of the discount chart title text: ' Overall performance ( Average response speed )', fontSize: '12px' }, dataLabels: { enabled: false // Enable data labels , That is, whether to display data directly on the icon }, chart: { height: 250, toolbar: { show: false }, // // Whether to display the default icon in the upper right corner /* See the official website for properties : https://apexcharts.com/docs/options/chart/toolbar/ If you want to customize the chart, that is, the corresponding method , It's in customIcons: [] Set up . such as : customIcons: [{ icon: '<img src="" width="20">', index: 4, title: ' Button 1', class: 'custom-icon', click: function(chart, options, e) { console.log("clicked custom-icon") } }, { icon: '<img src="" width="20">', index: 4, title: ' Button 2', class: 'custom-icon', click: function(chart, options, e) { console.log("clicked custom-icon") } }] */ type: 'area' // Chart type :line、area、bar、radar、pie etc. }, <!-- plotOptions: { bar: { horizontal: true, // Displayed as a horizontal line chart // columnWidth: '60%', }, }, --> grid: { borderColor: '#cdcdcd', // Grid border / The color of the line width: 1, strokeDashArray: 2 // Create dashed lines in the path }, stroke: { curve: 'smooth', // In the line chart / In area map , Whether to draw a smooth line or a straight line... Options are available width: [2, 2, 2] }, legend: { show: true, position: 'top', width: 'auto' }, fill: { type: 'gradient', gradient: { shadeIntensity: 0.9, opacityFrom: 0.7, opacityTo: 0.5, stops: [0, 80, 100] } }, xAxis: { labels: { style: { cssClass: 'text-grey fill-current' } }, axisTicks: { show: true }, categories: [], // x The value displayed on the axis axisBorder: { show: true } }, yAxis: { tickAmount: 5 }, tooltip: { x: { show: true } } } } }
版权声明
本文为[When there's not enough time]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221712241910.html
边栏推荐
猜你喜欢

Redis(16) -- Redis集群

超赞:不愧是“阿里内部Redis学习笔记”从头到尾,全是精华

7 Questions d'entrevue sur la fermeture

How does glboalmapper20 convert hundreds of longitude and latitude projected images into national 2000 or other projected images at one time

How to efficiently manage data in a hybrid cloud?

引爆最多的炸弹-c语言dfs递归做法

Introduction and expansion of dichotomy

Check whether the paper is retrieved by SCI

Introduction to webrtc: 4 Rtcpeerconnection connects audio and video streams
怎么能让win10电脑日历便签上显示二十四节气?
随机推荐
超赞:不愧是“阿里内部Redis学习笔记”从头到尾,全是精华
OJ daily practice -- find the sum of score sequences
[deep learning] hands on learning pytorch version
400 million women just need, all kinds of capital kill: 100 billion business hidden in sanitary napkins
Exercises and answers of relevant laws and regulations in 2022 environmental impact assessment engineer examination
Cloud native observability, one of the cornerstones of cloud native building
Introduction to webrtc: 4 Rtcpeerconnection connects audio and video streams
webrtc入门:4.RTCPeerConnection连接音视频流
The recursive return value in JS is undefined
GlboalMapper20 如何一次性把上百个经纬度投影的影像转为国家2000或者其他投影的影像
二分法的介绍和拓展
Find string in folder
实现简易计算器
7 Questions d'entrevue sur la fermeture
Apache配置多端口
MySQL_ 00_ Get to know MySQL
测试人生 | 毕业2年未满,0经验拿下知名互联网企业30W 年薪,他是怎么做到的?
Globalmapper20 how to batch convert SHP to KML and bring attributes
Devaxpress WPF Getting Started Guide - POCO view model generated at runtime (I)
Shiro缓存管理