Jump to content
Software FX Community

How to draw multiple realtime line smoothly?


dwang
 Share

Recommended Posts

Hi, everyone,

I'm new here, I'm trying to draw multiple stock price at real-time. here is the code I'm using when I get realtime price point, if I only have one instrument (single series), the line is very smooth. If I have more than one, I only see separate point (the lines are broken), I guess different series data point are different (in time?), but I thought that each series should be indenpendent. Is there anything I'm doing wrong? thanks a lot.

 

private void AddPoint(DateTime datetime, double value, int seriesIdx)

{

chart1.RealTime.BeginAddData(1, RealTimeAction.Append);

chart1.Data.X[seriesIdx, 0] = datetime.ToOADate();

chart1.Data.Y[seriesIdx, 0] = value;

chart1.RealTime.EndAddData(true, true);

chart1.AxisX.LabelsFormat.Format =

AxisFormat.Time;

chart1.AxisX.LabelsFormat.CustomFormat =

"HH:mm:ss";

}

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.

 Share

×
×
  • Create New...