Home Forums WinForms controls Xceed Chart for WinForms Embedding chart in grid cell – bad idea?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #18961 |

    I’m wanting to create a line chart in a cell of a grid control.  I’m debating between a few options:

    • Embed a chart control showing a 2D line into a cell in the grid
    • Custom draw a cell in the grid and paint my own line
    • Build the grid on the fly using .NET’s flow layout panel with embedded table layout panels then custom draw the line chart

    Mainly I wanted someone’s advice on the first option.  I’m wondering if it would be horribly abusive to the memory.  I shouldn’t ever have more than 22 rows of data and it will rarely be less than about 19 rows.  Would it be a bad idea to embed 22 chart controls on the same form and update them all on the fly?  Is it designed to be able to handle that scenario?  I don’t want to put in all the work to do it and then find out it’s totally unworkable for some reason.

    Also, has anyone out there created a custom line chart for use as a grid cell?  The search features on this forum appear to be broken so I wasn’t able to find out if it’s been discussed before.

    Ultimately what I’m wanting is a grid cell with a progress bar overlayed with a line chart showing the history of that cell value.  That way the current value will be highly visible but the user can see how it’s changed over time too.  I’m sure I can custom draw a control that will do this but I thought it would be faster if I could use some of the Xceed controls I already have a license for.

    I’m going to cross post the grid specific part of this in the grid forum.  I wasn’t quite sure where to put this since it deals with both controls.

    Thanks for any advice you have.

    Imported from legacy forums. Posted by Steve (had 2622 views)

    User (Old forums)
    Member
    Post count: 23064

    22 charts on the same form, if data is constantly refreshed, can be hard on an application resources.

    If you do not need the user to interact with the chart (i.e. have the cell editor pop up constantly to edit the chart), you could use a CellViewerManager which contains a PictureBox (along other controls you want), and only one instance of the ChartControl.  In the SetControlValueCore of the CellViewerManager, you could clear the LineSeries used by the ChartControl at that time, and use the data associated to this cell to redraw the chart.  Then do an ImageExport into a bitmap, and use the PictureBox of the CellViewerManager to display that bitmap.

    However, it is clear that if performance is important, you would be better off using a UserControl that does it simply, with DrawLines and stuff.

     

    Imported from legacy forums. Posted by André (had 337 views)

    User (Old forums)
    Member
    Post count: 23064

    By the way, the search function seems to works fine on our side.

    Imported from legacy forums. Posted by André (had 1819 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.