FSzymanski Posted December 19, 2011 Report Posted December 19, 2011 Is there support in Chart FX 7 for broken Axes? An example of what I'm talking of can be seen here: http://peltiertech.com/WordPress/broken-y-axis-in-excel-chart/. I would like to apply this to a line graph. My application lets users select among a set of data to graph, and some of the series have points that are in a largely different range than the others. If they select one series with values in the hundreds of thousands and one that varies between 10 and 20, then the chart will plot from 0 to hundred of thousands and the lower series loses its variance. The user won't be able to see any change in the lower series that they may consider significant. ~Frank Quote
AndreG Posted December 20, 2011 Report Posted December 20, 2011 I made a sample similar to this for someone else a whileback. Since Chart FX 7 does not support broken Y axis (Chart FX 8 will), we cando something similar to what was suggested on the link you posted. Have 2panes, 2 Y axis, and same data on both. Here is the code. Note that you canmodify the panes sizes, proportion and such to make it more visually appealing. protected voidPage_Load(object sender, EventArgs e) { DataTable table1 = newDataTable("Test"); //Create a table with your data twice table1.Columns.Add("Value1",System.Type.GetType("System.Double")); table1.Columns.Add("Value2",System.Type.GetType("System.Double")); table1.Rows.Add(new object[]{ 10, 10 }); table1.Rows.Add(new object[]{ 12, 12 }); table1.Rows.Add(new object[]{ 11, 11 }); table1.Rows.Add(new object[]{ 13, 13 }); table1.Rows.Add(new object[]{ 89, 89 }); table1.Rows.Add(new object[]{ 10, 10 }); Chart1.DataSourceSettings.Fields.Add(new FieldMap("Value1",FieldUsage.Value)); Chart1.DataSourceSettings.Fields.Add(new FieldMap("Value2",FieldUsage.Value)); Chart1.DataSource = table1; Chart1.Data.Series = 2; //Make both series the same color Chart1.Series[1].Color = Chart1.Series[0].Color; Chart1.Series[1].AlternateColor = Chart1.Series[0].AlternateColor; Pane pane1 = Chart1.Panes[0]; Pane pane2 = newPane(); Chart1.Panes.Add(pane2); Chart1.Series[0].Pane = Chart1.Panes[0]; Chart1.Series[1].Pane = Chart1.Panes[1]; pane2.AxisY.Max = 15; pane2.AxisY.Min = 0; pane1.AxisY.Max = 100; pane1.AxisY.Min = 80; //Hide the extra series from the legendbox Chart1.LegendBox.ItemAttributes[Chart1.Series, 1].Visible = false; } Quote
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.