I am using the code-behind for the report designer tool
Here is my output with only one x-axis label displaying, but I ultimately need all the labels to display and eventually get the series stacked. I've been busting my head against this.
Report Image
Here is my sample code to show my issue:
Here is my output with only one x-axis label displaying, but I ultimately need all the labels to display and eventually get the series stacked. I've been busting my head against this.
Report Image
Here is my sample code to show my issue:
void
chart1_NeedDataSource(
object
sender, EventArgs e)
{
chart1.PlotArea.Appearance.Dimensions.Margins =
"5%"
;
chart1.PlotArea.Appearance.Dimensions.Margins.Bottom.Type = Telerik.Reporting.Charting.Styles.UnitType.Percentage;
chart1.PlotArea.Appearance.Dimensions.Margins.Bottom.Value = 15f;
chart1.PlotArea.Appearance.Dimensions.Margins.Left.Type = Telerik.Reporting.Charting.Styles.UnitType.Percentage;
chart1.PlotArea.Appearance.Dimensions.Margins.Left.Value = 15f;
chart1.Legend.Visible =
false
;
chart1.ChartTitle.Visible =
false
;
chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45;
chart1.PlotArea.XAxis.Clear();
chart1.PlotArea.XAxis.AutoScale =
false
;
chart1.PlotArea.XAxis.AddRange(1, 5, 1);
chart1.PlotArea.XAxis[0].TextBlock.Text =
"Test"
;
chart1.PlotArea.XAxis[1].TextBlock.Text =
"Test2"
;
chart1.PlotArea.XAxis[2].TextBlock.Text =
"Test3"
;
chart1.PlotArea.XAxis[3].TextBlock.Text =
"Test4"
;
chart1.PlotArea.XAxis[4].TextBlock.Text =
"Test5"
;
chart1.Series.Add(
new
Telerik.Reporting.Charting.ChartSeries() { Name =
"Test"
});
double
[] testData = { 5, 6, 7, 8, 9 };
foreach
(
double
item
in
testData)
{
chart1.Series[0].AddItem(item);
}
}