I have weird repetition on my line chart's y-axis. If I dont give desiredIntervals or if the values are less than desired intervals the y-axis plots the values twice, like for example in case if y-axis values are 0, 0, 2, 0, 0, 2. Then it should just put the interval 2 but instead it displays, 0, 1, 1, 2, 2 on y-axis
Hi, We have shared a sample browser and UG link below for your reference. You can refer to these links to achieve your requirements. UG link : help.syncfusion.com/flutter/cartesian-charts/axis-types#customizing-interval Sample browser link : flutter.syncfusion.com/#/cartesian-charts/axis-features/interval-type
Hello, Thank you for reaching out. In SfCartesianChart, we can render multiple series by adding the required series in the series collection property. Here, we have added a three-line series with different data points inside the series collection property. Kindly review the code snippet below: SfCartesianChart( primaryXAxis: NumericAxis(), primaryYAxis: NumericAxis(), series: >[ LineSeries( dataSource: firstLine, xValueMapper: (ChartSampleData sales, int index) => sales.x, yValueMapper: (ChartSampleData sales, int index) => sales.y, color: Colors.blue, ), LineSeries( dataSource: secondLine, xValueMapper: (ChartSampleData sales, int index) => sales.x, yValueMapper: (ChartSampleData sales, int index) => sales.y, color: Colors.red, ), LineSeries( dataSource: thirdLine, xValueMapper: (ChartSampleData sales, int index) => sales.x, yValueMapper: (ChartSampleData sales, int index) => sales.y, color: Colors.green, ), ], ),
Hello, We have analyzed your query and implemented the simple sample with the provided code snippet. As the data list is missing in the provided code snippet, assigned the data list with the dummy data points with three points each, and checked with your exact code. Two-line series with three data points, each is rendered properly with the attached sample below, and it is working fine from our end. If you face the issue further, we recommend you share the sample with data points in a runnable state, and it will be helpful to provide the best possible solution from our end. Kindy refer to the code snippet below: class _MyHomePageState extends State { late List> data; @override void initState() { data = >[ [ ChartData(x: '1', y: 40), ChartData(x: '2', y: 30), ChartData(x: '3', y: 100), ], [ ChartData(x: '1', y: 10), ChartData(x: '2', y: 70), ChartData(x: '3', y: 20), ], ]; super.initState(); } @override Widget build(BuildContext context) { final List seriesList = []; for (final dataList in data) { final List chartDataList = _convertToChartData(dataList); final LineSeries series = LineSeries( dataSource: chartDataList, xValueMapper: (ChartData data, _) => data.x, yValueMapper: (ChartData data, _) => data.y, ); seriesList.add(series); } return Scaffold( appBar: AppBar( title: const Text('Chart Data'), ), body: Padding( padding: const EdgeInsets.all(8.0), child: SfCartesianChart( series: seriesList, primaryXAxis: CategoryAxis( majorGridLines: const MajorGridLines(width: 0), ), primaryYAxis: NumericAxis( majorGridLines: const MajorGridLines(width: 0), ), ), ), ); } List _convertToChartData(List dataList) { final List chartDataList = []; for (final item in dataList) { final String xValue = item.x; final double yValue = item.y; final ChartData chartData = ChartData(x: xValue, y: yValue); chartDataList.add(chartData); } return chartDataList; } }
Thank you for the good video. I'm drawing a graph of the data. I want to make it possible to look up the graph every hour, 6 hours, 12 hours, 24 hours. The value changes when printing, but the graph UI does not change. Can I ask for your help on this?
Hi, We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots. www.syncfusion.com/support/directtrac/incidents/newincident We will check on this with our team and post a response but it will take a little time. Thanks for your question!
We suspect that you want to update the chart with real-time data for this. Please refer to this KB and demo sample to achieve your requirement. KB: www.syncfusion.com/kb/12316 Sample: flutter.syncfusion.com/#/cartesian-charts/real-time-charts/live-updates/real-time-line-chart
Hi Unwanted Child, We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots. www.syncfusion.com/support/directtrac/incidents/newincident We will check on this with our team and post a response but it will take a little time. Thanks for your question!
Hi, We have created a sample based on the instructions in the RUclips video and have not been able to reproduce the issue on our end. Please provide more information on which scenario the exception gets thrown and what properties are enabled in the chart that will be more helpful to us assist you in a better way.
Hi Ferry Farhanudin, We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots. www.syncfusion.com/support/directtrac/incidents/newincident We will check on this with our team and post a response but it will take a little time. Thanks for your question!
Since we are not clear with the requirement, kindly share the below details to provide you with the solution earlier. 1. Are you expecting the data labels to be positioned on the exact value as in the below image? 2. Share some screenshots for the current behavior and expected behavior. Please find a sample for your reference below for positioning and alignment for the data label. flutter.syncfusion.com/#/cartesian-charts/series-features/data-label/default-data-labels
Hello Víctor Sánchez, Yes, you need to purchase the license to use it in your application. Our paid and free versions both have the same features and support. You can check here to see if you qualify for our Community (free) license. It's available for companies with 5 or fewer developers and less than $1 Mil USD in annual revenue. bit.ly/395t17c
I encounter this error "Expected a value of type 'num?', but got one of type 'String'" while my x axis is string and my y axis is double, can you help me, thanks
Hello, We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident If you have a retail or flat license, you also have access to our support chat.
Please use the primaryXAxis as CategoryAxis if the x-axis values are string so that the exception will not occur. UG: help.syncfusion.com/flutter/cartesian-charts/axis-types#category-axis
hi , i am using StackedLineSeries to generate line chart , it is great , i want to ask how can i make the graph at initial render always scroll to the latest value ( max right ) , i am using visibleMaximum : 6 for primaryXAxis , now it always shows the oldest (max left) value, please help me, thank you very much.
Hi Long Nguyen Duc, We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots. www.syncfusion.com/support/directtrac/incidents/newincident We will check on this with our team and post a response but it will take a little time. Thanks for your question!
Please use the autoScrollingDelta and autoScrollingMode properties to show the last 6 data points in the chart. While setting the autoScrollingDelta value to 6, it always shows the last 6 values in the chart, eventhough if the chart gets updated. The autoScrollingMode used to set where you show that 6 data from starting or at the end. Kindly refer to the code snippet below to achieve your requirement. Code snippet: primaryXAxis: DateTimeAxis( autoScrollingDelta: 5, autoScrollingMode: AutoScrollingMode.start, )
Hello Sat, We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
Please use the latest version of the charts and make sure that you are not using the vector_math in your YAML file, since this package is used in our charts and so the version you are using may mismatch arise this issue.
Hi SAGE AT, We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots. www.syncfusion.com/support/directtrac/incidents/newincident We will check on this with our team and post a response but it will take a little time. Thanks for your question!
You can customize the axis labels of the chart using the labelFormat (pub.dev/documentation/syncfusion_flutter_charts/latest/charts/NumericAxis/labelFormat.html) property available in the chart axis. Code Snippet : SfCartesianChart( primaryYAxis: NumericAxis( // '%' will be append to all the labels in Y axis labelFormat: '{value}%' ) ) Please refer to this documentation for the labelFormat property. help.syncfusion.com/flutter/cartesian-charts/axis-customization#formatting-axis-label-content
Hi! Could you tell me please if it is possible with your library to create a line chart from a signal ? I mean, I get a stream of data and then the values will be showed in the chart every 200ms.
Hi Romulo, Thank you for watching our video and reaching out to us. Yes, it is similar to real-time data to chart. Here is a sample for you to depict this, flutter.syncfusion.com/#/cartesian-charts/real-time-charts/live-updates/real-time-spline-chart
Hi Hassan, Thank you for reaching out and watching our video. Please find the demo for this scenario - flutter.syncfusion.com/#/cartesian-charts/axis-types/date-time/default-date-time-axis Code link of the above demo - github.com/syncfusion/flutter-examples/blob/master/lib/samples/chart/cartesian_charts/axis_types/date_time/default_date_time_axis.dart#L116 Here, the dateTime values are assigned for xValueMapper to render DateTime axis.
Hello , I need help in something I need to display number of users in firebase per month using chart But I did not know how to count number of users in firebase can anyone help me with that
Hi Jack, Thank you for reaching out to us. Your requirement is not in our scope. You can check this with firebase forum. We only render the data sent to Chart from firebase.
Hello, We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident If you have a retail or flat license, you also have access to our support chat.
We would like to let you know that the 'initState' method will be called only once when the Stateful Widget is inserted into the widget tree. This method is typically used for some sort of initialization work that must be completed before the 'build'. Whereas the 'build' method will be called in many situations, such as state changes or parent rebuild cases, we must avoid initialization work in the build method. We kept the chart data static in the webinar video, so we preferred 'initState,' and we recommend that you initialize your chart data before the build to get the best performance.
Hello Matteo, Thank you for reaching out. Simply, you can bind the data source to the chart. By default, all the data in the data source will be displayed in the chart.
Hi RMN, we can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
Hello RMN, You should be able to add a marker using the documentation page for our cartesian chart: help.syncfusion.com/flutter/cartesian-charts/marker-datalabel. Please let us know if you have further questions. If you've tried this and it didn't work, you can also open a support ticket for a faster response.
I have weird repetition on my line chart's y-axis. If I dont give desiredIntervals or if the values are less than desired intervals the y-axis plots the values twice, like for example in case if y-axis values are 0, 0, 2, 0, 0, 2. Then it should just put the interval 2 but instead it displays, 0, 1, 1, 2, 2 on y-axis
Hi,
We have shared a sample browser and UG link below for your reference. You can refer to these links to achieve your requirements.
UG link : help.syncfusion.com/flutter/cartesian-charts/axis-types#customizing-interval
Sample browser link : flutter.syncfusion.com/#/cartesian-charts/axis-features/interval-type
Thank you very much.. Very helpful!
Hi Ahmad,
We are glad that you have found it helpful.
Nice Video Thanks
Is possible to show more than one line in the same chart?
Hello,
Thank you for reaching out.
In SfCartesianChart, we can render multiple series by adding the required series in the series collection property. Here, we have added a three-line series with different data points inside the series collection property.
Kindly review the code snippet below:
SfCartesianChart(
primaryXAxis: NumericAxis(),
primaryYAxis: NumericAxis(),
series: >[
LineSeries(
dataSource: firstLine,
xValueMapper: (ChartSampleData sales, int index) => sales.x,
yValueMapper: (ChartSampleData sales, int index) => sales.y,
color: Colors.blue,
),
LineSeries(
dataSource: secondLine,
xValueMapper: (ChartSampleData sales, int index) => sales.x,
yValueMapper: (ChartSampleData sales, int index) => sales.y,
color: Colors.red,
),
LineSeries(
dataSource: thirdLine,
xValueMapper: (ChartSampleData sales, int index) => sales.x,
yValueMapper: (ChartSampleData sales, int index) => sales.y,
color: Colors.green,
),
],
),
Hello,
We have analyzed your query and implemented the simple sample with the provided code snippet. As the data list is missing in the provided code snippet, assigned the data list with the dummy data points with three points each, and checked with your exact code. Two-line series with three data points, each is rendered properly with the attached sample below, and it is working fine from our end.
If you face the issue further, we recommend you share the sample with data points in a runnable state, and it will be helpful to provide the best possible solution from our end.
Kindy refer to the code snippet below:
class _MyHomePageState extends State {
late List> data;
@override
void initState() {
data = >[
[
ChartData(x: '1', y: 40),
ChartData(x: '2', y: 30),
ChartData(x: '3', y: 100),
],
[
ChartData(x: '1', y: 10),
ChartData(x: '2', y: 70),
ChartData(x: '3', y: 20),
],
];
super.initState();
}
@override
Widget build(BuildContext context) {
final List seriesList = [];
for (final dataList in data) {
final List chartDataList = _convertToChartData(dataList);
final LineSeries series = LineSeries(
dataSource: chartDataList,
xValueMapper: (ChartData data, _) => data.x,
yValueMapper: (ChartData data, _) => data.y,
);
seriesList.add(series);
}
return Scaffold(
appBar: AppBar(
title: const Text('Chart Data'),
),
body: Padding(
padding: const EdgeInsets.all(8.0),
child: SfCartesianChart(
series: seriesList,
primaryXAxis: CategoryAxis(
majorGridLines: const MajorGridLines(width: 0),
),
primaryYAxis: NumericAxis(
majorGridLines: const MajorGridLines(width: 0),
),
),
),
);
}
List _convertToChartData(List dataList) {
final List chartDataList = [];
for (final item in dataList) {
final String xValue = item.x;
final double yValue = item.y;
final ChartData chartData = ChartData(x: xValue, y: yValue);
chartDataList.add(chartData);
}
return chartDataList;
}
}
I got it.
Thank you so much!!!
Hi,
We are glad that you have found it helpful.
Thank you for the good video. I'm drawing a graph of the data. I want to make it possible to look up the graph every hour, 6 hours, 12 hours, 24 hours. The value changes when printing, but the graph UI does not change. Can I ask for your help on this?
Hi,
We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots.
www.syncfusion.com/support/directtrac/incidents/newincident
We will check on this with our team and post a response but it will take a little time.
Thanks for your question!
We suspect that you want to update the chart with real-time data for this. Please refer to this KB and demo sample to achieve your requirement.
KB: www.syncfusion.com/kb/12316
Sample: flutter.syncfusion.com/#/cartesian-charts/real-time-charts/live-updates/real-time-line-chart
Hello! error: The argument type 'Null' can't be assigned to the parameter type 'Key' keep on showing on me
Hi Unwanted Child,
We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots.
www.syncfusion.com/support/directtrac/incidents/newincident
We will check on this with our team and post a response but it will take a little time.
Thanks for your question!
Hi,
We have created a sample based on the instructions in the RUclips video and have not been able to reproduce the issue on our end. Please provide more information on which scenario the exception gets thrown and what properties are enabled in the chart that will be more helpful to us assist you in a better way.
how to make two lines chart with neat data label settings?
I have made it but the data label settings are irregular
Thank you
Hi Ferry Farhanudin,
We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots.
www.syncfusion.com/support/directtrac/incidents/newincident
We will check on this with our team and post a response but it will take a little time.
Thanks for your question!
Since we are not clear with the requirement, kindly share the below details to provide you with the solution earlier.
1. Are you expecting the data labels to be positioned on the exact value as in the below image?
2. Share some screenshots for the current behavior and expected behavior.
Please find a sample for your reference below for positioning and alignment for the data label.
flutter.syncfusion.com/#/cartesian-charts/series-features/data-label/default-data-labels
does it cost anything if i use it in my app?
Hello Víctor Sánchez,
Yes, you need to purchase the license to use it in your application. Our paid and free versions both have the same features and support. You can check here to see if you qualify for our Community (free) license. It's available for companies with 5 or fewer developers and less than $1 Mil USD in annual revenue.
bit.ly/395t17c
I encounter this error "Expected a value of type 'num?', but got one of type 'String'" while my x axis is string and my y axis is double, can you help me, thanks
Hello,
We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
If you have a retail or flat license, you also have access to our support chat.
Please use the primaryXAxis as CategoryAxis if the x-axis values are string so that the exception will not occur.
UG: help.syncfusion.com/flutter/cartesian-charts/axis-types#category-axis
hi , i am using StackedLineSeries to generate line chart , it is great , i want to ask how can i make the graph at initial render always scroll to the latest value ( max right ) , i am using visibleMaximum : 6 for primaryXAxis , now it always shows the oldest (max left) value, please help me, thank you very much.
Hi Long Nguyen Duc,
We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots.
www.syncfusion.com/support/directtrac/incidents/newincident
We will check on this with our team and post a response but it will take a little time.
Thanks for your question!
Please use the autoScrollingDelta and autoScrollingMode properties to show the last 6 data points in the chart. While setting the autoScrollingDelta value to 6, it always shows the last 6 values in the chart, eventhough if the chart gets updated.
The autoScrollingMode used to set where you show that 6 data from starting or at the end. Kindly refer to the code snippet below to achieve your requirement.
Code snippet:
primaryXAxis: DateTimeAxis(
autoScrollingDelta: 5,
autoScrollingMode: AutoScrollingMode.start,
)
Hi, I amgetting following error
Because no versions of syncfusion_flutter_charts match >18.4.49
Hello Sat,
We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
Please use the latest version of the charts and make sure that you are not using the vector_math in your YAML file, since this package is used in our charts and so the version you are using may mismatch arise this issue.
instead of mentioning version number, use 'any' to get compatible plugin version.
How can we display percentage instead of dollar?
Hi SAGE AT,
We're happy to look at this. For the fastest response to technical questions, we recommend opening a support ticket so we can exchange files and screenshots.
www.syncfusion.com/support/directtrac/incidents/newincident
We will check on this with our team and post a response but it will take a little time.
Thanks for your question!
You can customize the axis labels of the chart using the labelFormat (pub.dev/documentation/syncfusion_flutter_charts/latest/charts/NumericAxis/labelFormat.html) property available in the chart axis.
Code Snippet :
SfCartesianChart(
primaryYAxis: NumericAxis(
// '%' will be append to all the labels in Y axis
labelFormat: '{value}%'
)
)
Please refer to this documentation for the labelFormat property.
help.syncfusion.com/flutter/cartesian-charts/axis-customization#formatting-axis-label-content
Hi! Could you tell me please if it is possible with your library to create a line chart from a signal ? I mean, I get a stream of data and then the values will be showed in the chart every 200ms.
Hi Romulo,
Thank you for watching our video and reaching out to us. Yes, it is similar to real-time data to chart. Here is a sample for you to depict this,
flutter.syncfusion.com/#/cartesian-charts/real-time-charts/live-updates/real-time-spline-chart
how to make xValueMapper a DateTime data type not a double?
Hi Hassan,
Thank you for reaching out and watching our video. Please find the demo for this scenario - flutter.syncfusion.com/#/cartesian-charts/axis-types/date-time/default-date-time-axis
Code link of the above demo - github.com/syncfusion/flutter-examples/blob/master/lib/samples/chart/cartesian_charts/axis_types/date_time/default_date_time_axis.dart#L116
Here, the dateTime values are assigned for xValueMapper to render DateTime axis.
@@SyncfusionInc thanks
Hi Hassan,
We are glad it was helpful.
Hello , I need help in something I need to display number of users in firebase per month using chart But I did not know how to count number of users in firebase can anyone help me with that
Hi Jack,
Thank you for reaching out to us. Your requirement is not in our scope. You can check this with firebase forum. We only render the data sent to Chart from firebase.
Why we InitState to initialize chartData
Why we use*
Hello,
We can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
If you have a retail or flat license, you also have access to our support chat.
We would like to let you know that the 'initState' method will be called only once when the Stateful Widget is inserted into the widget tree. This method is typically used for some sort of initialization work that must be completed before the 'build'. Whereas the 'build' method will be called in many situations, such as state changes or parent rebuild cases, we must avoid initialization work in the build method.
We kept the chart data static in the webinar video, so we preferred 'initState,' and we recommend that you initialize your chart data before the build to get the best performance.
@@SyncfusionInc Thank you
how to show every value on the chart?
Hello Matteo,
Thank you for reaching out. Simply, you can bind the data source to the chart. By default, all the data in the data source will be displayed in the chart.
How to add icon in x axis in graph
Hi RMN, we can look into this and get back to you but response times via our RUclips videos are slower than our regular support. Have you opened a support ticket or tried our live chat? www.syncfusion.com/support/directtrac/incidents/newincident
Hello RMN,
You should be able to add a marker using the documentation page for our cartesian chart: help.syncfusion.com/flutter/cartesian-charts/marker-datalabel.
Please let us know if you have further questions. If you've tried this and it didn't work, you can also open a support ticket for a faster response.