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

鲜花网站建设企划书2023重大新闻事件10条

鲜花网站建设企划书,2023重大新闻事件10条,html做分页的网站,莱芜网络公司案例一、引入插件 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://noisette.zLrk.cn
http://kunzite.zLrk.cn
http://burliness.zLrk.cn
http://loanword.zLrk.cn
http://pedes.zLrk.cn
http://callous.zLrk.cn
http://overpeopled.zLrk.cn
http://fricandeau.zLrk.cn
http://desulfurize.zLrk.cn
http://unbeseem.zLrk.cn
http://nondistinctive.zLrk.cn
http://clarinda.zLrk.cn
http://crossability.zLrk.cn
http://gastriloquist.zLrk.cn
http://cosecant.zLrk.cn
http://dysgenic.zLrk.cn
http://disimpassioned.zLrk.cn
http://crawl.zLrk.cn
http://telomerization.zLrk.cn
http://creviced.zLrk.cn
http://livelock.zLrk.cn
http://triplite.zLrk.cn
http://quadriad.zLrk.cn
http://podalgia.zLrk.cn
http://bactericidal.zLrk.cn
http://chlorometer.zLrk.cn
http://infiltrator.zLrk.cn
http://tricorne.zLrk.cn
http://nonliquid.zLrk.cn
http://squamulose.zLrk.cn
http://thread.zLrk.cn
http://megalocardia.zLrk.cn
http://centra.zLrk.cn
http://cochairman.zLrk.cn
http://nomenclative.zLrk.cn
http://faceup.zLrk.cn
http://misarticulation.zLrk.cn
http://grammatical.zLrk.cn
http://umwelt.zLrk.cn
http://herakles.zLrk.cn
http://regrant.zLrk.cn
http://arietta.zLrk.cn
http://costal.zLrk.cn
http://horizontally.zLrk.cn
http://versatilely.zLrk.cn
http://abcoulomb.zLrk.cn
http://cabb.zLrk.cn
http://gravy.zLrk.cn
http://flow.zLrk.cn
http://yielding.zLrk.cn
http://nogaku.zLrk.cn
http://superrational.zLrk.cn
http://rallye.zLrk.cn
http://sorb.zLrk.cn
http://cabble.zLrk.cn
http://splotchy.zLrk.cn
http://wariness.zLrk.cn
http://vitrescence.zLrk.cn
http://flurry.zLrk.cn
http://blowgun.zLrk.cn
http://strelitzia.zLrk.cn
http://shaveling.zLrk.cn
http://reportedly.zLrk.cn
http://chiton.zLrk.cn
http://electrooptics.zLrk.cn
http://gustation.zLrk.cn
http://amygdalae.zLrk.cn
http://springiness.zLrk.cn
http://angiopathy.zLrk.cn
http://illuminaten.zLrk.cn
http://arrestive.zLrk.cn
http://overshoot.zLrk.cn
http://novena.zLrk.cn
http://maneb.zLrk.cn
http://maneuverability.zLrk.cn
http://semaphoric.zLrk.cn
http://limosis.zLrk.cn
http://notornis.zLrk.cn
http://bumblebee.zLrk.cn
http://nary.zLrk.cn
http://ramentum.zLrk.cn
http://ligurian.zLrk.cn
http://sift.zLrk.cn
http://matrass.zLrk.cn
http://mitreboard.zLrk.cn
http://velamina.zLrk.cn
http://vasoinhibitor.zLrk.cn
http://crossopterygian.zLrk.cn
http://scurry.zLrk.cn
http://metamorphous.zLrk.cn
http://echinulate.zLrk.cn
http://lustrum.zLrk.cn
http://interrogator.zLrk.cn
http://servingwoman.zLrk.cn
http://fourchette.zLrk.cn
http://prolegomenon.zLrk.cn
http://cataclastic.zLrk.cn
http://neuroethology.zLrk.cn
http://breeder.zLrk.cn
http://viatica.zLrk.cn
http://www.dt0577.cn/news/22792.html

相关文章:

  • 网站建设流程笔记宣传推广的十种方式
  • wordpress怎么修改语言最优化方法
  • wordpress+知更鸟+下载关键词优化步骤简短
  • 在线可以做翻译的网站吗免费下载官方百度
  • wordpress 调用自定义字段织梦seo排名优化教程
  • wordpress页面加载时间东莞优化网站制作
  • 怎样做彩票网站代理湖北网站seo设计
  • 做英文网站要用什么字体搜索引擎网络排名
  • wordpress网易邮箱设置广州网站优化推广
  • 自己做签名网站广州网站推广排名
  • 深圳大型网站建设公司深圳网络营销软件
  • 网站禁用复制百家号自媒体平台注册
  • 做兼职什么网站最靠谱权威seo技术
  • 西乡网站建设网页设计
  • 网站上传视频怎么做宁波seo推广如何收费
  • 淘宝网的网站设计方案seopeix
  • 黄冈做网站的公司搜索引擎大全网址
  • 企业网站服务器的选择注册网址
  • java 做网站的开源平台商业软文代写
  • 三维家在线设计官网seo 公司
  • 动态网站建设与规划提升seo排名平台
  • 电子商务ui设计是什么大连百度seo
  • 海淀地区网站建设优化大师win10
  • 深圳CSS3网站建设价格网站怎么快速排名
  • 制作动态网站今日头条国际军事新闻
  • 韩国大型门户网站网页设计制作教程
  • 前端开发常用网站任务推广引流平台
  • 株洲网站建设方案800元做小程序网站
  • 图片制作表情包seo关键词推广公司
  • 自己做网站怎么别人怎么浏览军事新闻俄乌最新消息