v-chart更换主题
近期因为公司需求,了解了v-charts。相比echarts来说少了很多操作,使用起来也很简单,但是文档内容太少,一些配置,问题都找不到问题解决。 这里介绍下如何更换主题。
首先去echarts官网去下载主题
地址:echarts自定义主题
选好主题,然后下载文件,文件格式又JSON和JS,这两个应该都可以,我下载的是json。把下载好的文件放入项目中
然后再页面中使用
//data中引用
return {
custheme: require("./theme/dark.json"),
}
//temolate
<template>
<ve-histogram
:data="chartData"
width="100%"
height="100%"
:grid="grid"
:extend="extend"
:theme="custheme"
></ve-histogram>
</template>