Jump to content
Software FX Community

MarkerLabels


User (Legacy)

Recommended Posts

New here, evaluating the software. Is there any way to define a label specific to a given marker? Similar to the following doctered image?

(see markers 2-5 reference "My label 1 and My label 2")

I tried using PointLabelMask but it applies it to all items in the series I would like to apply unique labels for each marker if possible any ideas?

Thanks,

Scott

post-2107-13922379547283_thumb.gif

Link to comment
Share on other sites

Use PintLabelMask so that each point displays its "tag" followed by its value:

chart1.PointLabelMask = "%L\n%v";

Assign the Tag property only for those points that you want to display a label for:

chart1.Point[0].Tag = "My Label 1";

chart1.Point[1].Tag = "My Label 2";

Then simply turn PointLabels on and voila !

--

FP

Software FX

post-2107-13922379550798_thumb.gif

Link to comment
Share on other sites

In VB.NET I tried the following on a SoftwareFX.ChartFX.GalleryObj.Bar chart to try to get the tags to display at the %L location in the PointLabelMask:

Chart1.Point(0, 3).Tag = "My Label3"

Dim maskString As String = "I'm point: " + "%N " + " my value is: " + "%v" + " my Tag is: " + "%L"

Chart1.PointLabelMask = maskString

Chart1.PointLabels = True

But the tag did not show up when the chart is displayed... Any ideas?

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:ptt1Z5z8EHA.1580@webserver3.softwarefx.com...

Use PintLabelMask so that each point displays its "tag" followed by its value:

chart1.PointLabelMask = "%L\n%v";

Assign the Tag property only for those points that you want to display a label for:

chart1.Point[0].Tag = "My Label 1";

chart1.Point[1].Tag = "My Label 2";

Then simply turn PointLabels on and voila !

--

FP

Software FX

Link to comment
Share on other sites

I pasted this code in a brand new VB.NET Project with a default chart in it and it works perfectly.

You must be doing something else that is overriding these settings. Also, your strings are quite long could it be that the text is being covered by some other object ?

Also, make sure you are using the latest SP.

--

FP

Software FX

Link to comment
Share on other sites

Thanks for the quick reply.. just tried the same and it does work in a new project.. I will remember to try this before bugging you the next time.. Later I will also go back to try to determine the cause of the tags not working, or what I overrode to cause this anomoly.

Thanks much,

Scott

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:Lrnw1u18EHA.1116@webserver3.softwarefx.com...

I pasted this code in a brand new VB.NET Project with a default chart in it and it works perfectly.

You must be doing something else that is overriding these settings. Also, your strings are quite long could it be that the text is being covered by some other object ?

Also, make sure you are using the latest SP.

--

FP

Software FX

Link to comment
Share on other sites

Ok.. displaying the tag worked with just the pasted code... See pt3(My Label-3) This is a negative bar chart.

I then re-introduced conditionals to change the colors of the bars in the new project that succesfully displayed the tag, and at this point the tag disapeared.Am I doing something wrong?

My code to reproduce:

'********* CODE BEGIN**********

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim condition1 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(0)

condition1.Color = System.Drawing.Color.Green

condition1.Condition.To = 0.5

condition1.Condition.From = 0

condition1.Condition.ToOpen = True

Dim condition2 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(1)

condition2.Color = System.Drawing.Color.Green

condition2.Condition.To = 0

condition2.Condition.From = -0.5

condition2.Condition.ToOpen = True

Dim condition3 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(2)

condition3.Color = System.Drawing.Color.Orange

condition3.Condition.To = 0.75

condition3.Condition.From = 0.5

condition3.Condition.ToOpen = True

Dim condition4 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(3)

condition4.Color = System.Drawing.Color.Orange

condition4.Condition.To = -0.5

condition4.Condition.From = -0.75

condition4.Condition.ToOpen = True

Dim condition5 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(4)

condition5.Color = System.Drawing.Color.Red

condition5.Condition.To = 1

condition5.Condition.From = 0.75

condition5.Condition.ToOpen = True

Dim condition6 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(5)

condition6.Color = System.Drawing.Color.Red

condition6.Condition.To = -0.75

condition6.Condition.From = -1

condition6.Condition.ToOpen = True

' Set TAG

Chart1.Point(0, 3).Tag = "My Label-3"

Dim maskString As String = "%v" + " " + "%L"

Chart1.PointLabelMask = maskString

Chart1.PointLabels = True

End Sub

'********* CODE END**********

Result after conditionals(NO TAG DISPLAYED):

My data set "negative.txt"

.0013

.45

.80

-.21

.70

-.56

-.14

.67

.98

.43

-.13

-.70

.56

.70

-.45

