Hi, I'm using telerik RadHtmlChart column series. I add the series dynamically in the code behind.
In my first screen, after page_load, I have three series, (attachment named 3 series first) but then the user can select more series. When I select more than three series, for example 15 series (attachment named 15 series), the columns, of course, are thinner than the ones in the first screen. After that, if I select to show me 3 series (attachment named 3 series last), the columns width remains the same as when I selected the 15 series. The same happens if I select 30 or any other number with thinner columns than the 3 series case.
I guess that the columns width should have been automatically adjusted according to the series quantity.
Maybe there is a property or something that I could add and solve my problem.
Please, any help would be appreciated.
Here is part of the code:
CliAltBajChart.PlotArea.XAxis.TitleAppearance.Text = "Mes";
CliAltBajChart.PlotArea.XAxis.AxisCrossingValue = 0;
CliAltBajChart.PlotArea.XAxis.MajorTickType = Telerik.Web.UI.HtmlChart.TickType.None;
CliAltBajChart.PlotArea.XAxis.MinorTickType = Telerik.Web.UI.HtmlChart.TickType.None;
CliAltBajChart.PlotArea.XAxis.MajorGridLines.Width = 2;
CliAltBajChart.PlotArea.YAxis.TitleAppearance.Text = "Cantidad de clientes";
CliAltBajChart.PlotArea.YAxis.MajorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
CliAltBajChart.PlotArea.YAxis.MinorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
CliAltBajChart.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0:N0}";
ColumnSeries TotalClientes = new ColumnSeries();
ColumnSeries Altas = new ColumnSeries();
ColumnSeries Bajas = new ColumnSeries();
List<EntCliente> LstC = new BusCliente().ObtenerClientes(0).ToList();
string name = "Total de Clientes" + nombre;
ColumnSeries TotalClientes = new ColumnSeries();
TotalClientes.Name = name;
TotalClientes.LabelsAppearance.Visible = false;
TotalClientes.TooltipsAppearance.Color = System.Drawing.Color.White;
TotalClientes.TooltipsAppearance.DataFormatString = "{0:N0}";
ColumnSeries Altas = new ColumnSeries();
Altas.Name = "Altas" + nombre;
Altas.LabelsAppearance.Visible = false;
Altas.LabelsAppearance.DataFormatString = "{0:N0}";
Altas.TooltipsAppearance.Color = System.Drawing.Color.White;
Altas.TooltipsAppearance.DataFormatString = "{0:N0}";
ColumnSeries Bajas = new ColumnSeries();
Bajas.Name = "Bajas" + nombre;
Bajas.LabelsAppearance.Visible = false;
Bajas.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.BarColumnLabelsPosition.Center;
Bajas.LabelsAppearance.DataFormatString = "{0:N0}";
Bajas.TooltipsAppearance.Color = System.Drawing.Color.White;
Bajas.TooltipsAppearance.DataFormatString = "{0:N0}";
CliAltBajChart.PlotArea.XAxis.Items.Clear();
foreach (EntCliente e in LstC)
{
string mes = Convert.ToString(e.mes);
CliAltBajChart.PlotArea.XAxis.Items.Add(mes);
decimal? cantClientes = Convert.ToDecimal(e.cantClientes);
TotalClientes.SeriesItems.Add(cantClientes);
decimal? cantAltas = Convert.ToDecimal(e.cantAltas);
Altas.SeriesItems.Add(cantAltas);
decimal? cantBajas = Convert.ToDecimal(e.cantBajas);
Bajas.SeriesItems.Add(cantBajas);
}
CliAltBajChart.PlotArea.Series.Add(TotalClientes);
CliAltBajChart.PlotArea.Series.Add(Altas);
CliAltBajChart.PlotArea.Series.Add(Bajas);
HtmlChartHolder.Controls.Add(CliAltBajChart);