ARissing Posted November 1, 2007 Report Share Posted November 1, 2007 I'm currently trying to apply annotations to a boxplot chart. I'm having a bit of a problem because the x-axis is not binding a proper min/max and subsequently I do not have the proper positions to place the annotations. My data is in the following form: 1/2006 2/2006 3/2006 4/2006 1.023 1.205 1.231 1.344 1.223 1.205 1.245 1.145 ... ... ... ... The columns are the dates, which is part of the problem I believe. It doesn't seem that the X-axis is bound whatsoever. What I'm trying to achieve is that the Y-axis is the values of the quartiles (hence the box plots) and the x-axis is the time progression of the data. The examples and the comments I've seen on the forums don't work with the boxplot in this fashion. Without the X-axis properly bound, I cannot determine the x/y positions to place my annotations on the graph. Am I missing something or am I just out of luck? Quote Link to comment Share on other sites More sharing options...
PDyer Posted November 2, 2007 Report Share Posted November 2, 2007 For this special cases where your data is in tabular format you may use our Crosstab feature. Crosstab changes your data in a Chart FX compatible format as follows:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 1/2006 1.023 1.2232/2006 1.205 1.2053/2006 1.231 1.2454/2006 1.344 1.145 Then automatically the Dates will be placed in a categorical X axis, the other two columns will be placed as two series in the Y Axis.Here is some code I took from the Resource Center, I hope it helps: //This sample takes the data in tabular format and converts it into columnar format, resulting in a chart that//Populating the Chart from databasestring mySelectQuery = "SELECT Product,Year,Sales from ProductSales";string dataPath = Path.Combine(Application.StartupPath, "Samples.mdb");string myConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0};", dataPath);System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(myConnectionString);System.Data.DataSet ds = new System.Data.DataSet();System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(mySelectQuery, myConnection);adapter.Fill(ds, "ProductSales"); // Create and configure the Crosstab data providerDataTableProvider dt = new DataTableProvider(ds.Tables[0]);CrosstabDataProvider cfxCT = new CrosstabDataProvider();cfxCT.DataSource = dt; // Instruct Chart FX how to use the fields in the Crosstab. Refer to the Resource Center documentation// for further details.chart1.DataSourceSettings.Fields.Add(new FieldMap("Product", FieldUsage.ColumnHeading));chart1.DataSourceSettings.Fields.Add(new FieldMap("Year", FieldUsage.RowHeading));chart1.DataSourceSettings.Fields.Add(new FieldMap("Sales", FieldUsage.Value));chart1.DataSource = cfxCT;If you have any questions send me an email to Support@SoftwareFX.com Quote Link to comment Share on other sites More sharing options...
ARissing Posted November 2, 2007 Author Report Share Posted November 2, 2007 That wasn't the problem I was having. I was having difficulty finding the location of the points that were being placed on the chart. I believe I've figured it out though, using MarkerToPixel, but its pretty hackish in general. 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.