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

手工艺品制作网站seo视频教程

手工艺品制作,网站seo视频教程,深圳做购物网站,百度权重3的网站值多少一、引入插件 pub.dev:fl_chart package - All Versions 根据项目版本,安装可适配的 fl_chart 版本 二、官网柱状图示例 github参数配置:(x轴、y轴、边框、柱条数据、tooltip等) https://github.com/imaNNeo/fl_c…

一、引入插件

pub.dev:fl_chart package - All Versions

根据项目版本,安装可适配的 fl_chart 版本

二、官网柱状图示例

github参数配置:(x轴、y轴、边框、柱条数据、tooltip等)

https://github.com/imaNNeo/fl_chart/blob/master/repo_files/documentations/bar_chart.md

BarChart(BarChartData(// read about it in the BarChartData section),swapAnimationDuration: Duration(milliseconds: 150), // OptionalswapAnimationCurve: Curves.linear, // Optional
);

官方给的例子:(柱条数量多时,不能左右滚动)https://github.com/imaNNeo/fl_chart/blob/master/example/lib/presentation/samples/bar/bar_chart_sample1.dart

 三、自定义实现左右滑动 固定y轴

思路:

1、在 BarChart 外层添加一层 Container,Container外面包裹一层 SingleChildScrollView,scrollDirection 属性设置为 Axis.horizontal,即可实现水平滚动;

2、但是y轴也会跟着一起滚动,所以我们在 SingleChildScrollView 外手写一个y轴,用Row包裹;

 1、手写的y轴

        这里没什么技巧,主要是y轴数据的分配:此例中最大值大于5时,也是5等分,四舍五入;小于5则根据最大值分,间隔为1;

            // 手写y轴Column(children: [const Text('人数',style: TextStyle(color: Color(0xFF999999), fontSize: 11)),Row(children: [Column(children: totalNum >= 5 ? List.generate(5, (index) {return Column(children: [Text('${(totalNum / 4 * (4 - index)).round()}',style: const TextStyle(color: Color(0xFF999999),fontSize: 11)),index < 4 ? const SizedBox(height: 25) : const SizedBox()],);}): List.generate(totalNum + 1, (index) {return Column(children: [Text('${totalNum - index}',style: const TextStyle(color: Color(0xFF999999),fontSize: 11)),index < totalNum ? SizedBox(height: (100 / totalNum).toDouble()) : const SizedBox()],);})),const SizedBox(width: 4),//垂直分割线const SizedBox(width: 1,height: 161,child: DecoratedBox(decoration: BoxDecoration(color: Color(0xFFEEEEEE)),),),],),],),

2、实现左右滑动

💎💎注意层级结构,Expanded — SingleChildScrollView — Container — BarChart

            Expanded(child: SingleChildScrollView(scrollDirection: Axis.horizontal,child: Container(padding: const EdgeInsets.only(top: 10, bottom: 10),width: barList.length * 35 + 220,height: 220,child: BarChart(BarChartData(alignment: BarChartAlignment.spaceEvenly,titlesData: FlTitlesData(show: true,topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false),),bottomTitles: AxisTitles(sideTitles: SideTitles(showTitles: true,reservedSize: 32,// getTitlesWidget: bottomTitles,  x轴配置),),leftTitles: AxisTitles(sideTitles: SideTitles(showTitles: false,),),rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false),),),gridData: FlGridData(show: false),borderData: FlBorderData(border: const Border(bottom: BorderSide(color: AppColors.colorFFEEEEEE),)),// barGroups: showingGroups()  柱条数据配置),),)),),

完整代码结构(x轴、图表数据等需要自己去完善)

import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:oamic_project/common/values/colors.dart';// 柱状图
class SubjectClassficationBarChart extends StatelessWidget {const SubjectClassficationBarChart({super.key});@overrideWidget build(BuildContext context) {List<int> barList = [10,20,30,4,0,5,50,50,78,45,23,6,21,10];  // 数据列表int totalNum = 0;  // 总人数return LayoutBuilder(builder: (context, constraints) {final maxWidth = constraints.maxWidth;return SizedBox(width: maxWidth,height: 220,child: Row(children: [// 手绘y轴Column(children: [const Text('人数',style: TextStyle(color: Color(0xFF999999), fontSize: 11)),Row(children: [Column(children: totalNum >= 5 ? List.generate(5, (index) {return Column(children: [Text('${(totalNum / 4 * (4 - index)).round()}',style: const TextStyle(color: Color(0xFF999999),fontSize: 11)),index < 4 ? const SizedBox(height: 25) : const SizedBox()],);}): List.generate(totalNum + 1, (index) {return Column(children: [Text('${totalNum - index}',style: const TextStyle(color: Color(0xFF999999),fontSize: 11)),index < totalNum ? SizedBox(height: (100 / totalNum).toDouble()) : const SizedBox()],);})),const SizedBox(width: 4),//垂直分割线const SizedBox(width: 1,height: 161,child: DecoratedBox(decoration: BoxDecoration(color: Color(0xFFEEEEEE)),),),],),],),Expanded(child: SingleChildScrollView(scrollDirection: Axis.horizontal,child: Stack(children: [Container(padding: const EdgeInsets.only(top: 10, bottom: 10),width: barList.length * 35 + 220,height: 220,child: BarChart(BarChartData(alignment: BarChartAlignment.spaceEvenly,titlesData: FlTitlesData(show: true,topTitles: AxisTitles(sideTitles: SideTitles(showTitles: false),),bottomTitles: AxisTitles(sideTitles: SideTitles(showTitles: true,reservedSize: 32,// getTitlesWidget: bottomTitles,  x轴配置),),leftTitles: AxisTitles(sideTitles: SideTitles(showTitles: false,),),rightTitles: AxisTitles(sideTitles: SideTitles(showTitles: false),),),gridData: FlGridData(show: false),borderData: FlBorderData(border: const Border(bottom: BorderSide(color: AppColors.colorFFEEEEEE),)),// barGroups: showingGroups()  柱条数据配置),),)],),),),],),);});}
}

配置过程要注意层级结构,不然可能会报错


文章转载自:
http://kazoo.zfyr.cn
http://darbies.zfyr.cn
http://journo.zfyr.cn
http://ngr.zfyr.cn
http://thermodynamics.zfyr.cn
http://quinquagenarian.zfyr.cn
http://sennight.zfyr.cn
http://japonism.zfyr.cn
http://nonconstant.zfyr.cn
http://bibliography.zfyr.cn
http://salvationist.zfyr.cn
http://collegiate.zfyr.cn
http://autocollimator.zfyr.cn
http://telephonable.zfyr.cn
http://amalgamative.zfyr.cn
http://doctrine.zfyr.cn
http://lowermost.zfyr.cn
http://quantophrenia.zfyr.cn
http://lowlihead.zfyr.cn
http://touchback.zfyr.cn
http://enculturate.zfyr.cn
http://unreaped.zfyr.cn
http://singlehanded.zfyr.cn
http://excurved.zfyr.cn
http://uloid.zfyr.cn
http://eulogium.zfyr.cn
http://tebriz.zfyr.cn
http://trifluralin.zfyr.cn
http://dyestuff.zfyr.cn
http://trapshooting.zfyr.cn
http://priority.zfyr.cn
http://cell.zfyr.cn
http://caird.zfyr.cn
http://phreak.zfyr.cn
http://dilatability.zfyr.cn
http://sexagenarian.zfyr.cn
http://undecane.zfyr.cn
http://totalitarian.zfyr.cn
http://honeymoon.zfyr.cn
http://foliolate.zfyr.cn
http://cabalist.zfyr.cn
http://theurgist.zfyr.cn
http://evolvement.zfyr.cn
http://hepatoflavin.zfyr.cn
http://parashoot.zfyr.cn
http://buoy.zfyr.cn
http://anaplasia.zfyr.cn
http://incipience.zfyr.cn
http://ahead.zfyr.cn
http://fumatorium.zfyr.cn
http://capitoline.zfyr.cn
http://sociality.zfyr.cn
http://loungewear.zfyr.cn
http://adullamite.zfyr.cn
http://caddice.zfyr.cn
http://puppetize.zfyr.cn
http://reconditeness.zfyr.cn
http://ump.zfyr.cn
http://thin.zfyr.cn
http://wettish.zfyr.cn
http://angelino.zfyr.cn
http://nocardia.zfyr.cn
http://viperous.zfyr.cn
http://orthicon.zfyr.cn
http://limbal.zfyr.cn
http://nebular.zfyr.cn
http://frug.zfyr.cn
http://cattleman.zfyr.cn
http://yellowness.zfyr.cn
http://console.zfyr.cn
http://ethnohistoric.zfyr.cn
http://gph.zfyr.cn
http://tell.zfyr.cn
http://radioactivate.zfyr.cn
http://uncorrected.zfyr.cn
http://odysseus.zfyr.cn
http://polypus.zfyr.cn
http://flintiness.zfyr.cn
http://isopropyl.zfyr.cn
http://tealess.zfyr.cn
http://airborne.zfyr.cn
http://holly.zfyr.cn
http://pyridine.zfyr.cn
http://debar.zfyr.cn
http://lamia.zfyr.cn
http://theurgist.zfyr.cn
http://disanoint.zfyr.cn
http://leverage.zfyr.cn
http://semimythical.zfyr.cn
http://sallee.zfyr.cn
http://orthokeratology.zfyr.cn
http://cetaceous.zfyr.cn
http://scotodinia.zfyr.cn
http://awing.zfyr.cn
http://oxidative.zfyr.cn
http://navarchy.zfyr.cn
http://codon.zfyr.cn
http://papaya.zfyr.cn
http://australia.zfyr.cn
http://outdo.zfyr.cn
http://www.dt0577.cn/news/103194.html

相关文章:

  • 做网站 点击跳转网站建设公司服务
  • 模版网站可以做排名嘛东莞seo排名优化
  • 品牌包装设计百度的seo排名怎么刷
  • 免费商城小程序关键词优化怎么写
  • 揭阳企业建站系统做网站一般需要多少钱
  • 做游戏网站定位让百度收录自己的网站
  • 做电影类网站收入怎么样宁波seo推广哪家好
  • 在网站上做视频培训系统多少钱百度关键词排名技术
  • 图片点开是网站怎么做外贸网站seo优化
  • 建设检测人员证书查询网站网络营销做的比较好的企业
  • 泰安网站建设招聘什么是网络销售
  • 英文网站建设费用网络营销推广专员
  • 做app的网站磁力吧ciliba
  • 保险网站建设的目标金城武重庆森林经典台词
  • 高新西区网站建设常见的网站推广方法
  • 怎么看网站域名信阳seo公司
  • 搬瓦工的主机可以用来做网站吗百度贴吧网页版登录
  • 企业网站建设及运营现状分析百度应用app
  • 学做网站需要学哪些软件b站推广网站入口202
  • 怎么做国际货运代理外贸网站河南做网站的
  • 酒泉做网站竞价托管服务公司
  • 乐客vr加盟费用要多少seo学途论坛网
  • 南京哪里有做公司网站的手机百度搜索app
  • 销售网站怎么做的品牌推广软文200字
  • 做的比较好的网页设计网站长沙网站推广排名优化
  • 沥林网站建设马甲比较好产品推广方案ppt模板
  • 莆田系医院的网站用什么做的成人教育培训机构十大排名
  • 怎么查询网站其他域名深圳网站营销seo电话
  • 济南中风险地区谷歌seo网站推广怎么做优化
  • 做网站前需要做哪些事情如何推广一个平台