返回
应用市场 百度图表
duxappEcharts
duxapp

百度图表

duxappEcharts

v1.0.2
release
duxapp

echarts

集成百度图表插件,兼容多个端,RN端组件基本支持

安装

yarn duxapp app add echarts

使用

import { Chart } from '@/duxappEcharts'
import { Header, ScrollView, TopView, GroupList, px } from '@/duxuiExample'

import {
  PieChart,
  LineChart,
  BarChart
} from 'echarts/charts'

import {
  TooltipComponent,
  GridComponent,
  TitleComponent,
  LegendComponent
} from 'echarts/components'

const options = {
  line: {
    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'
      }
    ]
  },
  bar: {
    xAxis: {
      type: 'category',
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        data: [120, 200, 150, 80, 70, 110, 130],
        type: 'bar'
      }
    ]
  },
  pie: {
    title: {
      text: 'Referer of a Website',
      subtext: 'Fake Data',
      left: 'center'
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'vertical',
      left: 'left'
    },
    series: [
      {
        name: 'Access From',
        type: 'pie',
        radius: '50%',
        data: [
          { value: 1048, name: 'Search Engine' },
          { value: 735, name: 'Direct' },
          { value: 580, name: 'Email' },
          { value: 484, name: 'Union Ads' },
          { value: 300, name: 'Video Ads' }
        ],
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  }
}

export default function CellExample() {

  return <TopView>
    <Header title='Chart' />
    <ScrollView>
      <GroupList>
        <GroupList.Item title='折线图'>
          <Chart
            style={{ height: px(400) }}
            option={options.line}
            components={[LineChart, TooltipComponent, GridComponent, TitleComponent, LegendComponent]}
          />
        </GroupList.Item>
        <GroupList.Item title='柱状图'>
          <Chart
            style={{ height: px(400) }}
            option={options.bar}
            components={[BarChart, TooltipComponent, GridComponent]}
          />
        </GroupList.Item>
        <GroupList.Item title='饼图'>
          <Chart
            style={{ height: px(400) }}
            option={options.pie}
            components={[PieChart, TooltipComponent, GridComponent]}
          />
        </GroupList.Item>
      </GroupList>
    </ScrollView>
  </TopView>
}

版本更新历史

v1.0.2
当前版本

暂无更新日志

未知日期

推荐应用

暂无相关推荐应用

D

duxapp

认证开发者
总下载
0
应用类型
duxapp
最近版本
v1.0.2
应用大小
0.00B

重要声明

免费分享

此应用由开发者免费分享,感谢开发者的无私奉献

技术支持

开发者没有义务免费回答技术问题,请理解并尊重开发者的时间

支持开发

如果应用对您有帮助,欢迎联系开发者进行打赏支持

免责声明

使用此应用前请仔细阅读相关文档,使用过程中如出现任何问题,开发者和平台不承担相应责任。请在充分了解应用功能的前提下谨慎使用。