Jump to content
Software FX Community

Re: Minus values for BAR gallery.


User (Legacy)

Recommended Posts

Mesut,

I used the following code:

(Ms Access)

Steve

Private Sub Form_Load()

Dim objChart As ChartfxLib.ChartFX

Dim i As Integer

Dim j As Integer

Dim yMax As Double

Dim yMin As Double

Set objChart = Me.ChartFX1.Object

'load sample data

objChart.OpenDataEx COD_VALUES, 1, 2

For i = 0 To 1 'series

For j = 0 To 1 'points

objChart.ValueEx(i, j) = -1 * Rnd * 100

'testing for Max and Min values allows for positive values

'should they exist, in *real* code I'd find the max and min

'from the recordset

If objChart.ValueEx(i, j) < yMin Then

yMin = objChart.ValueEx(i, j) 'testing for minimum value

End If

If objChart.ValueEx(i, j) > yMax Then

yMax = objChart.ValueEx(i, j) 'testing for minimum value

End If

Next j

Next i

objChart.CloseData COD_VALUES

objChart.Axis(AXIS_Y).Max = yMax

objChart.Axis(AXIS_Y).Min = yMin

objChart.Gallery = BAR

objChart.Export CHART_BITMAP, "c:\temp\bar.bmp"

Set objChart = Nothing

End Sub

Mesut Tekin <mtekin@innova-turk.com> wrote in message news:uvAWZV3sAHA.1808@sfxserver.softwarefx.com...

> Hi!

> I want draw two values with BAR gallery which are smaller than zero.

> But the output is not start from 0.

>

> For example, I have -12 and -24 values. It start -24 and go up.

> What I want is, it should start y=0 and go down.

>

> Many Thanks,

>

> Mesut Tekin

> INNOVA IT Solutions

> Tel: (90) 212 2163636

> Fax: (90) 212 2166611

> www.innova.com.tr

>

>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...