-.32

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:Lrnw1u18EHA.1116@webserver3.softwarefx.com...

I pasted this code in a brand new VB.NET Project with a default chart in it and it works perfectly.

You must be doing something else that is overriding these settings. Also, your strings are quite long could it be that the text is being covered by some other object ?

Also, make sure you are using the latest SP.

--

FP

Software FX

Link to comment
Share on other sites

OK...

With further investigation it looks as if a conditional tag is required but it appears to override any point tag even if set after the conditional. Conditional Attributes dont include the Point method to set the point tag directly either... hmmm... Any Ideas?

Scott

"Scott" <vti_answer@hotmail.com> wrote in message news:dwj2vC28EHA.1116@webserver3.softwarefx.com...

Ok.. displaying the tag worked with just the pasted code... See pt3(My Label-3) This is a negative bar chart.

I then re-introduced conditionals to change the colors of the bars in the new project that succesfully displayed the tag, and at this point the tag disapeared.Am I doing something wrong?

My code to reproduce:

'********* CODE BEGIN**********

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim condition1 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(0)

condition1.Color = System.Drawing.Color.Green

condition1.Condition.To = 0.5

condition1.Condition.From = 0

condition1.Condition.ToOpen = True

Dim condition2 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(1)

condition2.Color = System.Drawing.Color.Green

condition2.Condition.To = 0

condition2.Condition.From = -0.5

condition2.Condition.ToOpen = True

Dim condition3 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(2)

condition3.Color = System.Drawing.Color.Orange

condition3.Condition.To = 0.75

condition3.Condition.From = 0.5

condition3.Condition.ToOpen = True

Dim condition4 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(3)

condition4.Color = System.Drawing.Color.Orange

condition4.Condition.To = -0.5

condition4.Condition.From = -0.75

condition4.Condition.ToOpen = True

Dim condition5 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(4)

condition5.Color = System.Drawing.Color.Red

condition5.Condition.To = 1

condition5.Condition.From = 0.75

condition5.Condition.ToOpen = True

Dim condition6 As SoftwareFX.ChartFX.ConditionalAttributes = Chart1.ConditionalAttributes(5)

condition6.Color = System.Drawing.Color.Red

condition6.Condition.To = -0.75

condition6.Condition.From = -1

condition6.Condition.ToOpen = True

' Set TAG

Chart1.Point(0, 3).Tag = "My Label-3"

Dim maskString As String = "%v" + " " + "%L"

Chart1.PointLabelMask = maskString

Chart1.PointLabels = True

End Sub

'********* CODE END**********

Result after conditionals(NO TAG DISPLAYED):

My data set "negative.txt"

.0013

.45

.80

-.21

.70

-.56

-.14

.67

.98

.43

-.13

-.70

.56

.70

-.45

-.32

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:Lrnw1u18EHA.1116@webserver3.softwarefx.com...

I pasted this code in a brand new VB.NET Project with a default chart in it and it works perfectly.

You must be doing something else that is overriding these settings. Also, your strings are quite long could it be that the text is being covered by some other object ?

Also, make sure you are using the latest SP.

--

FP

Software FX

post-2107-13922379552398_thumb.gif

Link to comment
Share on other sites

Conditional attributes work by setting the per-point attributes. 

What you have here is a conflict. On one side you have a conditional attribute that is being applied to the point that has NO tag. And then you have a Per-Point attribute for the SAME point that does. This is a contradiction and then what Chart FX does is use the conditional attribute. In other words, when conditional attributes are used, per-point attributes are reset. This is by design.

What you need to do is put the tag in a conditional attribute that applies to that point only. You can do this by using the ConditionalAttributes event handler.

--

FP

Software FX

post-2107-13922379554228_thumb.gif

Link to comment
Share on other sites

FP,

Chart1.ConditionalAttributes.point is not supported.. is this what you are referring to when you state "put the tag in a conditional attribute that applies to that point only"? If there is something else could you please provide an example.. many thanks in advance.

Scott

What you need to do is put the tag in a conditional attribute that applies to that point only. You can do this by using the ConditionalAttributes event handler.

--

FP

Software FX

Link to comment
Share on other sites

What I meant was to use a Conditional attribute that applies only to the point you want to label. This conditional attribute has the appropriate Tag set.

For example lets say the Conditional attribute you want to use is #3.

chart.ConditionalAttributes[3].Tag = "MyLabel1";

Then you capture the ConditionalAttributesCallback event as follows:

private void chart1_ConditionalAttributesCallback(object sender, SoftwareFX.ChartFX.ConditionalAttributesEventArgs e)

{

if (e.Point == <Point to label>)

e.Attributes = 3;

}

Please refer to the docs. for more information about this event an how Conditional attributes work.

--

FP

Software FX

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...