Tag Archives: graph

Graph points in WPF and C#

This example extends the previous example Draw a graph in WPF and C# to draw ellipses marking the data sets’ points. See that example for an explanation of how most of the program works. The following code shows how the … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Animate a point on a polar coordinate curve in C#

The example Graph a curve in polar coordinates in C# explained how to draw the flower-like curve on the right. Once you know how to draw such a curve, it’s not too hard to animate points moving along it. The … Continue reading

Posted in algorithms, animation, graphics, mathematics | Tagged , , , , , , , , , , , , , , , | Leave a comment

Graph a curve in polar coordinates in C#

In Cartesian coordinates, a point is specified by X and Y values. In polar coordinates, a point is specified by r and θ where: r is the point’s radial distance from the origin θ is the angle that gives the … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , , , , | 1 Comment

Test investment strategies with Dow Jones data in C#

Important Note: I am not a tax or investment professional so you need use your own judgement when evaluating these investment strategies. I don’t even pretend to understand this stuff. This is a very simple tool for playing with numbers … Continue reading

Posted in algorithms, finance, graphics, mathematics | Tagged , , , , , , , , , , , , , , | Leave a comment

Graph historical Dow Jones Industrial Average values in C#

This program graphs historical prices for the Dow Jones Industrial Average. I got the data from this URL: ichart.finance.yahoo.com/table.csv?s=^DJI&a=0&b=1&c=1990&d=0&e=1&f=2020&g=d&ignore=.csv The fields in the URL are: s=^DJI – Get Down Jones Industrial data a=0 – The start month number is 0 … Continue reading

Posted in finance, graphics, mathematics | Tagged , , , , , , , , , , , , , , | 3 Comments

Graph historical stock prices in C#

The key to this example is the GetStockPrices method shown in the following code. // Get the prices for this symbol. private List GetStockPrices(string symbol) { // Compose the URL. string url = “http://www.google.com/finance/” + “historical?output=csv&q=” + symbol; // Get … Continue reading

Posted in finance, graphics, mathematics | Tagged , , , , , , , , , , , , , , | Leave a comment

Graph mosquito populations in C#

The example Simulate mosquito populations in C# simulates a mosquito population. This example draws a graph showing the population during each generation. When it calculates the populations for a new generation, it stores them in the following lists. // Data … Continue reading

Posted in algorithms, animation, drawing, graphics, mathematics | Tagged , , , , , , , , , , , , , , , | Leave a comment

Continuously graph stock prices in C#

The example Get stock prices from the internet in C# explains how to get stock prices from the Yahoo! finance web site. This example uses similar techniques to query the site periodically and then graph stock prices. This example is … Continue reading

Posted in algorithms, finance, graphics, internet, mathematics, multimedia, web | Tagged , , , , , , , , , , , , , , | Leave a comment

Graph the sine, cosine, and tangent functions in C#

This example is mostly an exercise in drawing but it does demonstrate a few useful graphics techniques. When you enter minimum and maximum X and Y values and click the Graph button, the following code graphs the sine, cosine, and … Continue reading

Posted in algorithms, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , | 2 Comments

Draw a labeled line graph that displays value tooltips in C#

This (fairly complicated) example maps between several different coordinate systems: The main graph is mapped from a coordinate space where 1900 ≤ x ≤ 2010 and 0 ≤ y ≤ 8000 to an area on the screen. Each data point … Continue reading

Posted in drawing, graphics, mathematics, transformations | Tagged , , , , , , , , , , , , , | 1 Comment