Jump to content
Software FX Community

How to mark NULL values?


User (Legacy)

Recommended Posts

Hi,

I have a line chart with several series and a DateTime X-axis. There are

points with DBNull values (y).

In the conversation with Brook Hunter from 2005-12-20 I found:

"By default Null values are translated into "hidden" points, which means

that the space allotted for this point will be left blank, in a connected

chart type, such as line, this will generate a break in the line."

The broken line is fine for me. But I need to mark these "hidden" points in

some kind, for example by painting the X-axis in red at this point. I want

to show that there IS a point, but without y values.

Assuming that there are 5 "normal" points and after that 3 "hidden" points,

you could not see if there are 0,1, 2, 3 or more hidden points, especially

if there follow no further "normal" points.

So how can I access/ mark these hidden points?

Best regards, MusiMeli

Link to comment
Share on other sites

You can go through the data and ask for the value of each point using the 

data API, for example:

for (int i = 0; i < chart.Data.Series; i++) {

for (int j = 0; j < chart.Data.Points; j++) {

if (chart.Data[i,j].Y == Chart.Hidden)

DoSomething(i,j);

}

}

The big thing here is what DoSomething means, you need to get more specific

as the devil is in the details. For example you said something about marking

the label in the X-Axis, but in an X/Y chart, the labels and the data are

not necessarily aligned, for example your X-Axis may go:

10,20,40,50,....100

But you data my be:

5, 10,20,35,40

So in this case how do you want highlight a point at say 25 ?

Changing the color of sections of the X-Axis is possible by using Axis

Sections. Axis Sections also allow you to change to create a stripe of color

in the chart background for a certain range of values, this may be a good

option for cases in which there is no label for the hidden point. You can

also add extra labels and lines at specific locations using Custom

Gridlines. So, you need to decide how you want to indicate these cases.

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...