Flutter 統(tǒng)計圖表

基于?syncfusion_flutter_charts 統(tǒng)計圖表進行的調(diào)整
我遇到的問題是 使用 syncfusion_flutter_charts 統(tǒng)計圖數(shù)據(jù)多的話需要左右可以滑動,但是假如在list里面,syncfusion_flutter_charts 圖標的滑動手勢優(yōu)先級高于 界面本身list的滑動。這就導(dǎo)致在手指碰觸到統(tǒng)計圖表滑動界面的時候滑不動。

基于這個情況,針對syncfusion_flutter_charts源碼進行分析得出圖標上添加了橫向滑動和縱向滑動的手勢。他們是統(tǒng)一添加到圖標上的,針對該情況,對源碼進行的調(diào)整,把界面上添加的手勢全部給放出來,這樣可以針對性對弄個手勢進行禁用或啟用。方便使用

改造后的插件地址??https://gitee.com/breakfly/syncfusion_flutter_charts.git

本插件使用了是?syncfusion_flutter_charts 26.1.41為依托修改的,在flutter 3.22.0一下版本的時候會出現(xiàn)syncfusion_flutter_core 中 colorTheme報錯的問題。原因是找不到對應(yīng)的參數(shù)。針對這個我進行了統(tǒng)一改成統(tǒng)一顏色值處理 在 packages/syncfusion_flutter_core 中

添加插件
syncfusion_flutter_charts:

? ? git:

? ? ? url: https://gitee.com/breakfly/syncfusion_flutter_charts.git

? ? ? path: packages/syncfusion_flutter_charts

實例

SfCartesianChart(

? ? ? ? ? ? ? plotAreaBorderWidth: 0,

? ? ? ? ? ? ? primaryXAxis: const CategoryAxis(

? ? ? ? ? ? ? ? autoScrollingDelta: 10,

? ? ? ? ? ? ? ? majorGridLines: MajorGridLines(dashArray: [5, 5]),

? ? ? ? ? ? ? ),

? ? ? ? ? ? ? primaryYAxis: const NumericAxis(

? ? ? ? ? ? ? ? minimum: 0,

? ? ? ? ? ? ? ? interval: 20,

? ? ? ? ? ? ? ? majorGridLines: MajorGridLines(dashArray: [5, 5]),

? ? ? ? ? ? ? ),



? ? ? ? ? ? ? tooltipBehavior: TooltipBehavior(enable: true),

? ? ? ? ? ? ? zoomPanBehavior:

? ? ? ? ? ? ? ? ? CustomPanBehavior(panDirection: AxisOrientation.horizontal),

? ? ? ? ? ? ? margin: EdgeInsets.fromLTRB(10, 30.w, 20, 10),

? ? ? ? ? ? ? series: <CartesianSeries<CheckModel, dynamic>>[

? ? ? ? ? ? ? ? // Renders line chart

? ? ? ? ? ? ? ? ColumnSeries<CheckModel, dynamic>(

? ? ? ? ? ? ? ? ? ? dataSource: [

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 12, text: "12月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 20, text: "11月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 18, text: "10月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 17, text: "9月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "8月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "7月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "6月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "5月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "4月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "3月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "2月"),

? ? ? ? ? ? ? ? ? ? ? CheckModel(id: 22, text: "1月")

? ? ? ? ? ? ? ? ? ? ],

? ? ? ? ? ? ? ? ? ? name: '簽約',

? ? ? ? ? ? ? ? ? ? gradient: const LinearGradient(

? ? ? ? ? ? ? ? ? ? ? ? begin: Alignment.bottomCenter,

? ? ? ? ? ? ? ? ? ? ? ? end: Alignment.topCenter,

? ? ? ? ? ? ? ? ? ? ? ? colors: [Color(0xffffffff), Color(0xff0772D8)]),

? ? ? ? ? ? ? ? ? ? markerSettings: const MarkerSettings(isVisible: false),

? ? ? ? ? ? ? ? ? ? xValueMapper: (CheckModel sales, _) => sales.text,

? ? ? ? ? ? ? ? ? ? yValueMapper: (CheckModel sales, _) => sales.id),

? ? ? ? ? ? ? ]),

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容