npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

echarts-theme

v0.2.6

Published

想偷懒写图表,只要能够自动变色,所以写个包,方便处理

Downloads

18

Readme

echarts-theme

要求两种主题切换变色,这好做啊
但是图表也要跟着变色,这就很烦了,所以只能封装一个包
我只想摸鱼啊,可恶

配置属性

属性名 | 描述 | 参考值 | :------------:|:-----:|:-----:| modeFlag | 变色按钮 | true/false | echartsId | 图表ID | 'demoEcharts' | options | echarts配置项 | 参照官网 | optionW | 颜色1变量定义 | 参照demoData | optionB | 颜色2变量定义 | 参照demoData | legendColor | legend颜色 | '#FFFFFF' | colorX | x轴刻度标签文字的颜色 | '#FFFFFF' | colorY | y轴刻度标签文字的颜色 | '#FFFFFF' | splitLineX | x轴刻度线的颜色 | '#283045' | splitLineY | Y轴刻度线的颜色 | '#283045' | boxShadow | 折线图阴影效果,多条数据则数组多一项 | 参照demo |

DemoData:

options: {
     tooltip: {
       trigger: 'axis'
     },
     xAxis: {
       type: 'category',
       data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
     },
     yAxis: {
       type: 'value'
     },
     series: [{
       data: [150, 230, 224, 218, 135, 147, 260],
       type: 'line'
     }]
},
colorX: '#71747E',
colorY: '#9CA5AC',
splitLineX: '#e0e6f1',
splitLineY: '#e0e6f1',
boxShadow:[{
 'bottom': '#FFFFFF',
 'top': '#dedcfd',
}]
optionsW:{
    colorX: '#71747E',
    colorY: '#9CA5AC',
    splitLineX: '#e0e6f1',
    splitLineY: '#e0e6f1',
    legendColor: '#834f63',
    boxShadow:[{
      'bottom': '#FFFFFF',
      'top': '#dedcfd',
    }]
},
optionsB:{
    colorX: '#4e06ff',
    colorY: '#23fffd',
    splitLineX: '#4df14c',
    splitLineY: '#f1224b',
    legendColor: '#7ffdff',
    boxShadow:[{
      'bottom': '#ff2df1',
      'top': '#0afdf3',
    }]
}
modeFlag: true

安装使用

下载

npm install echarts-theme

引入main.js

import EchartsTheme from 'echarts-theme'

app.use(EchartsTheme).mount('#app');

使用

在template中引入,注意一定要父级容器,这里我设置的是500*500的

<div style="width:500px;height:500px">
    <echarts-theme :echartsId="'searchEcharts'"
                    :eWidth="'100%'"
                    :eHeight="'100%'"
                    :theme="themeFlag"
                    :optionsW="optionsW"
                    :optionsB="optionsB"
                    :modeFlag="modeFlag"
                    :options="eOptions"/>
</div>