Hi Sergio,
This is a limitation of the current chart control. As Hadib said, the layout you need, can be achieved only programmatically. Here's a sample code of how to programmatically create series and items using DataTable and SqlDataAdapter:
//retrieves the data from the database
public DataTable GetData()
{
string connectionString = "Data Source...";
string selectString = "SELECT...";
SqlDataAdapter sqlAdapter = new SqlDataAdapter(selectString, connectionString);
DataSet ds = new DataSet();
sqlAdapter.Fill(ds);
foreach(var row in ds.Tables[0].Rows)
{
...
}
return ds.Tables[0];
}
private void chart1_NeedDataSource(object sender, EventArgs e)
{
var dataTable = GetData();
//chart is the object from the report definition
//create the series for the chart
chart1.Series.Add(new Charting.ChartSeries("Series1"));
chart1.Series.Add(new Charting.ChartSeries("Series2"));
foreach(DataRow row in dataTable)
{
var newItem = new Charting.ChartSeriesItem(x, y);
//add the items to the corresponding series
if(...)
{
chart1.Series[0].Items.Add(newItem);
}
else
{
chart1.Series[1].Items.Add(newItem);
}
}
}
Here are a couple of links that further discuss the matter:
Creating Chart Programmatically
Creating Chart Programmatically (advanced)
Greetings,
Elian
the Telerik team