Jump to content
Software FX Community

chart shows 0 values !!


User (Legacy)

Recommended Posts

Hi !

Why is the chart showing 0 values ??? see attachment

Is there a way to avoid this?

code:

Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar

'Populating the Chart1 with random data to get 3 series

Dim r As System.Random

r = New System.Random()

Chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 3, 3)

Dim i As Integer

i = 0

Do While (i < 3)

Dim j As Integer

j = 0

Do While (j < 3)

Chart1.Value(i, j) = 0 '(r.NextDouble * 100)

j = (j + 1)

Loop

i = (i + 1)

Loop

Chart1.CloseData(SoftwareFX.ChartFX.COD.Values)

'It looks better with Borders

Chart1.Border = True

Chart1.BorderEffect = SoftwareFX.ChartFX.BorderEffect.Raised

Chart1.AxesStyle = SoftwareFX.ChartFX.AxesStyle.Math

Link to comment
Share on other sites

What would you like to see ? Since there is no Y-Axis scale set, and all the

values are 0 we can't calculate the Min and Max of the Y-Axis that's why you

see it empty.

Since there is no way to calculate the scale, you may want to set it to some

arbitrary values (for example 0 to 100) when Min and Max are the same. You

can do this very easily by adding the following code AFTER CloseData:

If (Chart1.Min = Chart1.Max) Then

Chart1.Max = 100

End If

--

FP

Software FX, Inc.

post-2107-1392237828511_thumb.jpg

Link to comment
Share on other sites

Hi !

When values are 0 (zero) I don't want to se anything.

If I have 3-series chart and there a 0 (zero) value in a serie, there's a

thin line shown in the chart. I want to avoid the thin lines then 0 (zero)

values....how ?

See attachments

CODE:

Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar

'Populating the Chart1 with random data to get 3 series

Dim r As System.Random

r = New System.Random()

Chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 3, 3)

Dim i As Integer

i = 0

Do While (i < 3)

Dim j As Integer

j = 0

Do While (j < 3)

If i = 2 Then

Chart1.Value(i, j) = 0

Else

Chart1.Value(i, j) = (r.NextDouble * 100)

End If

j = (j + 1)

Loop

i = (i + 1)

Loop

Chart1.CloseData(SoftwareFX.ChartFX.COD.Values)

'It looks better with Borders

Chart1.Border = True

Chart1.BorderEffect = SoftwareFX.ChartFX.BorderEffect.Raised

Chart1.AxesStyle = SoftwareFX.ChartFX.AxesStyle.Math

Chart1.RecalcScale()

END CODE

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:MTSMTnzCDHA.1356@webserver1.softwarefx.com...

> What would you like to see ? Since there is no Y-Axis scale set, and all

the

> values are 0 we can't calculate the Min and Max of the Y-Axis that's why

you

> see it empty.

>

> Since there is no way to calculate the scale, you may want to set it to

some

> arbitrary values (for example 0 to 100) when Min and Max are the same. You

> can do this very easily by adding the following code AFTER CloseData:

>

> If (Chart1.Min = Chart1.Max) Then

> Chart1.Max = 100

> End If

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Hi

Chart1.Value(i, j) = Chart1.Hidden

....will hide the 0 (zero) values.

/thanks

"OleM" <omm@lector.dk> wrote in message

news:RF8YZ2XDDHA.2772@webserver1.softwarefx.com...

> Hi !

>

> When values are 0 (zero) I don't want to se anything.

>

> If I have 3-series chart and there a 0 (zero) value in a serie, there's a

> thin line shown in the chart. I want to avoid the thin lines then 0 (zero)

> values....how ?

>

> See attachments

>

> CODE:

>

> Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar

>

> 'Populating the Chart1 with random data to get 3 series

>

> Dim r As System.Random

>

> r = New System.Random()

>

> Chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 3, 3)

>

> Dim i As Integer

>

> i = 0

>

> Do While (i < 3)

>

> Dim j As Integer

>

> j = 0

>

> Do While (j < 3)

>

> If i = 2 Then

>

> Chart1.Value(i, j) = 0

>

> Else

>

> Chart1.Value(i, j) = (r.NextDouble * 100)

>

> End If

>

> j = (j + 1)

>

> Loop

>

> i = (i + 1)

>

> Loop

>

> Chart1.CloseData(SoftwareFX.ChartFX.COD.Values)

>

>

>

>

> 'It looks better with Borders

>

> Chart1.Border = True

>

> Chart1.BorderEffect = SoftwareFX.ChartFX.BorderEffect.Raised

>

> Chart1.AxesStyle = SoftwareFX.ChartFX.AxesStyle.Math

>

> Chart1.RecalcScale()

>

> END CODE

>

>

> "SoftwareFX Support" <support@softwarefx.com> wrote in message

> news:MTSMTnzCDHA.1356@webserver1.softwarefx.com...

> > What would you like to see ? Since there is no Y-Axis scale set, and all

> the

> > values are 0 we can't calculate the Min and Max of the Y-Axis that's why

> you

> > see it empty.

> >

> > Since there is no way to calculate the scale, you may want to set it to

> some

> > arbitrary values (for example 0 to 100) when Min and Max are the same.

You

> > can do this very easily by adding the following code AFTER CloseData:

> >

> > If (Chart1.Min = Chart1.Max) Then

> > Chart1.Max = 100

> > End If

> >

> > --

> > FP

> > Software FX, Inc.

> >

> >

>

>

>

Attachments.zip

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...