Comments (6)
Hi @Hesham-Dev-LY, thank you for open the first issue!
Can you show me a reproducible example?
EDIT
I created the reproduced example. That occurs when switching the view mode state.
I'll try to fix the bug. Thanks.
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:time_chart/time_chart.dart';
// Data must be sorted.
final smallDataList = [
DateTimeRange(
start: DateTime(2021, 2, 24, 23, 15),
end: DateTime(2021, 2, 25, 7, 30),
),
DateTimeRange(
start: DateTime(2021, 2, 22, 1, 55),
end: DateTime(2021, 2, 22, 9, 12),
),
DateTimeRange(
start: DateTime(2021, 2, 20, 0, 25),
end: DateTime(2021, 2, 20, 7, 34),
),
DateTimeRange(
start: DateTime(2021, 2, 17, 21, 23),
end: DateTime(2021, 2, 18, 4, 52),
),
DateTimeRange(
start: DateTime(2021, 2, 13, 6, 32),
end: DateTime(2021, 2, 13, 13, 12),
),
DateTimeRange(
start: DateTime(2021, 2, 1, 9, 32),
end: DateTime(2021, 2, 1, 15, 22),
),
DateTimeRange(
start: DateTime(2021, 1, 22, 12, 10),
end: DateTime(2021, 1, 22, 16, 20),
),
];
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
ViewMode _viewMode = ViewMode.weekly;
@override
Widget build(BuildContext context) {
final sizedBox = const SizedBox(height: 16);
// List<DateTimeRange> bigDataList = getRandomSampleDataList();
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Time chart example app')),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
const Text('Weekly time chart'),
TimeChart(
data: smallDataList,
viewMode: _viewMode,
),
Switch(value: _viewMode == ViewMode.weekly, onChanged: (_) {
setState(() {
_viewMode = _viewMode == ViewMode.weekly ? ViewMode.monthly : ViewMode.weekly;
});
}),
],
),
),
),
),
);
}
}
from time_chart.
-
Switching between View models
https://user-images.githubusercontent.com/66942907/129542489-915bc109-21e9-4ba7-8668-021ee05c3a89.mp4 -
adding two TimeChart with different ViewMode
https://user-images.githubusercontent.com/66942907/129542519-c1096e80-77b5-4a11-85f5-54e3b50b76dd.mp4
from time_chart.
Well, the below code is working without any bugs. For now, I'll release the plugin that fixed the first issue. And please test again. Thank you.
import 'package:flutter/material.dart';
import 'package:time_chart/time_chart.dart';
// Data must be sorted.
final smallDataList = [
DateTimeRange(
start: DateTime(2021, 2, 24, 23, 15),
end: DateTime(2021, 2, 25, 7, 30),
),
DateTimeRange(
start: DateTime(2021, 2, 22, 1, 55),
end: DateTime(2021, 2, 22, 9, 12),
),
DateTimeRange(
start: DateTime(2021, 2, 20, 0, 25),
end: DateTime(2021, 2, 20, 7, 34),
),
DateTimeRange(
start: DateTime(2021, 2, 17, 21, 23),
end: DateTime(2021, 2, 18, 4, 52),
),
DateTimeRange(
start: DateTime(2021, 2, 13, 6, 32),
end: DateTime(2021, 2, 13, 13, 12),
),
DateTimeRange(
start: DateTime(2021, 2, 1, 9, 32),
end: DateTime(2021, 2, 1, 15, 22),
),
DateTimeRange(
start: DateTime(2021, 1, 22, 12, 10),
end: DateTime(2021, 1, 22, 16, 20),
),
];
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Time chart example app')),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
const Text('Weekly time chart'),
TimeChart(
data: smallDataList,
timeChartSizeAnimationDuration: Duration(milliseconds: 200),
chartType: ChartType.time,
viewMode: ViewMode.weekly,
),
TimeChart(
data: smallDataList,
timeChartSizeAnimationDuration: Duration(milliseconds: 200),
chartType: ChartType.time,
viewMode: ViewMode.monthly,
),
],
),
),
),
),
);
}
}
from time_chart.
I've released version 0.2.7.
from time_chart.
Hi @Hesham-Dev-LY,
I fixed the first issue, but I don't know the second issue is fixed because I can't reproduce it.
Can you show the example code?
from time_chart.
I didn't do anything big, I just put them in one column
TimeChart(
data: data,
timeChartSizeAnimationDuration: Duration(milliseconds: 200),
chartType: ChartType.time,
barColor: mainBlue,
viewMode: ViewMode.weekly,
),
TimeChart(
data: data,
timeChartSizeAnimationDuration: Duration(milliseconds: 200),
chartType: ChartType.time,
barColor: mainBlue,
viewMode: ViewMode.monthly,
)
from time_chart.
Related Issues (20)
- Scroll bug in IOS
- DateTimeRange OverFlow HOT 8
- Working when has empty data list
- Failed to Process Time Difference in second HOT 1
- Chart doesn't display on IOS Emulator(physical phone didn't check) HOT 3
- Simplify or Remove `ChartEngine`
- Migrate Flutter version to 3.0.0
- Limit the Y axis
- Bump intl package version to 0.18.0 if possible HOT 2
- Add onBarSelected returning the TimeRangeClicked HOT 1
- scroll chart get stuck with dynamic data ... HOT 1
- Wrong week day is shown for same day PM time date range HOT 3
- Intl & time_chart version not matched
- Can you give me a demo that looks exactly like this picture? Is it misleading? HOT 1
- Package 0.5.4 crash with last flutter SDK HOT 1
- Couldn't find constructor TextScaler.linear HOT 1
- Bump Intl version to 0.19.0
- Add tests HOT 1
- Resolve overflow and add disabling feature in tooltip HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from time_chart.