dotnetclassic Posted November 5, 2008 Report Share Posted November 5, 2008 hi i am newbie in chartfx i am using OpenHighLowClose I have 3 stock symbols' s Data just like MSFT, GOOG, YHOO in Datatable. I want to show 3 series for 3 symbols in different colors So please tel me how i can add data. And also on mouse over on each series will show Open:, High:, Low:, Close: values Quote Link to comment Share on other sites More sharing options...
AndreG Posted November 5, 2008 Report Share Posted November 5, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.