Jump to content
Software FX Community

Series problem


User (Legacy)

Recommended Posts

Posted

Hi,

I try to use ChatFx Client(trial version) for VB and I have problem wich the

series.

When I try load two series only one is loaded but I don't know why.

Show the pic's if you have any doubt.

Thank's in advance.

This is my code:

--------------------------------

Private m_ac As DDActiveCube ' Cube

Public Sub ShowChart(ac As DDActiveCube)

Dim iRow As Long, iCol As Long

If ac Is Nothing Then Exit Sub

Set m_ac = ac

If m_ac.SelectionGrid Is Nothing Then Exit Sub

cht.Axis(AXIS_Y).Max = 0 ' Ini for Dinamic

cht.Axis(AXIS_Y2).Max = 0

cht.OpenDataEx COD_VALUES, m_ac.SelectionGrid.ColumnCount, COD_UNKNOWN

cht.OpenDataEx COD_XVALUES, m_ac.SelectionGrid.ColumnCount,

m_ac.SelectionGrid.RowCount

For iCol = 0 To m_ac.SelectionGrid.ColumnCount - 1

For iRow = 0 To m_ac.SelectionGrid.RowCount - 1

If m_ac.SelectionGrid.cell(iRow, iCol).Selected Then

AddCellPoint m_ac.SelectionGrid.cell(iRow, iCol), iRow, iCol

' Draw Function

End If

Next

Next

cht.SerLegBox = True

cht.CloseData COD_VALUES

cht.CloseData COD_XVALUES

cht.Refresh

Me.Show

End Sub

Private Sub AddCellPoint(cell As ACCell, iRow, iCol)

Dim mbr As ACMember

Dim iLevel As Integer

Dim sRowCaption As String, sColCaption As String

For iLevel = 0 To m_ac.RowAxis.VisibleDepth - 1

Set mbr = cell.RowAxisVector.MemberValue(iLevel)

If Not mbr Is Nothing Then

sRowCaption = sRowCaption & IIf(iLevel > 0, ", ", "") &

mbr.Caption

End If

Next

For iLevel = 0 To m_ac.ColumnAxis.VisibleDepth - 1

Set mbr = cell.ColumnAxisVector.MemberValue(iLevel)

If Not mbr Is Nothing Then

sColCaption = sColCaption & IIf(iLevel > 0, ", ", "") &

mbr.Caption

End If

Next

If sColCaption <> "Porcentaje" Then

cht.Axis(AXIS_Y).Format = AF_NUMBER

cht.Axis(AXIS_Y).Decimals = 0

If (cht.Axis(AXIS_Y).Max < cell.Value) Then

cht.Axis(AXIS_Y).Max = cell.Value

End If

Else

If iCol = 0 Then

cht.Axis(AXIS_Y).Format = AF_PERCENTAGE

cht.Axis(AXIS_Y).Decimals = 2

If (cht.Axis(AXIS_Y).Max < cell.Value) Then

cht.Axis(AXIS_Y).Max = cell.Value

End If

Else

If (cht.Axis(AXIS_Y2).Max < cell.Value) Then

cht.Axis(AXIS_Y2).Max = cell.Value

End If

End If

End If

cht.Axis(AXIS_Y2).Format = AF_PERCENTAGE

Debug.Print sRowCaption, sColCaption, cell.Value, iRow, iCol

cht.Legend(iRow) = sRowCaption

If sColCaption <> "Porcentaje" Then

cht.Series(iCol).Legend = "Matriculaciones"

cht.ValueEx(iCol, iRow) = IIf(IsNull(cell.Value), 0, cell.Value)

Else

cht.Series(iCol).Visible = True

cht.Series(iCol).Legend = "Porcentaje"

cht.Series(iCol).Yvalue(iRow) = IIf(IsNull(cell.Value), 0,

cell.Value)

End If

Debug.Print "Serie: " & iCol

End Sub

Private Sub Form_Load()

' Chart Type Settings

cht.Gallery = BAR

cht.Chart3D = False

cht.Stacked = CHART_NOSTACKED

' Color Settings

cht.Border = False

' Layout Settings

cht.LegendBox = False

cht.SerLegBox = False

cht.ToolBar = False

cht.Title(CHART_TOPTIT) = ""

End Sub

Private Sub Form_Resize()

cht.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight

End Sub

Archived

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

×
×
  • Create New...