rad chart problem

7 posts, 0 answers
  1. shefa'
    shefa' avatar
    7 posts
    Member since:
    Apr 2009

    Posted 28 Apr 2009 Link to this post

    i'm using rad chart , but a run time error appears
    Unexpected error has occured.please review the inner exception for more information to solve the problem.
    INNER EXCEPTION as follow:
    Object reference not set to an instance of an object.

    SOURCE:
    Telerik.wincontrols.radchart
    What is the problem and how to solve it?
  2. Jack
    Jack avatar
    21 posts
    Member since:
    Sep 2008

    Posted 22 May 2009 Link to this post

    I also get the same exception once I Bind data to the chart, or when, in design time, i browse through the list of chart types and select one or another.

    the following stack trace:

       at Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex)
       at Telerik.Charting.Chart.GetImage(Int32 width, Int32 height)
       at Telerik.Charting.Chart.GetImage()
       at Telerik.WinControls.UI.RadChart.GetImage()
       at Telerik.WinControls.UI.RadChart.OnPaint(PaintEventArgs e)
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
       at System.Windows.Forms.Control.WmPaint(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.UserControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 25 May 2009 Link to this post

    Hello Jack and Shefa',

    Can you, please, provide more details on the problems you experience? A step-by-step guide on how to expose the problems will help us localize the problems.

    The currently provided information (for both cases) is insufficient to reproduce the problems.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Jack
    Jack avatar
    21 posts
    Member since:
    Sep 2008

    Posted 25 May 2009 Link to this post

    VERSION,. WinForms: 2009.1.311,
    VS2005/2008 C#


    Hello Evtim,


    1st of all I have a chart with the following design code:

    namespace Views

     

    {

     

    partial class WarehouseOccupationsChart //: PerfConn.Presentation.WinForms.View<WarehouseOccupationsOverviewController>

     

    {

     

    /// <summary>

     

     

    /// Required designer variable.

     

     

    /// </summary>

     

     

    private System.ComponentModel.IContainer components = null;

     

     

    /// <summary>

     

     

    /// Clean up any resources being used.

     

     

    /// </summary>

     

     

    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

     

     

    protected override void Dispose(bool disposing)

     

    {

     

    if (disposing && (components != null))

     

    {

    components.Dispose();

    }

     

    base.Dispose(disposing);

     

    }

    #region

     

    Component Designer generated code

     

     

    /// <summary>

     

     

    /// Required method for Designer support - do not modify

     

     

    /// the contents of this method with the code editor.

     

     

    /// </summary>

     

     

    private void InitializeComponent()

     

    {

    Telerik.Charting.Styles.

    Corners corners1 = new Telerik.Charting.Styles.Corners();

     

    Telerik.Charting.

    GradientElement gradientElement1 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement2 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement3 = new Telerik.Charting.GradientElement();

     

    System.ComponentModel.

    ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WarehouseOccupationsChart));

     

    Telerik.Charting.Styles.

    ChartMargins chartMargins1 = new Telerik.Charting.Styles.ChartMargins();

     

    Telerik.Charting.Styles.

    ChartPaddings chartPaddings1 = new Telerik.Charting.Styles.ChartPaddings();

     

    Telerik.Charting.Styles.

    ChartMargins chartMargins2 = new Telerik.Charting.Styles.ChartMargins();

     

    Telerik.Charting.Styles.

    ChartPaddings chartPaddings2 = new Telerik.Charting.Styles.ChartPaddings();

     

    Telerik.Charting.

    Palette palette1 = new Telerik.Charting.Palette();

     

    Telerik.Charting.

    PaletteItem paletteItem1 = new Telerik.Charting.PaletteItem();

     

    Telerik.Charting.

    PaletteItem paletteItem2 = new Telerik.Charting.PaletteItem();

     

    Telerik.Charting.

    PaletteItem paletteItem3 = new Telerik.Charting.PaletteItem();

     

    Telerik.Charting.Styles.

    Corners corners2 = new Telerik.Charting.Styles.Corners();

     

    Telerik.Charting.Styles.

    ChartMarginsLegend chartMarginsLegend1 = new Telerik.Charting.Styles.ChartMarginsLegend();

     

    Telerik.Charting.Styles.

    ChartPaddingsLegend chartPaddingsLegend1 = new Telerik.Charting.Styles.ChartPaddingsLegend();

     

    Telerik.Charting.Styles.

    ChartMargins chartMargins3 = new Telerik.Charting.Styles.ChartMargins();

     

    Telerik.Charting.Styles.

    ChartMargins chartMargins4 = new Telerik.Charting.Styles.ChartMargins();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem1 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem2 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem3 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem4 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem5 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem6 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartAxisItem chartAxisItem7 = new Telerik.Charting.ChartAxisItem();

     

    Telerik.Charting.

    ChartSeries chartSeries1 = new Telerik.Charting.ChartSeries();

     

    Telerik.Charting.

    GradientElement gradientElement4 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement5 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement6 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    ChartSeries chartSeries2 = new Telerik.Charting.ChartSeries();

     

    Telerik.Charting.

    GradientElement gradientElement7 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement8 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement9 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    ChartSeries chartSeries3 = new Telerik.Charting.ChartSeries();

     

    Telerik.Charting.

    GradientElement gradientElement10 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement11 = new Telerik.Charting.GradientElement();

     

    Telerik.Charting.

    GradientElement gradientElement12 = new Telerik.Charting.GradientElement();

     

     

    this.radChart1 = new Telerik.WinControls.UI.RadChart();

     

    ((System.ComponentModel.

    ISupportInitialize)(this.radChart1)).BeginInit();

     

     

    this.SuspendLayout();

     

     

    //

     

     

    // radChart1

     

     

    //

     

     

    this.radChart1.Appearance.Border.Color = System.Drawing.Color.FromArgb(((int)(((byte)(178)))), ((int)(((byte)(178)))), ((int)(((byte)(178)))));

     

    corners1.BottomLeft = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners1.BottomRight = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners1.RoundSize = 7;

    corners1.TopLeft = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners1.TopRight = Telerik.Charting.Styles.

    CornerType.Round;

     

     

    this.radChart1.Appearance.Corners = corners1;

     

    gradientElement1.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(236)))), ((int)(((byte)(236)))));

     

    gradientElement2.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(248)))));

     

    gradientElement2.Position = 0.5F;

    gradientElement3.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(236)))), ((int)(((byte)(236)))));

     

    gradientElement3.Position = 1F;

     

    this.radChart1.Appearance.FillStyle.FillSettings.ComplexGradient.AddRange(new Telerik.Charting.GradientElement[] {

     

    gradientElement1,

    gradientElement2,

    gradientElement3});

     

    this.radChart1.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Horizontal;

     

     

    this.radChart1.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.ComplexGradient;

     

     

    this.radChart1.ChartTitle.Appearance.Border.Color = System.Drawing.Color.Transparent;

     

     

    this.radChart1.ChartTitle.Appearance.Dimensions.AutoSize = false;

     

     

    this.radChart1.ChartTitle.Appearance.Dimensions.Height = ((Telerik.Charting.Styles.Unit)(resources.GetObject("radChart1.ChartTitle.Appearance.Dimensions.Height")));

     

    chartMargins1.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins1.Bottom")));

     

    chartMargins1.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins1.Left")));

     

    chartMargins1.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins1.Right")));

     

    chartMargins1.Top = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins1.Top")));

     

     

    this.radChart1.ChartTitle.Appearance.Dimensions.Margins = chartMargins1;

     

    chartPaddings1.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings1.Bottom")));

     

    chartPaddings1.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings1.Left")));

     

    chartPaddings1.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings1.Right")));

     

    chartPaddings1.Top = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings1.Top")));

     

     

    this.radChart1.ChartTitle.Appearance.Dimensions.Paddings = chartPaddings1;

     

     

    this.radChart1.ChartTitle.Appearance.Dimensions.Width = ((Telerik.Charting.Styles.Unit)(resources.GetObject("radChart1.ChartTitle.Appearance.Dimensions.Width")));

     

     

    this.radChart1.ChartTitle.Appearance.FillStyle.MainColor = System.Drawing.Color.Empty;

     

     

    this.radChart1.ChartTitle.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;

     

     

    this.radChart1.ChartTitle.Marker.Visible = true;

     

    chartMargins2.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins2.Bottom")));

     

    chartMargins2.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins2.Left")));

     

    chartMargins2.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins2.Right")));

     

    chartMargins2.Top = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins2.Top")));

     

     

    this.radChart1.ChartTitle.TextBlock.Appearance.Dimensions.Margins = chartMargins2;

     

    chartPaddings2.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings2.Bottom")));

     

    chartPaddings2.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings2.Left")));

     

    chartPaddings2.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings2.Right")));

     

    chartPaddings2.Top = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddings2.Top")));

     

     

    this.radChart1.ChartTitle.TextBlock.Appearance.Dimensions.Paddings = chartPaddings2;

     

     

    this.radChart1.ChartTitle.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.Black;

     

     

    this.radChart1.ChartTitle.TextBlock.Appearance.TextProperties.Font = new System.Drawing.Font("Arial", 14F);

     

     

    this.radChart1.ChartTitle.TextBlock.Text = resources.GetString("radChart1.ChartTitle.TextBlock.Text");

     

    paletteItem1.MainColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));

     

    paletteItem1.SecondColor = System.Drawing.

    Color.RoyalBlue;

     

    paletteItem2.MainColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));

     

    paletteItem2.SecondColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));

     

    paletteItem3.MainColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));

     

    paletteItem3.SecondColor = System.Drawing.

    Color.Green;

     

    palette1.Items.AddRange(

    new Telerik.Charting.PaletteItem[] {

     

    paletteItem1,

    paletteItem2,

    paletteItem3});

    palette1.Name =

    "Palette";

     

     

    this.radChart1.CustomPalettes.AddRange(new Telerik.Charting.Palette[] {

     

    palette1});

     

    this.radChart1.DefaultType = Telerik.Charting.ChartSeriesType.StackedBar;

     

    resources.ApplyResources(

    this.radChart1, "radChart1");

     

    corners2.BottomLeft = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners2.BottomRight = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners2.RoundSize = 5;

    corners2.TopLeft = Telerik.Charting.Styles.

    CornerType.Round;

     

    corners2.TopRight = Telerik.Charting.Styles.

    CornerType.Round;

     

     

    this.radChart1.Legend.Appearance.Corners = corners2;

     

    chartMarginsLegend1.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMarginsLegend1.Right")));

     

     

    this.radChart1.Legend.Appearance.Dimensions.Margins = chartMarginsLegend1;

     

    chartPaddingsLegend1.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddingsLegend1.Bottom")));

     

    chartPaddingsLegend1.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartPaddingsLegend1.Right")));

     

     

    this.radChart1.Legend.Appearance.Dimensions.Paddings = chartPaddingsLegend1;

     

     

    this.radChart1.Legend.Appearance.FillStyle.MainColor = System.Drawing.Color.Empty;

     

     

    this.radChart1.Legend.Appearance.ItemMarkerAppearance.Figure = "Square";

     

     

    this.radChart1.Legend.Appearance.ItemTextAppearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(83)))), ((int)(((byte)(83)))), ((int)(((byte)(83)))));

     

     

    this.radChart1.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.TopLeft;

     

     

    this.radChart1.Legend.Appearance.Visible = false;

     

     

    this.radChart1.Legend.Marker.Appearance.Figure = "Star4";

     

     

    this.radChart1.Legend.Marker.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.BottomRight;

     

     

    this.radChart1.Legend.Visible = false;

     

     

    this.radChart1.Name = "radChart1";

     

     

    this.radChart1.PlotArea.Appearance.Border.Color = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));

     

    chartMargins3.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins3.Bottom")));

     

    chartMargins3.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins3.Left")));

     

    chartMargins3.Right = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins3.Right")));

     

    chartMargins3.Top = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins3.Top")));

     

     

    this.radChart1.PlotArea.Appearance.Dimensions.Margins = chartMargins3;

     

     

    this.radChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;

     

     

    this.radChart1.PlotArea.Appearance.FillStyle.MainColor = System.Drawing.Color.White;

     

     

    this.radChart1.PlotArea.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Left;

     

     

    this.radChart1.PlotArea.Appearance.SeriesPalette = "Palette";

     

     

    this.radChart1.PlotArea.DataTable.Appearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True;

     

     

    this.radChart1.PlotArea.DataTable.Appearance.CellHeight = 100;

     

     

    this.radChart1.PlotArea.DataTable.Appearance.CellWidth = 200;

     

    chartMargins4.Bottom = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins4.Bottom")));

     

    chartMargins4.Left = ((Telerik.Charting.Styles.

    Unit)(resources.GetObject("chartMargins4.Left")));

     

     

    this.radChart1.PlotArea.DataTable.Appearance.Dimensions.Margins = chartMargins4;

     

     

    this.radChart1.PlotArea.DataTable.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.BottomLeft;

     

     

    this.radChart1.PlotArea.DataTable.Appearance.RenderType = Telerik.Charting.TableRenderType.AutoSize;

     

     

    this.radChart1.PlotArea.DataTable.Visible = true;

     

     

    this.radChart1.PlotArea.EmptySeriesMessage.TextBlock.Text = resources.GetString("radChart1.PlotArea.EmptySeriesMessage.TextBlock.Text");

     

     

    this.radChart1.PlotArea.XAxis.Appearance.Color = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));

     

     

    this.radChart1.PlotArea.XAxis.Appearance.MajorGridLines.Color = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));

     

     

    this.radChart1.PlotArea.XAxis.Appearance.MajorGridLines.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;

     

     

    this.radChart1.PlotArea.XAxis.Appearance.MajorTick.Color = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));

     

     

    this.radChart1.PlotArea.XAxis.Appearance.MajorTick.Width = 0F;

     

     

    this.radChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

     

    this.radChart1.PlotArea.XAxis.AutoScale = false;

     

     

    this.radChart1.PlotArea.XAxis.AxisLabel.Appearance.RotationAngle = 270F;

     

     

    this.radChart1.PlotArea.XAxis.AxisLabel.Appearance.Visible = true;

     

     

    this.radChart1.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

     

    this.radChart1.PlotArea.XAxis.AxisLabel.TextBlock.Text = resources.GetString("radChart1.PlotArea.XAxis.AxisLabel.TextBlock.Text");

     

     

    this.radChart1.PlotArea.XAxis.AxisLabel.Visible = true;

     

     

    this.radChart1.PlotArea.XAxis.DataLabelsColumn = "HeightRangeTextual";

     

    chartAxisItem1.Value =

    new decimal(new int[] {

     

    1,

    0,

    0,

    0});

    chartAxisItem2.Value =

    new decimal(new int[] {

     

    2,

    0,

    0,

    0});

    chartAxisItem3.Value =

    new decimal(new int[] {

     

    3,

    0,

    0,

    0});

    chartAxisItem4.Value =

    new decimal(new int[] {

     

    4,

    0,

    0,

    0});

    chartAxisItem5.Value =

    new decimal(new int[] {

     

    5,

    0,

    0,

    0});

    chartAxisItem6.Value =

    new decimal(new int[] {

     

    6,

    0,

    0,

    0});

    chartAxisItem7.Value =

    new decimal(new int[] {

     

    7,

    0,

    0,

    0});

     

    this.radChart1.PlotArea.XAxis.Items.AddRange(new Telerik.Charting.ChartAxisItem[] {

     

    chartAxisItem1,

    chartAxisItem2,

    chartAxisItem3,

    chartAxisItem4,

    chartAxisItem5,

    chartAxisItem6,

    chartAxisItem7});

     

    this.radChart1.PlotArea.XAxis.MinValue = 1;

     

     

    this.radChart1.PlotArea.YAxis.Appearance.Color = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));

     

     

    this.radChart1.PlotArea.YAxis.Appearance.MajorGridLines.Color = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));

     

     

    this.radChart1.PlotArea.YAxis.Appearance.MajorTick.Color = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));

     

     

    this.radChart1.PlotArea.YAxis.Appearance.MinorGridLines.Color = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238)))));

     

     

    this.radChart1.PlotArea.YAxis.Appearance.MinorTick.Color = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));

     

     

    this.radChart1.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

     

    this.radChart1.PlotArea.YAxis.AxisLabel.Appearance.RotationAngle = 0F;

     

     

    this.radChart1.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

     

    this.radChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = resources.GetString("radChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text");

     

     

    this.radChart1.PlotArea.YAxis.AxisMode = Telerik.Charting.ChartYAxisMode.Extended;

     

     

    this.radChart1.PlotArea.YAxis.MaxValue = 300;

     

     

    this.radChart1.PlotArea.YAxis.ScaleBreaks.Enabled = true;

     

     

    this.radChart1.PlotArea.YAxis.Step = 50;

     

     

    this.radChart1.PlotArea.YAxis2.AxisLabel.Appearance.RotationAngle = 0F;

     

    chartSeries1.Appearance.Border.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(111)))), ((int)(((byte)(174)))), ((int)(((byte)(12)))));

     

    gradientElement4.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));

     

    gradientElement5.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));

     

    gradientElement5.Position = 0.5F;

    gradientElement6.Color = System.Drawing.

    Color.Red;

     

    gradientElement6.Position = 1F;

    chartSeries1.Appearance.FillStyle.FillSettings.ComplexGradient.AddRange(

    new Telerik.Charting.GradientElement[] {

     

    gradientElement4,

    gradientElement5,

    gradientElement6});

    chartSeries1.Appearance.FillStyle.FillType = Telerik.Charting.Styles.

    FillType.ComplexGradient;

     

    chartSeries1.Appearance.ShowLabels =

    false;

     

    chartSeries1.Appearance.TextAppearance.TextProperties.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

    chartSeries1.DataYColumn =

    "BlockedTotalInDm2";

     

    chartSeries1.Name =

    "Blocked (dm^2)";

     

    chartSeries1.Type = Telerik.Charting.

    ChartSeriesType.StackedBar;

     

    chartSeries2.Appearance.Border.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(111)))), ((int)(((byte)(174)))), ((int)(((byte)(12)))));

     

    gradientElement7.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(223)))), ((int)(((byte)(243)))));

     

    gradientElement8.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));

     

    gradientElement8.Position = 0.5F;

    gradientElement9.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));

     

    gradientElement9.Position = 1F;

    chartSeries2.Appearance.FillStyle.FillSettings.ComplexGradient.AddRange(

    new Telerik.Charting.GradientElement[] {

     

    gradientElement7,

    gradientElement8,

    gradientElement9});

    chartSeries2.Appearance.FillStyle.FillType = Telerik.Charting.Styles.

    FillType.ComplexGradient;

     

    chartSeries2.Appearance.FillStyle.MainColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));

     

    chartSeries2.Appearance.FillStyle.SecondColor = System.Drawing.

    Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));

     

    chartSeries2.Appearance.ShowLabels =

    false;

     

    chartSeries2.Appearance.TextAppearance.TextProperties.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

    chartSeries2.DataYColumn =

    "OccupiedTotalInDm2";

     

    chartSeries2.Name =

    "Occupied (dm^2)";

     

    chartSeries2.Type = Telerik.Charting.

    ChartSeriesType.StackedBar;

     

    chartSeries3.Appearance.Border.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(67)))), ((int)(((byte)(181)))), ((int)(((byte)(229)))));

     

    gradientElement10.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));

     

    gradientElement11.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));

     

    gradientElement11.Position = 0.5F;

    gradientElement12.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));

     

    gradientElement12.Position = 1F;

    chartSeries3.Appearance.FillStyle.FillSettings.ComplexGradient.AddRange(

    new Telerik.Charting.GradientElement[] {

     

    gradientElement10,

    gradientElement11,

    gradientElement12});

    chartSeries3.Appearance.FillStyle.FillType = Telerik.Charting.Styles.

    FillType.ComplexGradient;

     

    chartSeries3.Appearance.ShowLabels =

    false;

     

    chartSeries3.Appearance.TextAppearance.TextProperties.Color = System.Drawing.

    Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));

     

    chartSeries3.DataYColumn =

    "FreeInDm2";

     

    chartSeries3.Name =

    "Free (dm^2)";

     

    chartSeries3.Type = Telerik.Charting.

    ChartSeriesType.StackedBar;

     

     

    this.radChart1.Series.AddRange(new Telerik.Charting.ChartSeries[] {

     

    chartSeries1,

    chartSeries2,

    chartSeries3});

     

    this.radChart1.SeriesOrientation = Telerik.Charting.ChartSeriesOrientation.Horizontal;

     

     

    this.radChart1.SeriesPalette = "Palette";

     

     

    this.radChart1.Skin = "Telerik";

     

     

    //

     

     

    // WarehouseOccupationChart

     

     

    //

     

    resources.ApplyResources(

    this, "$this");

     

     

    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

     

     

    this.Controls.Add(this.radChart1);

     

     

    this.Name = "SurfaceChart";

     

    ((System.ComponentModel.

    ISupportInitialize)(this.radChart1)).EndInit();

     

     

    this.ResumeLayout(false);

     

    }

    #endregion

     

    private Telerik.WinControls.UI.RadChart radChart1;

     

    }

    }


    If you watch this code in designer preview, then you could select another chart type.
    Just klik in the properties panel of the VS designer and select the property 'DefaultType'.  (make sure only the cursor is in that property and don't drops down a combo menu.'

    No just select a consequetive number of chart types and you'll get a nice Exception dialog:

    The control Telerik.WinControls.UI.RadChart has thrown an unhandled exception in the designer and has been disabled.

    Exception: Object reference not set to an instance of an object.

    Stack trace: 
        at     Telerik.WinControls.UI.RadChart.GetImage()
        at     Telerik.WinControls.UI.RadChart.OnPaint(PaintEventArgs e)



    Secondly i get the same error during runtime when I try to bind the chart to my data source (eventhough the preview chart draws well).

    Strangely my databinding used to work with an older Telerik version.

    Kind regards,

    Jack.

    PS: How can I add myself again as developer on our account. I've removed myself, but there is no way to readd myself.

  6. Jack
    Jack avatar
    21 posts
    Member since:
    Sep 2008

    Posted 25 May 2009 Link to this post

    Hello Evtim,

    For your information:
    The latter error I was speaking about is the following:

     at Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex)
       at Telerik.Charting.Chart.GetImage(Int32 width, Int32 height)
       at Telerik.Charting.Chart.GetImage()
       at Telerik.WinControls.UI.RadChart.GetImage()
       at Telerik.WinControls.UI.RadChart.OnPaint(PaintEventArgs e)
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
       at System.Windows.Forms.Control.WmPaint(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.UserControl.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    It occurs when I databind the chart.


    Kind regards,

    Jack
  7. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 27 May 2009 Link to this post

    Hi Jack,

    You need to contact the license holder as he is the only one that can add you as a developer.

    On the code sent - unfortunately, there are some resources missing. Please, create a Support thread and attach the whole project (you won't be able to do that before you are added back as a developer).

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. shinu rag
    shinu rag avatar
    48 posts
    Member since:
    Feb 2010

    Posted 10 Aug 2010 Link to this post

    hii Evtim ,
    i need your help...

    here my codes
    // Global Deceleration
    ChartSeries series1Oper = new ChartSeries("Oper");
    ChartSeries series2Anes = new ChartSeries("Anes");
    int PatientID, CheckInID, AnesthesiaID;
     
    mast_tbl_AnesthesiaVitalSigns ObjAnesthesiaVitalSign = new  mast_tbl_AnesthesiaVitalSigns();
     
    mast_tbl_AnesthesiaVitalSignsDataAccess ObjAnesthesiaVitalSignData = new  mast_tbl_AnesthesiaVitalSignsDataAccess(Program._path);
     
     
    // Start Form_Load event
     this.radChart1.PlotArea.YAxis.AutoScale = false;
     this.radChart1.PlotArea.YAxis.IsZeroBased = false;
     this.radChart1.PlotArea.YAxis.AddRange(5, 200, 10);
      
                     
     radChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortTime;
                    radChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 90;
                    radChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = AlignedPositions.Top;
      
     radChart1.PlotArea.XAxis.IsZeroBased = false;
     radChart1.PlotArea.XAxis.AutoScale = false;
      
      
    series1Oper.Appearance.FillStyle.FillType = FillType.Image;
                    series1Oper.Appearance.Border.Color = Color.Transparent;
                    series1Oper.Appearance.FillStyle.FillSettings.BackgroundImage = Application.StartupPath + @"\ChartSymbols\Oper.gif";
      
      
                    series2Anes.Appearance.FillStyle.FillType = FillType.Image;
                    series2Anes.Appearance.Border.Color = Color.Transparent;
                    series2Anes.Appearance.FillStyle.FillSettings.BackgroundImage = Application.StartupPath + @"\ChartSymbols\Anes.gif";
      
     radChart1.PlotArea.XAxis.DataLabelsColumn = "Date";
      
                    series1Oper.DataYColumn = "Oper";
                    series1Oper.Type = ChartSeriesType.Point;
      
                    series2Anes.DataYColumn = "Anes";
                    series2Anes.Type = ChartSeriesType.Point;
      
    radChart1.Series.Add(series1Oper);
                    radChart1.Series.Add(series2Anes);
      
    BindData();
    //End Form_Load event
      
    // BindData Function
      
    void BindData()
    {
    ListAnesthesiaVitalSign = ObjAnesthesiaVitalSignData.SelectAll().Where(t1 => t1.PatientID == this.PatientID && t1.AnesthesiaID == this.AnesthesiaID).ToList();
                var Query1 = from AnesVitalSings in ListAnesthesiaVitalSign
                             orderby AnesVitalSings.CreatedOn
                             select new
                             {
                                 Date = AnesVitalSings.CreatedOn.ToShortTimeString(),
                                 Oper = AnesVitalSings.Oper,
                                 Anes = AnesVitalSings.Anes
                             };
                if (ListAnesthesiaVitalSign.Count > 0)
                {
                    btnStartAnesthesia.Enabled = false;
                }
      
                radChart1.DataSource = Query1.ToList();
                radChart1.DataBind();
      
     }
    // End BindData Function
      
      
    // Add new Item
     private void btnAdd_Click(object sender, EventArgs e)
    {
    ObjAnesthesiaVitalSign = new mast_tbl_AnesthesiaVitalSigns();
                ObjAnesthesiaVitalSign.PatientID = this.PatientID;
                ObjAnesthesiaVitalSign.AnesthesiaID = this.AnesthesiaID;
                ObjAnesthesiaVitalSign.Oper = 0;
                ObjAnesthesiaVitalSign.Anes = 50;
                ObjAnesthesiaVitalSign.CreatedOn = DateTime.Now;
                ObjAnesthesiaVitalSignData.Save(ObjAnesthesiaVitalSign);
    BindData();
    }
    // End Add new Item

    while i add a new item in running mode, i got an error that

    An Unexpected error has occurred. Please review the InnerException for more information how to resolve the problem.
    can i bind the datas to radchart in running mode ???

    thanks,
    Shinu
Back to Top
UI for WinForms is Visual Studio 2017 Ready