Speedometer Dashboard

Mick99

New member
Local time
Today, 13:56
Joined
Feb 19, 2016
Messages
14
Hi All,

I am wanting to add a dashboard form with multiple speedometers to display progress and project health. Is there an example that someone could share with me.

Cheers Mick
 

Attachments

  • screenshot.jpg
    screenshot.jpg
    18.8 KB · Views: 149
I think this would be rather easy to do. Take the background image without the line and overlay a line. Then move the line based on the value. I have not done it, but done something a little more advanced and that is an analog clock. This is overkill, but you can see some of the basic techniques.

However, the easiest way would be to make like 10 or 20 images (0%, 10%,....100% or by 5%). Then you can display the correct images in an image control based on the value. This would be easier than coding the line.
 

Attachments

Last edited:
It's a common question; most examples seem to be designed for Excel but if it involves code, it should work in either I'd guess.
I imagine they alter the height, width and left properties of a line using some sort of trigonometric function/calculation but I've never looked into it - or I've forgotten if I have.
 
Doing it with an arc is tricky but you can do rectangles pretty easily. I used horizontal ones where you fix the TOP and LEFT properties, fix the HEIGHT property to something relatively small, and then vary the WIDTH property.
 
As I previously said. All the code is the same as the clock.
1) I added a subform with your image and a line.
2) I made the subform instantiate the RotatingDial Class
3) Now the user needs to drop the subform wherever they want and set the percent complete.

Here is the entire code to make this work
Private Sub Form_Current()
Me.sub1.Form.SetPercent Me.Task1
Me.sub2.Form.SetPercent Me.Task2
Me.sub3.Form.SetPercent Me.Task3
End Sub

The only trick here was to convert percent to an angle since the code was originally meant for a 360 deg dial. So 0% is 270 degrees, 50% is 0, and 100% is 90.

If you notice 25% is slightly off. This is because I did not get the starting point of the line directly in the center of the dial in design view. You can play with it to try to get it more centered. 75% lines up better.

speed2.jpg


Speed.jpg
 

Attachments

Last edited:
For fun adding a moving version to show how to make it move.
 
I still think the better option is to use a set of images and store them in the database. I think you could make it look nicer and would give you more options for use. This could actually allow you to have progress bars in a continuous form.
 
HI MajP, thank you very much, I so appreciated your work on this. You have all been a great help many thanks.

Cheers Mick
 
In design view if you click on the line then use the left arrow key to move it one time, it will line up. Good luck, and post back with final approach that you use.
Speedometer4.jpg
 

Attachments

Users who are viewing this thread

Back
Top Bottom