Jump to content
Software FX Community

hiding zero value point labels


User (Legacy)

Recommended Posts

Zero is not special for us, there is no difference between zero and say 102.

Maybe instead of zero you want to set this point to null (Chart.Hidden) ?

This is a special value and it will not display anything at all.

Also if is zero that you want to make special you can create a conditional

attribute that turns PointLabels off for all values equal to zero. The

following code will do just that:

ConditionalAttributes conditionalAttributes = new ConditionalAttributes();

conditionalAttributes.Condition.From = 0;

conditionalAttributes.Condition.To = 0;

conditionalAttributes.PointLabels.Visible = false;

chart1.ConditionalAttributes.Add(conditionalAttributes);

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Ah, sweet.  Thanks for the fast response on this one.  The conditional logic 

worked great.

Mark

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

news:G8OZeuV8GHA.1788@webserver3.softwarefx.com...

> Zero is not special for us, there is no difference between zero and say

> 102.

>

> Maybe instead of zero you want to set this point to null (Chart.Hidden) ?

> This is a special value and it will not display anything at all.

>

> Also if is zero that you want to make special you can create a conditional

> attribute that turns PointLabels off for all values equal to zero. The

> following code will do just that:

>

> ConditionalAttributes conditionalAttributes = new ConditionalAttributes();

>

> conditionalAttributes.Condition.From = 0;

>

> conditionalAttributes.Condition.To = 0;

>

> conditionalAttributes.PointLabels.Visible = false;

>

> chart1.ConditionalAttributes.Add(conditionalAttributes);

>

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

Spoke too soon.  It correctly hides point labels with a value of zero using 

the conditional logic you supplied. If the user turns point labels off,

then on again, and the graph is rebuilt, the ConditionalAttribute seems to

be ignored and it shows zero point labels. I checked the

chart.ConditionalAttributes collection and it has the entry I placed there.

Ideas ?

Mark

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

news:G8OZeuV8GHA.1788@webserver3.softwarefx.com...

> Zero is not special for us, there is no difference between zero and say

> 102.

>

> Maybe instead of zero you want to set this point to null (Chart.Hidden) ?

> This is a special value and it will not display anything at all.

>

> Also if is zero that you want to make special you can create a conditional

> attribute that turns PointLabels off for all values equal to zero. The

> following code will do just that:

>

> ConditionalAttributes conditionalAttributes = new ConditionalAttributes();

>

> conditionalAttributes.Condition.From = 0;

>

> conditionalAttributes.Condition.To = 0;

>

> conditionalAttributes.PointLabels.Visible = false;

>

> chart1.ConditionalAttributes.Add(conditionalAttributes);

>

>

> --

> Francisco Padron

> www.chartfx.com

>

Link to comment
Share on other sites

  • 7 years later...

Archived

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

×
×
  • Create New...