MPAndroidChart Flutter version

Overview

MPFlutterChart

flutter charts just like MPAndroidChart

The minimum version currently supported is 1.7.3. If you use flutter with lower version, checkout and use 'localPosition-support' branch, this branch support for flutter version which XXXDetails and PointerXXXEvent not support wiget local postion

Thanks for MPAndroidChart, when translate this library to flutter I learned a lot about matrix use in animation.

todos

1.potential bugs fix

Get Start

1.add dependencies

    dependencies:
        mp_chart: ^0.2.2

2.download example and see how to use

More Examples

LineCharts







BarCharts







PieCharts



OtherCharts





ScrollingCharts





EvenMoreCharts



License

Copyright 2019 SunPointed

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • horizontal zoom not working as individual

    horizontal zoom not working as individual

    horizontal zoom not working as individual even when pinchZoomEnabled: false it is zooming proportional when I try to zoom horizontal. But vertical zooming working individual.

    opened by keskink 14
  • flutter版本用1.5.4出现错误。

    flutter版本用1.5.4出现错误。

    运行测试例子,flutter版本用1.5.4,出现错误,如下: Error: The method 'groupBars' isn't defined for the class 'BarChart'. Error: The getter 'localPosition' isn't defined for the class 'PointerDownEvent'. Error: The getter 'localPosition' isn't defined for the class 'TapDownDetails'.等等。 请问能否支持flutter1.5.4版本?

    opened by inprise1980 9
  • Chart can't move when inside a PageView

    Chart can't move when inside a PageView

    If a chart is inside a PageView, swiping horizontally does not move the chart but instead moving the PageView. Steps to reproduce: 1: Create a chart inside a PageView. This PageView should have more than 2 pages. 2: Pinch the chart to zoom in 3: Drag the chart to move but can't. If you drag vertically then switch to horizontally, the chart can move normally. However, If you try to move it horizontally first, it will not work.

    opened by khanhnguyen-96 4
  • textColor not chaning any legent label colors. (still continue this issue.)

    textColor not chaning any legent label colors. (still continue this issue.)

    textColor not chaning any legent label colors.

    I try too many different method for change legent text color for dark mode. Now legend color is blakc. it can not shown in dark mode.

    Regards

    opened by keskink 4
  • TextPainter.paint called when text geometry was not yet calculated.

    TextPainter.paint called when text geometry was not yet calculated.

    Hello everyone , I now create line chart. sorry that I am not strong English. I have some problem which I don't know why my console call "TextPainter.paint called when text geometry was not yet calculated." while i was tapping the chart ,the marker view didn't show also. Does anyone know what to do for fixing? This is my Code.

    class CreateTest{

    CreateTest(); Widget returnLineChart() { var desc = Description()..enabled = false; var dataPoint = List(); List dataSets = List(); dataPoint.add(Entry(x: 1, y: 2)); dataPoint.add(Entry(x: 2, y: 3)); dataPoint.add(Entry(x: 3, y: 4)); dataPoint.add(Entry(x: 4, y: 5)); dataPoint.add(Entry(x: 5, y: 6)); dataPoint.add(Entry(x: 6, y: 7)); dataPoint.add(Entry(x: 7, y: 8)); dataPoint.add(Entry(x: 8, y: 9)); dataPoint.add(Entry(x: 9, y: 1)); LineDataSet set1; set1 = LineDataSet(dataPoint, "DataSet 1"); set1.setDrawIcons(false); set1.enableDashedLine(10, 5, 0); set1.setColor1(ColorUtils.BLACK); set1.setCircleColor(ColorUtils.BLACK); set1.setHighLightColor(ColorUtils.PURPLE); set1.setLineWidth(1); set1.setCircleRadius(3); set1.setDrawCircleHole(false); set1.setFormLineWidth(1); set1.setFormLineDashEffect(DashPathEffect(10, 5, 0)); set1.setFormSize(15); set1.setValueTextSize(9); set1.enableDashedHighlightLine(10, 5, 0); set1.setDrawFilled(true); set1.setFillColor(ColorUtils.FADE_RED_END); dataSets.add(set1); var controller = LineChartController( axisLeftSettingFunction: (axisLeft, controller) { axisLeft ..drawLimitLineBehindData = true ..enableGridDashedLine(10, 10, 0) ..enableAxisLineDashedLine(5, 5, 0) ..setAxisMaximum(10) ..setAxisMinimum(1); }, axisRightSettingFunction: (axisRight, controller) { axisRight.enabled = (false); }, legendSettingFunction: (legend, controller) { legend.shape = (LegendForm.LINE); }, xAxisSettingFunction: (xAxis, controller) { xAxis ..drawLimitLineBehindData = true ..enableAxisLineDashedLine(5, 5, 0) ..enableGridDashedLine(10, 10, 0); }, drawGridBackground: false, backgroundColor: ColorUtils.WHITE, dragXEnabled: true, dragYEnabled: true, scaleXEnabled: true, scaleYEnabled: true, pinchZoomEnabled: true, description: desc); controller.setViewPortOffsets(16, 16, 16, 16); controller.data = LineData.fromList(dataSets); return LineChart(controller); }

    }

    opened by izzabellerina 4
  • [bug] problem in autoScale

    [bug] problem in autoScale

    i create to custom autoScale for combind follow Candle data

    https://streamable.com/wfqkw

      @override
      void onMoveUpdate(double x, double y) {
        double xmin=controller.getValuesByTouchPoint(controller.viewPortHandler.contentLeft(),controller.viewPortHandler.contentBottom(), AxisDependency.RIGHT).x;
        double xmax=controller.getValuesByTouchPoint(controller.viewPortHandler.contentRight(),controller.viewPortHandler.contentBottom(), AxisDependency.RIGHT).x;
    
        double ymin=controller.getValuesByTouchPoint(controller.viewPortHandler.contentRight(),controller.viewPortHandler.contentBottom(), AxisDependency.RIGHT).y;
        double ymax=controller.getValuesByTouchPoint(controller.viewPortHandler.contentRight(),controller.viewPortHandler.contentTop(), AxisDependency.RIGHT).y;
        double candle_y_max=0;
        double candle_y_min=double.maxFinite;
    
        for(int i=xmin.toInt();i<xmax;i++){
          if(i>=0 && i< entries.length){
            if(candle_y_min>entries[i].shadowLow){
              candle_y_min=entries[i].shadowLow;
            }
            if(candle_y_max<entries[i].shadowHigh){
              candle_y_max=entries[i].shadowHigh;
            }
          }
    
        }
        double space=0.20;
        controller.moveViewTo(xmin,(candle_y_min+((ymax-ymin)/2))-space, AxisDependency.RIGHT);
        controller.setVisibleYRange(0.0,(candle_y_max-candle_y_min)+(space),AxisDependency.RIGHT);
        
      }
    
    opened by m2faridi 4
  • LongPress events?

    LongPress events?

    Please consider adding onLongPressStart, onLongPressMoveUpdate, and onLongPressEnd events to OnTouchEventListener.

    Because I want to implement like this: On simple drag => move the chart On long press drag => move the highlight marker

    opened by crizant 3
  • Pie Chart Center Text fontFamily and fontWeight bug fix and new options centerTextColor and centerTextSize

    Pie Chart Center Text fontFamily and fontWeight bug fix and new options centerTextColor and centerTextSize

    • Pie Chart Center Text fontFamily and fontWeight were not working, fixed the bug, now below code should set the font PieChartController(centerTextTypeface: TypeFace(fontFamily: 'Roboto', fontWeight: FontWeight.bold));

    • Pie Chart Center Text added new options to customize centerTextColor and centerTextSize, current version was always painting text in Black with 12 font size. After this change if values are provided using PieChartController these will be used, if these are null then current implementation will work with backward compatibility PieChartController(centerText: '2020',centerTextColor: AppColors.blue, centerTextSize: 20); Change details

    @SunPointed If you like the changes, feel free to pull

    opened by absar 2
  • moveViewToX does not work

    moveViewToX does not work

    opened by typ0520 2
  • Transparence does not work

    Transparence does not work

    I want to combine 2 Horizontal Bar Chart and Scatter Plot Chart. Although I use Stack to overlap together, 2 charts are put on one background but don't have transparent field => Chart 1 cannot be displayed. I set drawGridBackground: false but it doesn't work. Please give me a solution, thank you.

    opened by dunght196 2
  • Linechart  setGradientColors not working...

    Linechart setGradientColors not working...

    I am using linechart in one of my application. I want to show multiple gradient colors. I have used setGradientColors() as follow;

    LineDataSet set1 = LineDataSet(vals, Strings.emptyString); set1.setColor1(Colors.black); set1.setDrawValues(false); set1.setDrawFilled(true); List<GradientColor> gradientColors = []; gradientColors.add(GradientColor(Colors.red, Colors.green)); gradientColors.add(GradientColor(Colors.yellow, Colors.blue)); gradientColors.add(GradientColor(Colors.amber, Colors.pink)); gradientColors.add(GradientColor(Colors.purple, Colors.cyan)); gradientColors.add(GradientColor(Colors.red, Colors.yellow)); set1.setGradientColors(gradientColors); set1.setLineWidth(1); set1.setDrawCircles(false);

    But its not working and linechart shows only one color as following;

    Screenshot 2022-01-20 at 9 29 09 PM

    @SunPointed So, pls help to find proper solution. Thanks in advance.

    opened by nbsathawara 0
  •  The method 'then' isn't defined for the class 'FutureOr<dynamic>'

    The method 'then' isn't defined for the class 'FutureOr'

    Try correcting the name to the name of an existing method, or defining a method named 'then'. .then((value) { ^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/mp_chart-0.3.1/lib/mp/core/utils/painter_utils.dart:15:34: Error: The getter 'text' isn't defined for the class 'InlineSpan'.

    • 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/flutter/packages/flutter/lib/src/painting/inline_span.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. var preText = painter.text.text;
    opened by safu2011 5
  • Is this lib discontinued ?

    Is this lib discontinued ?

    As this lib has no update since 30th October 2020 : https://pub.dev/packages/mp_chart

    So, is there any update after this ?

    because , in our current running project its conflicting with other libs.

    Please provide updates.

    opened by mehtahardikr 2
  • Problems encountered when running the sample project(运行示例项目碰到的问题)

    Problems encountered when running the sample project(运行示例项目碰到的问题)

    Q1:../lib/mp/chart/chart.dart:51:12: Error: The method 'then' isn't defined for the class 'FutureOr<dynamic>'. Try correcting the name to the name of an existing method, or defining a method named 'then'. .then((value) {

    A1:change ‘../lib/mp/chart/chart.dart:51’ before: ImageGallerySaver.saveImage(Uint8List.fromList(imgFile.readAsBytesSync())) .then((value) { imgFile.delete(); }); after: var result = ImageGallerySaver.saveImage(Uint8List.fromList(imgFile.readAsBytesSync())); if(result is Future<dynamic>){ result.then((value) => imgFile.delete()); }

    Q2:`../lib/mp/core/utils/painter_utils.dart:15:34: Error: The getter 'text' isn't defined for the class 'InlineSpan'.

    • 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/E:/flutter/packages/flutter/lib/src/painting/inline_span.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. var preText = painter.text.text;A2:change '../lib/mp/core/utils/painter_utils.dart:15' before:var preText = painter.text.text;after:var preText = (painter.text as TextSpan).text;`

    If you have other questions, you can try to leave me a message

    opened by Alrey-xxl 1
Owner
null
Flutter-watchtips - Flutter App (Embedded Watch Kit app with iOS version)

watchtips Update Version 2.2 The Watch tips project has been updated again, The interface has been tidied up and a seperate value for the tip cost has

Steve Rogers 137 Dec 31, 2022
Flutter Version Management: A simple cli to manage Flutter SDK versions.

fvm Flutter Version Management: A simple cli to manage Flutter SDK versions. Features: Configure Flutter SDK version per project or globally Ability t

于飞 242 Dec 18, 2022
Cupertino version of the Material Stepper in Flutter

Cupertino Stepper for Flutter Cupertino version of the stock Material Stepper in Flutter. NOTE: This is not the same as the UIStepper control on iOS.

J-P Nurmi 18 Oct 13, 2022
An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch.

Colours An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch. Getting Started In your flut

Salman S 4 Nov 23, 2021
Replaces Flutter's bundled Dart SDK with the macOS arm64 version

This script replaces Flutter's bundled Dart SDK with the macOS arm64 version Get

null 21 Oct 9, 2022
A Flutter widget that checks and displays the version status of application and you can easily guide user to update your app

A most easily usable Flutter widget about application version check! 1. About 1.

Kato Shinya 1 Dec 16, 2021
A flutter plugin to get android version(SDK INT).

get_sdk_int A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized package that i

jinyus 0 Dec 28, 2021
Flutter package for prompting users to upgrade when there is a newer version of the app in the store.

Upgrader Flutter package for prompting users to upgrade when there is a newer version of the app in the store. When a newer app version is availabe in

Larry Aasen 362 Jan 1, 2023
Time-Tracker is a cross platform software integrated with Firebase and this is the mobile version created with Flutter.

Time Tracker | Flutter Time tracker is a cloud based task manager where you can manage your tasks in your mobile or web browser in a same time or in a

AmirHossein Mohammadi 10 Oct 25, 2022
Weibo@Flow - A third party Weibo client for Android with Material You theming (iOS version later). 💪 Powered by Flutter 💪

Weibo@Flow - A third party Weibo client for Android with Material You theming (iOS version later). ?? Powered by Flutter ??

妇校长 6 Sep 19, 2022
A mobile version of the COCO Explorer written in Dart with Flutter Framework.

COCO Explorer Mobile A mobile version of the COCO Explorer written in Dart with Flutter Framework. Cloning the repo From GitHub: Download or clone the

Mohammad Sobhy 2 May 13, 2022
An updated version of flutter_kid_starter from - quangrau using the latest Flutter 3.0 SDK

This application is an updated version of flutter_kid_starter from - quangrau using the latest Flutter 3.0 SDK, to update this awesome open-source application.

Md. Siam 29 Oct 12, 2022
📲 Flutter application that uses CycleGAN to generates an anime version from a selfie.

This application allows you to capture a picture of yourself or upload an existing image, then using Cycle-Consistent Adversarial Network (CycleGAN) t

null 3 Jun 19, 2022
Check if your Flutter app has a newer version.

Flutter NeoVersion Check if a new version of a Flutter app is available on the app stores. The plugin uses the Peek-An-App API to get information abou

József Sallai 3 Oct 6, 2022
A more flexible version of Flutter's ColorScheme.fromSeed

FlexSeedScheme A more flexible version of Flutter's ColorScheme.fromSeed. Use this package like ColorScheme.fromSeed with the following additional cap

Rydmike 9 Dec 12, 2022
[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

Kauê Murakami 11 Nov 9, 2022
Access app version and git informations from auto-generated and configurable widgets

This is a proof of concept and WIP Feedback and ideas welcome !! Access your pubspec and git commit informations like versions and commit status from

Robert Felker 15 Jul 7, 2021
A builder for extracting a package version into code

Include the version of your package in our source code. Add build_version to pubspec.yaml. Also make sure there is a version field. name: my_pkg versi

Kevin Moore 39 Dec 7, 2022
A dart-lang version of the SIP UA stack.

dart-sip-ua A dart-lang version of the SIP UA stack, ported from JsSIP. Overview Use pure dart-lang SIP over WebSocket (use real SIP in your flutter m

Flutter WebRTC 255 Dec 26, 2022