Jump to content
Software FX Community

Annotation in version 6.2 (WindowsForms)


karin

Recommended Posts

Support Service,

I have a problem trying to plot a note(annotation) on the chart (WindowsForms). So I created a simple project and repeated the procedure and the error still persists.

On the event Highlighted() of the chart, I tried to plot a note(annotation) by adding the 'Extention' chart.Extensions.Add (***), which is giving an error on the screen (one red'X'on the entire chart).

I'm using version 6.2 of the Chart. I wonder if there is a problem with this component on this version, because I did the same for version 7 and it worked.

(On my atual code I can not migrate to version 7, I must continue using version 6.2 and I need to solve it!)

I am sending the code.

I need an answer with the most urgency. We work with Oil and Gas Projects, and we are about to deliver/deploy a new version.

Thanks in advance and waiting for your response.

Karin

 -----------------------------------------------------CODE:----------------------------------------------------------------------
using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using SoftwareFX.ChartFX;

using SoftwareFX.ChartFX.Annotation;

using SoftwareFX.ChartFX.Extensions;

namespace BallomChart

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

plotPoints();

this.chart1.Highlighted += chart1_Highlighted;

}

void chart1_Highlighted(object sender, SoftwareFX.ChartFX.Base.HighlightEventArgs e)

{

AnnotationX annot = new AnnotationX();

AnnotationBalloon balloon = new AnnotationBalloon();

annot.List.Clear();

annot.List.Add(balloon);

chart1.Extensions.Add(annot);

balloon.TailCorner = 2;

balloon.ArrowFactor = 40;

balloon.Border.Color = System.Drawing.Color.Black;

balloon.Color = System.Drawing.Color.White;

balloon.Text = "Test";

double x = chart1.XValue[e.Series, e.Point];

double y = chart1.Value[e.Series, e.Point];

balloon.Attach(System.Drawing.StringAlignment.Near, x,

System.Drawing.StringAlignment.Far, y);

chart1.Refresh();

chart1.CloseData(COD.Values);

}

void plotPoints()

{

chart1.Height = 350;

chart1.Width = 500;

chart1.Gallery = Gallery.Lines;

// Passing data

chart1.OpenData(COD.Values, 2, 6);

chart1.OpenData(COD.XValues, 2, 6);

chart1.Value[0, 0] = 10;

chart1.Value[0, 1] = 62;

chart1.Value[0, 2] = 42;

chart1.Value[0, 3] = 16;

chart1.Value[0, 4] = 96;

chart1.Value[0, 5] = 74;

chart1.Value[1, 0] = 45;

chart1.Value[1, 1] = 22;

chart1.Value[1, 2] = 27;

chart1.Value[1, 3] = 38;

chart1.Value[1, 4] = 68;

chart1.Value[1, 5] = 91;

chart1.XValue[0, 0] = 1;

chart1.XValue[0, 1] = 2;

chart1.XValue[0, 2] = 3;

chart1.XValue[0, 3] = 4;

chart1.XValue[0, 4] = 5;

chart1.XValue[0, 5] = 6;

chart1.XValue[1, 0] = 7;

chart1.XValue[1, 1] = 8;

chart1.XValue[1, 2] = 9;

chart1.XValue[1, 3] = 10;

chart1.XValue[1, 4] = 11;

chart1.XValue[1, 5] = 12;

chart1.CloseData(COD.Values);

chart1.CloseData(COD.XValues);

}

}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...