标签: sfcartesianchart

Flutter 将 y 轴值显示为字符串

我有一个简单的图表,其中 x 轴为字符串,y 轴为 int,但我的值太长 10000 我需要将其显示为 10k

我的代码

     Container(
          height: MediaQuery.of(context).size.height * 0.25,
          child: SfCartesianChart(
              enableAxisAnimation: true,
              primaryXAxis: CategoryAxis(
                  majorGridLines: MajorGridLines(width: 0),
                  //Hide the axis line of x-axis
                  axisLine: AxisLine(width: 0),
                  interval: 1),
              primaryYAxis: NumericAxis(
                minimum: 0, maximum: highSale,
                interval: highSale < 200 ? 100 : 2000,
                majorGridLines: MajorGridLines(width: 0),
                //Hide the axis line of x-axis
                axisLine: AxisLine(width: 0),
              ),
              tooltipBehavior: _tooltip,
              plotAreaBorderWidth: 0,
              legend: Legend(isVisible: false),
              series: <ChartSeries<_ChartData, String>>[
                ColumnSeries<_ChartData, String>(
                    dataSource: weekly
                        ? data
                        : yearly
                            ? …
Run Code Online (Sandbox Code Playgroud)

dart flutter syncfusion-chart sfcartesianchart

1
推荐指数
1
解决办法
2069
查看次数