Jump to content
Software FX Community

Re: Minus values for BAR gallery.

User (Legacy)

Recommended Posts


I used the following code:

(Ms Access)


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...