Skip to content

Add Heat Map #46

Closed
Closed

Description

@deadsoul44

Add heat map like in the following picture:

image

Activity

  1. NeelakandanKannan commented on Nov 6, 2020

    @NeelakandanKannan

    Hi @deadsoul44 ,

    Thanks for your feedback.

    Our DataGrid widget supports the conditional styling. You can achieve your requirement to highlight the cells based on the condition using onQueryCellStyle callback. Please refer the below below code snippet,

    import 'package:syncfusion_flutter_datagrid/datagrid.dart';
    import 'package:syncfusion_flutter_core/theme.dart';
    
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: SfDataGrid(
            source: _employeeDataSource,
            columns: <GridColumn>[
              GridNumericColumn(mappingName: 'id')..headerText = 'Order ID',
              GridTextColumn(mappingName: 'name')..headerText = 'Name',
              GridTextColumn(mappingName: 'designation')
                ..headerText = 'Designation',
              GridNumericColumn(mappingName: 'salary')..headerText = 'Salary'
            ],
            onQueryCellStyle: (QueryCellStyleArgs args) {
              if (args.column.mappingName == 'designation') {
                if (args.cellValue == 'Developer') {
                  return DataGridCellStyle(
                      textStyle: TextStyle(fontStyle: FontStyle.italic),
                      backgroundColor: Colors.tealAccent);
                } else if (args.cellValue == 'Manager') {
                  return DataGridCellStyle(
                      textStyle: TextStyle(fontStyle: FontStyle.italic),
                      backgroundColor: Colors.blue[200]);
                }
              }
              return null;
            }),
      );
    }

    UG Link
    https://help.syncfusion.com/flutter/datagrid/conditional-styling#styling-based-on-content

    You can refer the below example also,
    https://github.com/syncfusion/flutter-examples/tree/master/lib/samples/datagrid/apperance/conditional_styling

    Please let us know if your requirement differs from our solution.

  2. deadsoul44 commented on Nov 6, 2020

    @deadsoul44
    Author

    Thank you for the details. But, this approach paints individual cells without being aware of the adjacent cells. I thought more advanced and more smooth contour plots and heat maps with optional data annotations with various types can be painted like in the following example:

    image

  3. SriramKiranSenthilkumar commented on Nov 6, 2020

    @SriramKiranSenthilkumar
    Contributor

    Hi @deadsoul44,

    We have analyzed your query and we have considered your suggestion as a feature request regarding implementing a new heat map chart widget. We have also logged feedback for it in our feedback portal and this will be available in any of our upcoming releases yet to come.

    you can also track the status of the feature using the below feedback link and you can comment on the link if you have any suggestion or concern about the widget.
    https://www.syncfusion.com/feedback/19531

    Regards,
    Sriram Kiran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions