1 / 10

Plotchart

Plotchart. Arjen Markus June 2010. Design goals. Easy to use: just a few commands for a plot Wide range of plot and chart types Extendable Its predecessor: emu_graph by Steve Cassidy. Design decisions. Use the whole canvas Fix the layout Simple form of clipping

Télécharger la présentation

Plotchart

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Plotchart Arjen Markus June 2010

  2. Design goals • Easy to use: just a few commands for a plot • Wide range of plot and chart types • Extendable Its predecessor: emu_graph by Steve Cassidy

  3. Design decisions • Use the whole canvas • Fix the layout • Simple form of clipping • Do not manage the data (duplication) • Changing the appearance takes effect for new data only

  4. Interface • Create the plot of the chosen type – new command • Fill in the data via subcommands • Details differ per plot type

  5. Implementation Some code – linking method names to procedures: set methodProc(xyplot,title) DrawTitle set methodProc(xyplot,xtext) DrawXtext set methodProc(xyplot,plot) DrawData set methodProc(xyplot,dot) DrawDot set methodProc(xyplot,dotconfig) DotConfigure set methodProc(xyplot,interval) DrawInterval set methodProc(xyplot,trend) DrawTrendLine set methodProc(piechart,plot) DrawPie set methodProc(piechart,saveplot) SavePlot

  6. Implementation – part 2 proc ::Plotchart::createPiechart { w } { variable data_series foreach s [array names data_series "$w,*"] { unset data_series($s) } set newchart "piechart_$w" interp alias {} $newchart {} ::Plotchart::PlotHandler piechart $w CopyConfig piechart $w foreach {pxmin pymin pxmax pymax} [MarginsCircle $w] {break} viewPort $w $pxmin $pymin $pxmax $pymax $w create oval $pxmin $pymin $pxmax $pymax SetColours $w blue lightblue green yellow orange red magenta brown DefaultLegend $w DefaultBalloon $w return $newchart }

  7. Implementation – part 3 proc ::Plotchart::PlotHandler { type w command args } { variable methodProc if { [info exists methodProc($type,$command)] } { eval $methodProc($type,$command) $w $args } else { return -code error "No such method - $command“ } }

  8. Implementation: contributions Many people have contributed with code or suggestions: Mark Stucky, Stefan Finzel, Paul Vogel, Dave Hanks, Michael Baudin, Steve Blinkhorn, … Jos DeCoster has developed xyplot on top of Plotchart

  9. Currently supported types • XY-plots (also logarithmic axes) • Contour plots (2D and 3D) • Histograms and piecharts • Time charts and Gantt charts • Radial charts Also: • various types of annotation • Combining plots in one canvas

  10. Demos • A few examples of Plotchart itself • Jos DeCoster’s xyplot • Experimental: SCADA display

More Related