Jump to content
Software FX Community

Problem Colouring A Chart


User (Legacy)

Recommended Posts

Hello!

I am having problems colouring the individual bars on my chart. The code is

below. For some reason, the chart just comes up black. Any ideas would be

greatly appreciated.

SeriesCount = 0

RecCount = 0

cfxChart1.OpenDataEX COD_VALUES,1,TotalRecs*48

cfxChart1.OpenDataex COD_colors,TotalRecs*48,0

do while Not rs.eof

For Count = 1 to 48

CurrKW="KW"+cstr(Count)

cfxChart1.Series(0).YValue(SeriesCount)=rs(CurrKW)

SeriesCount=SeriesCount + 1

Next

cfxChart1.Axis(Axis_X).Label(RecCount)=rs("HalfHourDate")

cfxChart1.Series(All).Color=RGB(255,0,0)

rs.MoveNext

RecCount=RecCount+1

loop

cfxChart1.Axis(axis_x).LabelValue = 48

cfxChart1.TypeMask =cfxChart1.TypeMask and CT_NOBORDERS

cfxChart1.TypeMask =cfxChart1.TypeMask and CT_eachbar

cfxChart1.markervolume =100

cfxChart1.Series(All).Border=True

cfxChart1.BorderStyle=11

cfxChart1.Gallery=2

cfxChart1.MarkerSize=4

cfxChart1.RightGap=30

cfxChart1.TopGap=30

cfxChart1.LeftGap=44

cfxChart1.TypeEx = cfxChart1.TypeEx Or CTE_smooth

cfxChart1.RealTimeStyle = CRT_NOWAITARROW

cfxChart1.TypeEx = cfxChart1.TypeEx or CTE_NOTITLESHADOW

cfxChart1.TypeMask = (cfxChart1.TypeMask Or CT_TRACKMOUSE)

cfxChart1.SerLegBox=True

cfxChart1.View3D=False

cfxChart1.View3DDepth=65

cfxChart1.WallWidth=8

cfxChart1.AxesStyle =1

cfxChart1.legstyle =cfxChart1.legstyle or cl_vertxleg

cfxChart1.Axis(axis_x).step = 48

cfxChart1.TypeMask =cfxChart1.TypeMask and not CT_NOBORDERS

cfxChart1.TypeMask =cfxChart1.TypeMask and not CT_eachbar

cfxChart1.markervolume =100

cfxChart1.AxesStyle =1

cfxChart1.legstyle =cfxChart1.legstyle or cl_vertxleg

cfxChart1.CloseData COD_VALUES

cfxChart1.CloseData COD_COLORS

Cheers

Paul

Link to comment
Share on other sites

The problem is:

cfxChart1.Series(All).Color = RGB(255,0,0)

You cannot use All (-1) here.

If you want all series to be the same color, you can do:

cfxChart1.OpenDataex COD_COLORS,1,0

cfxChart1.Series(0).Color = RGB(255,0,0)

cfxChart1.CloseData COD_COLORS

O if you want to change the color of an specific point later on, you need to

loop through all the points and assign the color to each one even if they

have the same color.

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...