login.php profile.php?mode=register faq.php memberlist.php search.php index.php

Index du Forum » Communauté So'Graph » Ressource graphiques » Building a scalable graph...need pseudocode or suggestions
Poster un nouveau sujet  Répondre au sujet Sujet précédent :: Sujet suivant 
Building a scalable graph...need pseudocode or suggestions
MessagePosté le: Ven 22 Déc - 07:03 (2017) Répondre en citant
JoeClark
Langue pendue
Langue pendue

Hors ligne
Inscrit le: 09 Oct 2017
Messages: 205
Masculin




Hi,


In WPF, I am thinking how to best build a graph that's dynamically scalable (so graph resizes when the window is resized).  I've read through a chapter on drawings and visuals, and here's my thought:


In a Grid layout, have one cell contain a Canvas.  Get the ActualWidth and ActualHeight of the Canvas cell.  Divide by the number of points in a collection that you intend to draw.  The collection of points are such that you can .Add to a List of Visuals.  Draw a small circle or square at each point by a custom method (ex: dc.DrawRectangle(..))


Then, have an Event Handler in your Canvas cell of the type SizeChanged, so that everytime the window is resized (and the Canvas is thus resized), you get the new ActualWidth and ActualHeight of the Canvas cell and redo the above.


This is my proposed pseudocode, but I'm wondering if there's a better way.  


Is there some shortcut that I can use for drawing graphs, perhaps such as a ViewBox or something that will automate the above?


Is there a less computationally expensive way of calculating the resized width and height?


If there are many points (and I anticipate 1000+ points), should I just forget about resizing and recalculating points but just go to a fixed layout?  I am running this on a Vista machine with a recent generation Core2 Duo chip.  Resizing is not a big deal, just a neat feature, but if it is computationally expensive I can ditch it.  The real value of the program is in the actual graph.


Please help.


Thanks!


I didn't find the right solution from the Internet.


References:
https://social.msdn.microsoft.com/Forums/en-US/ebc88179-435d-4939-92c4-2c53…


 Medical Animation Examples








Publicité
MessagePosté le: Ven 22 Déc - 07:03 (2017)
Publicité




PublicitéSupprimer les publicités ?
Building a scalable graph...need pseudocode or suggestions
Index du Forum » Ressource graphiques
Toutes les heures sont au format GMT + 2 Heures  
Page 1 sur 1  

  
  
 Poster un nouveau sujet  Répondre au sujet  

Index | forum gratuit | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
Powered by phpBB © 2001-2004 phpBB Group
Designed for Trushkin.net | Themes Database
Traduction par : phpBB-fr.com