Jump to content
Software FX Community

How i can add Series in chart (VB or c#)


dotnetclassic

Recommended Posts

Only one set of OHLC bars can be plot per chart.

My mistake. Here is a sample code of how you can plot two sets of OHLC bars. Note the format I have:

Series 0 - Open for first set of bars

Series 1 - High for first set of bars

Series 2 - Low for first set of bars

Series 3 - Close for first set of bars

Series 4 - Open for second set of bars.... and so on.

 

DataTable table1 = new DataTable("Test");table1.Columns.Add("Value1", System.Type.GetType("System.Double"));

table1.Columns.Add(

"Value2", System.Type.GetType("System.Double"));table1.Columns.Add("Value3", System.Type.GetType("System.Double"));

table1.Columns.Add(

"Value4", System.Type.GetType("System.Double"));table1.Columns.Add("Value5", System.Type.GetType("System.Double"));

table1.Columns.Add(

"Value6", System.Type.GetType("System.Double"));table1.Columns.Add("Value7", System.Type.GetType("System.Double"));

table1.Columns.Add(

"Value8", System.Type.GetType("System.Double"));table1.Rows.Add(new object[] { 1, 4, 8, 10, 2, 5, 7, 9 });

table1.Rows.Add(

new object[] { 2, 5, 7, 9, 1, 4, 8, 10 });table1.Rows.Add(new object[] { 1, 2, 3, 4, 3, 7 ,10 ,11 });

chart1.DataSourceSettings.Fields.Add(

new FieldMap("Value1", FieldUsage.Value));chart1.DataSourceSettings.Fields.Add(new FieldMap("Value2", FieldUsage.Value));

chart1.DataSourceSettings.Fields.Add(

new FieldMap("Value3", FieldUsage.Value));chart1.DataSourceSettings.Fields.Add(new FieldMap("Value4", FieldUsage.Value));

chart1.DataSourceSettings.Fields.Add(

new FieldMap("Value5", FieldUsage.Value));chart1.DataSourceSettings.Fields.Add(new FieldMap("Value6", FieldUsage.Value));

chart1.DataSourceSettings.Fields.Add(

new FieldMap("Value7", FieldUsage.Value));chart1.DataSourceSettings.Fields.Add(new FieldMap("Value8", FieldUsage.Value));

chart1.DataSource = table1;

chart1.Gallery =
Gallery.OpenHighLowClose;

chart1.LegendBox.Visible =

false;

 

Regards,

AndreG

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...