Excel gauge
Grafico gauge
[português]
Como criar um grafico no formato Gauge (velocimetro)?
vejamos como:
- primeiramente consiga uma imagem de fundo para o gauge.
- em segundo um ponteiro.
- então insira um circulo (desenho) sem linha nem cor de fundo.
- agrupe o ponteiro e o circulo de forma a que a base do ponteiro fique no meio do circulo.
- após isto podemos criar o grafico com uma macro tipo esta:
[English]
How to create a Gauge graphic speedometer?
let's see how:
- first get a background image for the gauge.
- second a pointer.
- then, insert a circle (drawing) without line or background color.
- Group pointer and the circle so that the base of the pointer is in the middle of the circle.
- after this we can create the graph with a macro like this:
Thanks and credits for: Michael D. Newby [www.recursivecreavitity.com]
Option ExplicitSub GoSpeedRacer() ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' ' ' Built by Josemar © www.jmdias.com ' ' ' ' Modified by Michael D. Newby ' ' www.recursivecreavitity.com ' ' ' ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim Rng As Integer Dim Speed As Integer Dim i As Integer i = 0 Rng = (Range("G24").Value / 100) * 160 Speed = Range("SpeedHold").Value With ActiveSheet.Shapes("Grupo 5") .Rotation = 0 Select Case Speed Case 90 To 100 For i = 1 To Rng + 5 .IncrementRotation 1 DoEvents Next i Case 80 To 89 For i = 1 To Rng + 5
ficando desta forma:
.IncrementRotation 1 DoEvents Next i Case 70 To 79 For i = 1 To Rng + 3 .IncrementRotation 1 DoEvents Next i Case 60 To 69 For i = 1 To Rng + 2 .IncrementRotation 1 DoEvents Next i Case 50 To 59 For i = 1 To Rng + 1 .IncrementRotation 1 DoEvents Next i Case 40 To 49 For i = 1 To Rng + 1 .IncrementRotation 1 DoEvents Next i Case Else For i = 1 To Rng .IncrementRotation 1 DoEvents Next i End Select End With Range("SpeedHold").Value = Speed Range("E7").Select End Sub
Mais tutos em breve...