Hi,
I have some questions with a chart that is constructed with the following code (the aspx does not change any properties);
Q1) The values on the Y-Axis get cut
Q2) Is it possible to adjust the space between the Y-axis and the bar?
Q3) How do I prevent the legend to overlap the bar?
Q4) Can I add a extra row of information in the legend?
Q5) Can the width of the area inside the axis be set in pixel
Best regards
Robert
I have some questions with a chart that is constructed with the following code (the aspx does not change any properties);
| System.Drawing.Color COLOR_LINE = System.Drawing.Color.FromArgb(0xcc, 0xcc, 0xcc); |
| System.Drawing.Color COLOR_FUEL = System.Drawing.Color.FromArgb(0xaf, 0x93, 0x26); |
| System.Drawing.Color COLOR_EMPTY = System.Drawing.Color.FromArgb(0xcc, 0xcc, 0xcc); |
| System.Drawing.Color COLOR_BACKGROUND = System.Drawing.Color.FromArgb(0xff, 0xff, 0xff); |
| int maxLevel = 10000; |
| int currentLevel = 8000; |
| int level1 = currentLevel; |
| int level2 = maxLevel - level1; |
| // Current level |
| ChartSeries series1 = new ChartSeries(); |
| series1.Name = String.Format("Current level: {0}", currentLevel); |
| series1.Type = ChartSeriesType.StackedBar; |
| series1.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; |
| series1.Appearance.FillStyle.MainColor = COLOR_FUEL; |
| series1.Appearance.FillStyle.SecondColor = System.Drawing.Color.Transparent; |
| series1.Appearance.LabelAppearance.Visible = false; |
| series1.Appearance.Border.Color = COLOR_LINE; |
| series1.AddItem(level1); |
| chart.Series.Add(series1); |
| // Max level |
| ChartSeries series2 = new ChartSeries(); |
| series2.Name = String.Format("Max level: {0}", maxLevel); |
| series2.Type = ChartSeriesType.StackedBar; |
| series2.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient; |
| series2.Appearance.FillStyle.MainColor = COLOR_EMPTY; |
| series2.Appearance.FillStyle.SecondColor = System.Drawing.Color.Transparent; |
| series2.Appearance.LabelAppearance.Visible = false; |
| series2.Appearance.Border.Color = COLOR_LINE; |
| series2.AddItem(level2); |
| chart.Series.Add(series2); |
| // Settings |
| chart.Appearance.Border.Visible = false; |
| chart.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; |
| chart.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent; |
| chart.ChartTitle.Visible = false; |
| chart.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; |
| chart.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.Color.Transparent; |
| chart.PlotArea.Appearance.Border.Visible = false; |
| chart.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.ChartAxisLayoutMode.Between; |
| chart.Legend.Appearance.Border.Color = COLOR_LINE; |
| chart.PlotArea.XAxis.Appearance.LabelAppearance.Visible = false; |
| chart.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Border.Color = System.Drawing.Color.Red; |
| chart.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Border.Width = 1; |
| chart.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Border.Visible = true; |
| chart.PlotArea.YAxis.Appearance.LabelAppearance.Dimensions.Width = Telerik.Charting.Styles.Unit.Pixel(300); |
| chart.PlotArea.YAxis.AxisLabel.Appearance.Dimensions.Width = Telerik.Charting.Styles.Unit.Pixel(299); |
| chart.PlotArea.YAxis.AxisLabel.Appearance.Position.Auto = false; |
| chart.PlotArea.YAxis.Appearance.TextAppearance.Position.Auto = false; |
| chart.PlotArea.YAxis.Appearance.TextAppearance.Dimensions.Width = Telerik.Charting.Styles.Unit.Pixel(200); |
| chart.Appearance.BarWidthPercent = 50; |
| chart.Width = new Unit(350, UnitType.Pixel); |
| chart.Height = new Unit(250, UnitType.Pixel); |
Q1) The values on the Y-Axis get cut
Q2) Is it possible to adjust the space between the Y-axis and the bar?
Q3) How do I prevent the legend to overlap the bar?
Q4) Can I add a extra row of information in the legend?
Q5) Can the width of the area inside the axis be set in pixel
Best regards
Robert