julien.nicolas1 Posted March 25, 2007 Report Share Posted March 25, 2007 Hi, We actually study your library and i would like to know if it's possible to do these charts : - Grouped Column chart - Range column chart (floating bar) See in the attached files the corresponding images. Link to comment Share on other sites More sharing options...
JuanC Posted March 25, 2007 Report Share Posted March 25, 2007 - Grouped Column Chart chart1.Data.Series = 4;chart1.Data.Points = 10;Random r = new Random();Random r = new Random();for (int i = 0; i < 4; i++) { for (int j = 0; j < 10; j++) { chart1.Data[i, j] = r.NextDouble() * 20; }}chart1.Gallery = Gallery.Bar;chart1.Series[1].Stacked = true;chart1.Series[2].Stacked = false;chart1.Series[3].Stacked = true; chart1.Gallery = Gallery.Bar;chart1.Series[1].Stacked = true;chart1.Series[2].Stacked = false;chart1.Series[3].Stacked = true; The trick here is that to create the stacked groups you do not set the global stacked property but instead create set the stacked property on a per-series basis. Note that we set it to false on the third series which actually "creates" a new stacked group. The value for Series[0].Stacked is not used. - Range Column Chart chart1.Data.Series = 2;chart1.Data.Points = 10; Random r = new Random();for (int i = 0; i < 2; i++) { for (int j = 0; j < 10; j++) { double from = r.NextDouble() * 30; chart1.Data.YFrom[i, j] = from; chart1.Data[i, j] = from + (r.NextDouble() * 50); }}chart1.Gallery = Gallery.Bar;Random r = new Random();for (int i = 0; i < 2; i++) { for (int j = 0; j < 10; j++) { double from = r.NextDouble() * 30; chart1.Data.YFrom[i, j] = from; chart1.Data[i, j] = from + (r.NextDouble() * 50); }}chart1.Gallery = Gallery.Bar;Gallery.Bar;In both cases I am setting some random data but the code would be similar if you are binding the chart to a database, XML, etc. When databinding you may need to use the DataSourceSettings property to create a FieldMap with FieldUsage.FromValue to achieve the RangeColumn chart. JuanC Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.