Question

I want to create a bar chart application in windows based .net application, i want that on the runtime whenever user enter some value in textBox and click on the button the bar should actually grow or shrink according to the value given by the user, i tried the same everything is working except, i am not getting how to make the bar increase vertically bottom to top, as the height param of the FillRectangle always makes it increase from top to bottom i want reverse functionality..

Please anyone help me for this, as it is of utmost important. Thanks and Regards Abbas Electricwala

Was it helpful?

Solution

You have to position the bar at the point on the graph where giving it a height fills the rectangle so that it just touches the bottom of the graph.

For example, if the bottom of the graph is at 320 pixels and the bar needs to be a height of 40, you would create the rectangle so that it appears at 320 - 40, or 280, then give it a height of 40. That will make it appear at the right spot and be the correct height.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top