Jump to content
Software FX Community

BoxPlot + Annotations


Recommended Posts

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?

Link to comment
Share on other sites

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  
Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...