Tower
Tower

Reputation: 102765

WPF and graph in the grid?

I would like to draw a linechart-like graph in a grid column in WPF (C#).

Something like this:

enter image description here

Obviously to make it look good I need to style the grid to not have cell borders, but that's not a problem. The problem is how would I even approach this? There's no column type that sounds good and since the graph is all connected it feels like painful to implement.

Upvotes: 0

Views: 586

Answers (1)

Tigran
Tigran

Reputation: 62248

Not very sure why you need Grid control, actually here. May be ListView would enough for you ? It's much more lightweight then Grid control.

To draw that stuff you could

  • make use of Adorners in order to draw something semitransparent over the items.

or

  • Define a style for the control (ListView or Grid) where on left side you have Canvas element which overlaps the items collection of the control.

or

  • can try to use very customizable TreeControl like from example from Josh Smith, but naturally with your changes.

Good luck.

Upvotes: 2

Related Questions