1.1.13 • Published 2 years ago

xl-chart v1.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

install

npm install xl-chart --save-dev

import

import xlChart  from "xl-chart"

purpose

本插件是为BI和快速创建手机版本图表而建,提供了快速重载,销毁重载等性能优化
pc版 还在考虑开放ing,如果需要 可以私信 1772907731@qq.com

use

Normal

Image text

const data = Array.from(Array(6).keys()).map((item)=>{
    return {
        num1:Math.floor(Math.random()*1000+1),
        num2:Math.floor(Math.random()*1000+1),
        record:"维度"+(item+1)
    };
});
new xlChart.Normal(
    dom,
    {
        data,
        dataField: ["num1", "num2"],
        recordField: "record",
        seriesField: {
            num1: {
                name: "我是数据1",
                type: "line",
                color: "#6BEDD1",
            },
            num2: {
                name: "我是数据2",
                type: "bar",
                color: "#00C49A"
            }
        }
    }
);

StackX

Image text

const data = Array.from(Array(6).keys()).map((item)=>{
    return {
        num1:Math.floor(Math.random()*1000+1),
        num2:Math.floor(Math.random()*1000+1),
        record:"维度"+(item+1)
    };
});
new xlChart.StackX(
    dom,
    {
        data,
        dataField: ["num1", "num2"],
        recordField: "record",
        seriesField: {
            num1: {
                name: "我是数据1",
                type: "bar",
                stack:"1",
                color: "#6BEDD1",
            },
            num2: {
                name: "我是数据2",
                type: "bar",
                stack:"1",
                color: "#00C49A"
            }
        }
    }
);

StackY

Image text

const data = Array.from(Array(6).keys()).map((item)=>{
    return {
        num1:Math.floor(Math.random()*1000+1),
        num2:Math.floor(Math.random()*1000+1),
        record:"维度"+(item+1)
    };
});
new xlChart.StackY(
    dom,
    {
        data,
        dataField: ["num1", "num2"],
        recordField: "record",
        seriesField: {
            num1: {
                name: "我是数据1",
                type: "bar",
                stack:"1",
                color: "#6BEDD1",
            },
            num2: {
                name: "我是数据2",
                type: "bar",
                stack:"1",
                color: "#00C49A"
            }
        }
    }
);

BarGrey

Image text

const data = Array.from(Array(6).keys()).map((item)=>{
    return {
        num1:Math.floor(Math.random()*1000+1),
        num2:Math.floor(Math.random()*1000+1),
        record:"维度"+(item+1)
    };
});
new xlChart.BarGrey(
    dom,
    {
        data,
        dataField: ["num1", "num2"],
        recordField: "record",
        seriesField: {
            num1: {
                name: "我是数据1",
                type: "line",
                color: "#6BEDD1",
            },
            num2: {
                name: "我是数据2",
                type: "bar",
                color: "#00C49A"
            }
        }
    }
);

BarExtreme

Image text

const data = Array.from(Array(6).keys()).map((item)=>{
    return {
        num1:Math.floor(Math.random()*1000+1),
        num2:Math.floor(Math.random()*1000+1),
        record:"维度"+(item+1)
    };
});
new xlChart.BarExtreme(
    dom,
    {
        data,
        dataField: ["num1", "num2"],
        recordField: "record",
        seriesField: {
            num1: {
                name: "我是数据1",
                type: "bar",
                color: "#6BEDD1",
            },
            num2: {
                name: "我是数据2",
                type: "bar",
                color: "#00C49A"
            }
        }
    }
);

Pie

Image text

new xlChart.Pie(
        dom,
        {
           data:{
               num1:Math.floor(Math.random()*1000+1),
               num2:Math.floor(Math.random()*1000+1),
               num3:Math.floor(Math.random()*1000+1),
           },
           dataField: ["num1", "num2", "num3"],
           seriesField: {
               num1: {
                   name: "我是数据1",
                   color: "#6BEDD1",
               },
               num2: {
                   name: "我是数据2",
                   color: "#00C49A"
               },
               num3: {
                   name: "我是数据3",
                   color: "#FA8F67"
               }
           }
        }
);

#reload

//可以更新任意值
const chart = new xlChart.Normal({});
chart.reloadOption({
  data:[],
  dataField: ["num1", "num2", "num3"],
  seriesField: {
      num1: {
          name: "我是数据1",
          type: "bar",
          color: "#6BEDD1",
      },
      num2: {
          name: "我是数据2",
          type: "line",
          color: "#00C49A"
      },
      num3: {
          name: "我是数据3",
          type: "line",
          color: "#FA8F67"
      }
  }
});

#destroy

// 销毁重构
const chart = new xlChart.Normal({});
chart.destroy();
1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago