简体   繁体   English

Flutter 交互式图表图形

[英]Flutter interactive chart graph

I am searching for a package in flutter where I can create a chart with an interactable graph, where I can manipulate data with drag and drop我正在寻找一个颤振的包,我可以在其中创建一个带有可交互图形的图表,在那里我可以通过拖放操作数据

Example: An example chart示例:示例图表

Now I want to ajust each value in that step diagram with drag and drop (up and down)现在我想通过拖放(上下)调整该步骤图中的每个值

I found high charts and some of my collegues used that to do so but not in flutter so im not sure if that is possible there.我发现了高图表,我的一些同事用它来这样做,但不是在颤抖,所以我不确定那里是否可能。

Firstly, It's totally possible to create interactive charts with Flutter.首先,使用 Flutter 创建交互式图表是完全可能的。 You can either implement it yourself with a CustomPainter and some widgets.您可以使用 CustomPainter 和一些小部件自己实现它。

Here's an example of a Curved basic chart.这是一个曲线基本图表的示例。

CustomPaint(
   painter: CurveBackground(color: \\ yourColor),
   child: \\ your child
)


class CurveBackground extends CustomPainter {
  final Color color;

  CurveBackground({this.color});

  @override
  void paint(Canvas canvas, Size size) {
    var paint = Paint();
    paint.color = color;
    paint.style = PaintingStyle.fill;

    var path = Path();

    path.moveTo(0, Dimens.size_30());
    path.quadraticBezierTo(size.width * 0.4, size.height * 0.1,
        size.width * 0.3, size.height * 0.3);
    path.quadraticBezierTo(size.width * 0.1, size.height * 0.6,
        size.width * 0.45, size.height * 0.7);
    path.quadraticBezierTo(
        size.width * 1, size.height * 0.9, size.width * 0.9, size.height * 1.0);
    path.lineTo(size.width, size.height);
    path.lineTo(0, size.height);

    canvas.drawPath(path, paint);
  }

  @override
  bool shouldRepaint(CustomPainter oldDelegate) => true;
}


You can also check out some specialized packages as: syncfusion_flutter_charts I think you'll be interested in the step_line chart .您还可以查看一些专门的软件包: syncfusion_flutter_charts我想您会对step_line chart感兴趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM