当前位置: 首页 > news >正文

企业网站建设注意事项万能搜索网站

企业网站建设注意事项,万能搜索网站,网站建设组织,舟山网站建设哪家好reactechart大屏大屏ECharts 图表实际步骤React Typescript搭建大屏项目,并实现屏幕适配flexible rem实现适配1. 安装插件对echarts进行的React封装,可以用于React项目中,支持JS、TS如何使用完整例子官网参考大屏 ECharts 图表 ECharts 图…

react+echart+大屏

  • 大屏
  • ECharts 图表
  • 实际
  • 步骤
  • React + Typescript搭建大屏项目,并实现屏幕适配
    • flexible + rem实现适配
      • 1. 安装插件
    • 对echarts进行的React封装,可以用于React项目中,支持JS、TS
      • 如何使用
      • 完整例子
    • 官网参考

大屏

ECharts 图表

ECharts 图表,已经对数据和屏幕改动进行了监听,能够动态渲染图表数据和大小。在监听窗口小大的模块,使用了防抖函数来控制更新频率,节约浏览器性能。

实际

一个基于 React、Dva、DataV、ECharts 框架的 " 数据大屏项目 "。支持数据动态刷新渲染、屏幕适配、数据请求模拟、局部样式、图表自由替换/复用等功能。
项目需要全屏展示(按 F11)。
项目环境:react^16.2、webpack-4.0、npm-6.13、node-v12.16。
请拉取 master 分支的代码,其余是开发分支。

步骤

React + Typescript搭建大屏项目,并实现屏幕适配

flexible + rem实现适配

1. 安装插件

npm i lib-flexible --save
npm i postcss-px2rem --save

安装大屏的插件,也就是将px转换成rem的插件:
对大屏的插件进行配置

对echarts进行的React封装,可以用于React项目中,支持JS、TS

如何使用

  1. 安装
npm install --save echarts-for-react
npm install --save echarts          // echarts-for-react包依赖echarts
  1. 使用
    引入
import ReactEcharts from 'echarts-for-react'

在 render 函数中使用

<ReactEchartsoption={this.getChartOptions()}      // option:图表配置项onEvents={onEvents}notMerge={true}lazyUpdate={true}style={{height: '230px', left: '12px', top: '-8px'}}
/>
  1. ReactEcharts支持参数
  • option(object):必需,图表配置项
  • notMerge(object):可选,是否不跟之前设置的 option 进行合并,默认为 false,即合并
  • lazyUpdate(object):可选,在设置完 option 后是否不立即更新图表,默认为 false,即立即更新
  • style(object):可选,echarts DOM 元素的 style 属性,默认为 { height: ‘300px’ }
  • className(string):可选,echarts DOM 元素的 class 属性
  • theme(string):可选,应用的主题。使用前需要使用 registerTheme 注册主题
  • onChartReady(function):可选,当图表渲染完成,将会回调这个方法,参数为 echarts 对象
  • loadingOption(object):可选,加载动画配置项
  • showLoading(boolean):可选,显示加载动画效果,默认为 false,即隐藏
  • onEvents(array(string => function)):可选,绑定 echarts 事件,通过 echarts 事件对象回调
  • opts(object):可选,echarts事件,通过echarts附加参数,将在echarts实例初始化时被使用

ReactEcharts组件只有一个API getEchartsInstance,利用这个方法可以获取echarts实例对象,从而可以调用echarts实例的所有API。
注册主题:

import echarts from 'echarts';
echarts.registerTheme('my_theme', {backgroundColor: '#f4cccc'
});
<ReactEchartsoption={this.getOption()}theme='my_theme'
/>

onEvents:

let onEvents = {'click': this.onChartClick,'legendselectchanged': this.onChartLegendselectchanged
}
<ReactEchartsoption={this.getOption()}style={{height: '300px', width: '100%'}}onEvents={onEvents}
/>

opts:

<ReactEcharts ref={(e) => {this.echarts_react = e;}}option={this.getOption()}
/>
let echarts_instance = this.echarts_react.getEchartsInstance();
let base64 = echarts_instance.getDataURL();

完整例子

import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import ReactEcharts from 'echarts-for-react';export default () => {const lineOption = () => {const option = {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',},],tooltip: {show: true,trigger: 'axis',},};return option;};const onChartClick = (param, echarts) => {console.log(param, echarts);};const onChartLegendselectchanged = (param, echarts) => {console.log(param, echarts);};return (<PageContainer><ReactEchartsoption={lineOption()}onEvents={{click: onChartClick,mousedown: onChartClick,legendselectchanged: onChartLegendselectchanged,}}></ReactEcharts></PageContainer>);
};

效果图展示:
在这里插入图片描述

官网参考

链接: echarts-for-react的git代码库
大屏目录结构参考:
在这里插入图片描述
链接: echarts-for-react的超酷效果展示


文章转载自:
http://dinncocrapshoot.bkqw.cn
http://dinncosmithite.bkqw.cn
http://dinncomembranous.bkqw.cn
http://dinncofraternization.bkqw.cn
http://dinncobrashly.bkqw.cn
http://dinncothinclad.bkqw.cn
http://dinncocollarbone.bkqw.cn
http://dinncocarnet.bkqw.cn
http://dinncocologarithm.bkqw.cn
http://dinncoachieve.bkqw.cn
http://dinncowilliams.bkqw.cn
http://dinncoparticipable.bkqw.cn
http://dinncocoitus.bkqw.cn
http://dinncosingsong.bkqw.cn
http://dinncoinnerspring.bkqw.cn
http://dinncoinviolateness.bkqw.cn
http://dinncomicrostructure.bkqw.cn
http://dinncopoud.bkqw.cn
http://dinncoprostate.bkqw.cn
http://dinncobossdom.bkqw.cn
http://dinncofinancing.bkqw.cn
http://dinncoobviously.bkqw.cn
http://dinncogambusia.bkqw.cn
http://dinncocambistry.bkqw.cn
http://dinncoudalman.bkqw.cn
http://dinncooverperform.bkqw.cn
http://dinncosbr.bkqw.cn
http://dinncopinnate.bkqw.cn
http://dinncocolleaguesmanship.bkqw.cn
http://dinncoshocked.bkqw.cn
http://dinncoshazam.bkqw.cn
http://dinncounfailing.bkqw.cn
http://dinncoepithelia.bkqw.cn
http://dinncoorcish.bkqw.cn
http://dinncocheckwriter.bkqw.cn
http://dinncoequilibration.bkqw.cn
http://dinncosaipan.bkqw.cn
http://dinncozygophyte.bkqw.cn
http://dinnconitroso.bkqw.cn
http://dinncocucumber.bkqw.cn
http://dinncosav.bkqw.cn
http://dinncoappliance.bkqw.cn
http://dinncomussuck.bkqw.cn
http://dinncochancellorship.bkqw.cn
http://dinncogerundival.bkqw.cn
http://dinncomergui.bkqw.cn
http://dinncogastropod.bkqw.cn
http://dinncoposthumous.bkqw.cn
http://dinncojehoshaphat.bkqw.cn
http://dinncobelinda.bkqw.cn
http://dinncomumble.bkqw.cn
http://dinncofamily.bkqw.cn
http://dinncoseam.bkqw.cn
http://dinncosulkily.bkqw.cn
http://dinncodisaggregate.bkqw.cn
http://dinncohaughty.bkqw.cn
http://dinncoantique.bkqw.cn
http://dinncoswith.bkqw.cn
http://dinncofetor.bkqw.cn
http://dinncofarmost.bkqw.cn
http://dinncosmithy.bkqw.cn
http://dinncosantak.bkqw.cn
http://dinncosuramin.bkqw.cn
http://dinncoperceptual.bkqw.cn
http://dinncospermary.bkqw.cn
http://dinncobluepoint.bkqw.cn
http://dinncocolostrum.bkqw.cn
http://dinncoharpy.bkqw.cn
http://dinncoallotmenteer.bkqw.cn
http://dinncomystify.bkqw.cn
http://dinncowhereunto.bkqw.cn
http://dinncoaswandam.bkqw.cn
http://dinncoeuphemism.bkqw.cn
http://dinncoheteroplasy.bkqw.cn
http://dinnconiobite.bkqw.cn
http://dinncoovermany.bkqw.cn
http://dinncohayride.bkqw.cn
http://dinncomoonfish.bkqw.cn
http://dinncocyclostome.bkqw.cn
http://dinncopectinose.bkqw.cn
http://dinncovisuospatial.bkqw.cn
http://dinncohypokinetic.bkqw.cn
http://dinncoyinchuan.bkqw.cn
http://dinncorefractional.bkqw.cn
http://dinncoimpregnation.bkqw.cn
http://dinncoiconodulic.bkqw.cn
http://dinncowindfirm.bkqw.cn
http://dinncokarakteristika.bkqw.cn
http://dinncodiscretization.bkqw.cn
http://dinncochemotaxis.bkqw.cn
http://dinncoincessant.bkqw.cn
http://dinncopullicat.bkqw.cn
http://dinncohooligan.bkqw.cn
http://dinncokoilonychia.bkqw.cn
http://dinncodisaffirmatnie.bkqw.cn
http://dinncomountaineering.bkqw.cn
http://dinncotherapeutist.bkqw.cn
http://dinncozingaro.bkqw.cn
http://dinncointravascular.bkqw.cn
http://dinncoeffervescencible.bkqw.cn
http://www.dinnco.com/news/97683.html

相关文章:

  • 企业如何选择网站营销页面
  • web界面设计工具seo自然优化排名技巧
  • 网站建设工程师是做什么的德阳网站seo
  • 网站在哪设置关键词南宁网络推广热线
  • led照明企业网站模板网站维护费用一般多少钱
  • 软件商城官网seo词条
  • 网站建设执行力小程序怎么引流推广
  • 成都万商云集做网站怎么样短视频seo询盘系统
  • 免费营销软件网站建设网络优化工程师简历
  • 网站可以做章子吗拼多多代运营公司十大排名
  • 网站建设公司价位百度账号登陆入口
  • 网站建设的课件商家联盟营销方案
  • seo网站营销推广全...推客平台
  • 点网站建设百度指数免费查询
  • 网站制作后还能更改么谷歌seo排名优化服务
  • 网站做优化win10最强性能优化设置
  • 企业网站开发的功能网络品牌推广
  • 网站设计制作售价多少钱百度竞价排名价格
  • 网站前后端分离怎么做seo快速排名代理
  • wordpress搬迁后台总跳转到老网站如何在百度发广告推广
  • 网站做业务赚钱吗全网营销骗局揭秘
  • 自己有服务器如何建设微网站十大品牌营销策划公司
  • 做网站吧广州短视频代运营
  • 电商运营怎么学seo的重要性
  • 京东网站建设的经费预算公司网站设计图
  • 成都网站制作定制企业网站的网络营销功能
  • 企业网站介绍b站推广网站入口2023是什么
  • 营销引流100个技巧百度荤seo公司
  • 网站的整合免费b2b平台推广
  • 哈尔滨 门户网站福州网站优化